Re: OS X packaging is an embarrassment

[prev] [thread] [next] [lurker] [Date index for 2006/05/22]

From: Luke Kanies
Subject: Re: OS X packaging is an embarrassment
Date: 00:06 on 22 May 2006
On Sun, 21 May 2006, Peter da Silva wrote:

> > Sure, just like an *nix or whatever; but you don't know why it's that way,
> > and you don't know if that's correct.
>
> In UNIX a typical package involves having files in 10 different obscurely
> named directories, with names like "/usr/sbin" that are STILL the subject
> of active debate over whetehr something should be "sbin" or "libexec".

That's just semantics, and I don't really care.  Pick something, record it
in your package manifest, and do it consistently; that's all I care about.

When I say "why" in this case, I mean: Given a file, why does that file
exist?  Is it the correct file?

For instance, in the process of getting DarwinPorts set up yesterday, I had
to install the X11/Intrinsic.h header.  You probably have that header on
your computer.  You could certainly use find or whatever to find it, if so.
Upon finding it, could you tell me what package installed it?  That's the
"why" I'm talking about.

> In OS X a typical package involves having one directory tree sitting
> in any convenient folder.

I'm not convinced.  None of the OS packages are that way.

luke@phage(0) $ ls /Library/Receipts/ | wc -l
     101

I have maybe installed 10 packages on this machine, which means that my box
shipped with ~90 packages installed.  Yet:

luke@phage(0) $ ls /Applications/ | wc -l
      37

Hmmm.  Something's certainly screwy.  How do I figure out that discrepancy?
Well, I certainly can't ask the stupid computer, at least not without
writing a script to understand their receipt format.

Hate.

> This is a HUGE difference.

Eh, I don't agree.  I've managed packages that way on Unix, linking things
back to /usr/local or whatever, and it's not much easier.  I can whip up a
script in four languages to uninstall a package by hand for any of multiple
decent package formats -- rpm, dpkg, emerge, whatever -- as long as I can
ask the packaging system, "what files are associated with this package?"

With dpkg, I just say, dpkg -L <package name>.  I don't care where the files
are; they could each be in a directory named for the file's checksum for all
I care, as long as the package works correctly and I can use tools to do all
the necessary work.

> It's why the lack of a heavy duty package system is an annoyance, not a
> hate. If it was built out of packages like a Linux distro that would be
> different.

It's an annoyance to you; it's very much a hate to me.

And the OS is very clearly built out of confusing packages like Linux.
You're glossing over that and just talking about the applications, many of
which aren't nearly as pretty as you make out.

> > How can I ask my Mac if a given package is installed correctly?  Oh, right,
> > I can't.
>
> A properly designed package can't be improperly installed. Really. The
> package is the installation, there's nothing else to see.

Files can't get corrupted?  Permissions can't go wrong?  Ownership can't get
messed up?  Software can't get rooted? Ever?  How do you know?

I really do think it's important to know whether the computer looks like
it's supposed to.  X files should exist, Y files should by owned by A, and Z
files should have N checksums.  Do they?

> > It's got nothing to do with Linux; it's got to do with the OS being able to
> > answer straightforward questions like, "Are you configured correctly?".
>
> Erm... what? I know it can answer the question "what packages do you have
> installed", but that's a long way from "are you configured correctly".

Any package management system worth its salt can exhaustively tell you
whether every single managed file has the right mode, ownership, and
checksum.  It might take an hour, but it'll tell you.

Obviously it's up to me to configure the actual functionality of the system,
but with that kind of check at least I know it's me, not the app.  And I
know the box hasn't been rooted (yes, I know, they could root the pkg db;
there are ways to handle that, too), and that my app will actually start.

I maintain an automation tool, Puppet
(http://reductivelabs.com/projects/puppet), and I spend a lot of time using
it to make sure configurations don't drift.  Apache's log files all need to
exist and be owned by the apache user or it won't start; are they?  How do
you know?

Of course, no package management system reaches into configuration files to
perform tests like that right now, but give me a couple of years.

-- 
Anyone who considers arithmatical methods of producing random digits
is, of course, in a state of sin.    --John Von Neumann
---------------------------------------------------------------------
Luke Kanies | http://reductivelabs.com | http://madstop.com

There's stuff above here

Generated at 14:00 on 27 May 2006 by mariachi 0.52