Subject: Re: "make install" owerwrites files without asking
To: Jeremy C. Reed <reed@reedmedia.net>
From: Pavel Cahyna <pcah8322@artax.karlin.mff.cuni.cz>
List: tech-pkg
Date: 06/30/2005 18:13:51
On Thu, Jun 30, 2005 at 08:18:45AM -0700, Jeremy C. Reed wrote:
> On Thu, 30 Jun 2005, Pavel Cahyna wrote:
> 
> > It seems that the other idea requires providing shell wrappers for
> > install, cp, chown/chmod, pax and other utilities, am I right? This seems
> > to be a lot of work.
> 
> Yes, I do agree it is a lot of work. Nevertheless, they must be wrapped in
> one way or another if we are to make them do staged installs too -- in the
> case that many don't allow changing destination directory after the build
> is completed just for the install step.

Are there really many of them? I don't believe Debian or OpenBSD does
this. I think they rather patch the packages to allow setting the
destination directory.

> > Mtree specificatins are otherwise complementary to fakeroot, because
> > fakeroot just stops chmod et al. from complaining, while mtree
> > specifications would tell pkg_create what the desired metadata actually
> > are.
> 
> That reminds me. Does fakeroot help at all with making a package that
> properly has ownership, groups, permissions for extraction on another box?

It seem that it can, if the pkg_create command runs under the same
fakeroot environment. As an example, I tried creating a tar file with some
setuid program as a regular user:

$ fakeroot 
bash-2.05a# mkdir fakeroot
bash-2.05a# chown root:root fakeroot
bash-2.05a# cd fakeroot
bash-2.05a# touch login
bash-2.05a# chown root:root login
bash-2.05a# chmod 4555 login
bash-2.05a# ls -l login 
-r-sr-xr-x    1 root     root            0 Jun 30 18:05 login
bash-2.05a# cd ..
bash-2.05a# tar cf - fakeroot | tar tvf -
drwxr-xr-x root/root         0 2005-06-30 18:05:11 fakeroot/
-r-sr-xr-x root/root         0 2005-06-30 18:05:11 fakeroot/login
bash-2.05a#

(This is under Debian GNU/Linux, I have yet to try under NetBSD.)

Isn't this all that's needed?

Bye	Pavel