tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

OWN_DIRS semantics



Some of you know that I've been working on a framework called
"pkgtasks" that replaces the existing "pkginstall" framework,
which supplies a common set of INSTALL/DEINSTALL scripts used by
packages.  The frameworks are used in packages by setting certain
package-settable variables, e.g., MAKE_DIRS, OWN_DIRS,
CONF_FILES, etc.

The frameworks have nearly identical functionality, but the
pkgtasks framework is stricter in some of its checks than
pkginstall.  In particular, the stricter checks manifest as
different semantics for OWN_DIRS{,_PERMS}.

The existing pkginstall framework's concept of directory
ownership is that ownership is a hint.  "Owned" directories are
created during preinstall and removed during postremove just like
any other directory listed in MAKE_DIRS.  The difference is that
at postremove, if and "owned" directory still exists, then you
are warned about it in an informative message.

The new pkgtasks framework's concept of directory ownership is
more strict -- an "owned" directory can only be owned by a single
installed package, and when that package is installed, it sets an
"owned" property on that directory.  Other packages may use the
directory, but they may not claim to own it as well.  If multiple
packages make countering claims of ownership, then an error is
thrown.

I've noticed that some packages fail in my local bulk builds when
testing the pkgtasks framework because of conflicting ownership
information.  For example, x11/modular-xorg-server and
x11/xkeyboard-config both set OWN_DIRS+=${VARBASE}/db/xkb.
Arguably, only one of those packages should own that directory,
but right now the only thing that happens is that when
modular-xorg-server is removed and /var/db/xdb is not empty, then
the user is (incorrectly) prompted to remove that diretory even
though xkeyboard-config is still using that directory.

Which semantics are preferable for packages?  Just warning if an
owned directory is not empty and should be removed by the user,
or true ownership of the directory by a package responsible for
the lifetime of that directory?

Regards,
-- 
Johnny C. Lam
jlam%NetBSD.org@localhost


Home | Main Index | Thread Index | Old Index