Subject: Overhauling PLIST command set
To: None <tech-pkg@NetBSD.org>
From: Thomas Klausner <wiz@NetBSD.org>
List: tech-pkg
Date: 10/28/2005 16:32:51
Hi!

I'd like to overhaul the PLIST command set in pkgsrc.  The idea is to
get rid of all @exec and @unexec calls and add some missing features.

For that, I'd like to introduce new keywords, replacing some of the old
ones.  The new set of keywords that can be used by packagers:

@comment
Same as before.

@version
File format version used when creating this package, for easier
changes in the future (see below).

@dir
Directory owned by a package.  Replaces @dirrm (and @exec ${MKDIR}).

@shareddir
Directory used by multiple packages.  The first package installed
using it creates it, last one deinstalled removes it (probably using
the refcount framework).  Replaces @unexec ${RMDIR} (and @exec ${MKDIR}).

@changingfile
A file that can change during the lifetime of a package.  Its checksum
is not checked during deinstall.  Replaces @exec ${RM}.

The currently existing and used keywords @exec, @unexec, @dirrm,
and the unused (AFAIK) @cd, @owner, @group, @mode, @ignore_inst,
and @option will be removed.

Here's a list of current uses of @{un,}exec which are not covered
by the above.  I might have overlooked one or two.  In parentheses
are my suggestions on how to handle them:

. mktexlsr (add bsd.pkg.install.mk support)
. texconfig rehash (add bsd.pkg.install.mk support)
. ln (should be fixed to have the entry in the tarfile)
. test || cp (should use config framework)
. rm -rf (kill with extreme prejudice)
. cp -p, sh MAKEDEV (suse{,91}_base, should use an install script)
. cmp && rm (GConf, should use config file framework)
. if [ -f ] && echo (skk*, should use config file framework)
. mkfontdir (various, should use fonts.mk)
. echo (deinstall message, can be done differently, I'm sure)
. install -d /var/games/foo/bar (various games, use config file framework)
. touch (+chmod) (use config file framework)
. regxpcom/regchrome (mozilla packages, use INSTALL script)
. updating /etc/shells (glunix, should use shells framework)
. pkg_admin rebuild (pkg_install, use INSTALL script)
. gconftool (galeon12, remove package or use INSTALL script)
. chmod (x3270; should use fonts framework)
. modifying files outside of ${PREFIX} (mostly /var/games; use config
  file framework)

Additionally, the INSTALL and DEINSTALL scripts currently used
in pkgsrc should be audited and converted to current pkgsrc standards.

Long term, I'd like to move the following features which are currently
implemented using shell scripts into the pkgtools, too. Not right now,
though, getting rid of the @exec's comes first.
. info file
. user/group
. /etc/shells
. config files
. reference count dirs/files
. font handling
. permissions

Am I overlooking any cases that should be fixed short term?

Cheers,
 Thomas

P.S.: Thanks to dillo@ for review.