Subject: Re: unprivileged staged installs and libarchive (was Re: "make install" owerwrites files without asking)
To: None <>
From: Joerg Sonnenberger <>
List: tech-pkg
Date: 06/30/2005 13:35:47
On Wed, Jun 29, 2005 at 09:36:13AM -0700, Jeremy C. Reed wrote:
> On Wed, 29 Jun 2005, Joerg Sonnenberger wrote:
> > Often, but not always. Still missing is a way to change ownership of
> > individual files or specify mode bits more explicitly. That would need
> > some integration with pkg_create.
> NetBSD has a good pax that has great feature for utilizing a mtree
> specification for creating files. I also heard that a CD9660 or other
> filesystem writing tools could be made to honor the mtree specification
> for creating files also. (I don't know if this has been done yet though.)

Yes, the idea is to allow pkg_create to utilise either mtree files or the
PLIST (I think that would be the more natural place) to specify which
files have special ownership.

> If we move to a staged install, we will have to clean up all code that
> manually use /bin/cp or their own non-standard routines for installing
> files anyways. So it will be easy to use our INSTALL_* scripts to do the
> mtree specifications (just like NetBSD already does for its unprivileged
> builds).

I don't think that is necessary for most of the packages, since most just
use the default modes and ownership. For a staged install, all that is
needed for 90% of the packages is to specify another installation location.

> > BTW, this leads to another question. Would there be interest in rewriting
> > the pkg_tools to use e.g. libarchive? It would make e.g. pkg_add fully
> > self-contained and can allow various optimisations currently not possible.
> Please tell us more. Why more self-contained? And what types of
> optimizations?

pkg_add wouldn't have to call any other binary. That's a good thing since
you make bootstrapping e.g. for binary-only systems easier. It would also allow
pkg_add a bit more control over the file and directory handling. For example,
reference counting of the directories created, making @dirrm obsolete.

> (And I assume libarchive could honor mtree specifications easily too.)

Sure, since pkg_create would specify explicitly e.g. modes (either by copying
the stat entry or making one from scratch).