Subject: Re: Handling of shared directories
To: None <tech-pkg@NetBSD.org>
From: Alan Barrett <email@example.com>
Date: 04/15/2004 12:03:34
On Tue, 13 Apr 2004, Julio M. Merino Vidal wrote:
> [stuff about directories]
I also want a way of creating directories for syspkgs.
I propose overloading the @dirrm directive to mean "pkg_add should
create this directory", in addition to the existing meaning of
"pkg_delete should delete this directory".
Every directory in the base system is tagged with the name of exactly
one syspkg (e.g., the /var/log directory belongs to the base-sys-root
syspkg, according to src/distrib/sets/lists/base/mi). Other syspkgs
that own files in that directory will depend (directly or indirectly) on
the syspkg that owns the directory.
If you create a syspkg using my patches from PR 22514, then the syspkg
foo.tgz file (e.g. base-sys-root-*.tgz) contains a +CONTENTS file that
contains an @dirrm line for every directory, and the foo.tgz file also
contains an actual directory with the correct ownership and permissions
(if you view it with "tar -z -tvf foo.tgz).
However, installing syspkgs via pkg_add does not create the directories,
except as a side effect of creating files in the directories, and it
does not set the permissions. This is because pkg_add ignores the
ownership and permissions on directories in the foo.tgz file, and
ignores "@dirrm" lines.
If pkg_add was changed to create directories that are mentioned in
@dirrm lines (using the ownership and permissions encoded in the
directory's entry in the tgz file, if any, or using default ownership
and permissions if there's no directory entry in the tgz file), then it
would bring syspkgs much closer to being usable, and it would probably
also help deal with shared directories in pkgsrc.
--apb (Alan Barrett)