proper way to do a recursive install ?

Luigi Rizzo rizzo at icir.org
Thu Feb 1 22:14:32 UTC 2007


On Thu, Feb 01, 2007 at 09:57:12PM +0000, Matthew Seaman wrote:
> Luigi Rizzo wrote:
> > I have a port that just need to install the content of a tarball
> > (a set of headers and C sources) into
> > /usr/local/share/linux-bsd-kmod/linux_compat,
> > 
> > and was wondering what is the proper way to handle this (both in
> > the port's Makefile and in the pkg_plist file).
...
> cpio is handy because it can set the ownership on the installed files
> in the same pass as they are installed.  It relies on the correct
> permissions being set in the source directory, which it will apply to
> the copied files and directories (although use of 'find -depth' does
> give best results for directory permissions).  There are plenty of
> other choices around the ports tree though.

this and the other email both reinforce my point: the same thing
is done over and over and calls for centralizations, also to
avoid bugs (e.g. i forgot to set the permissions on dirs in
my example).

> >     #--- this is pkg-plist 000
> >     @exec mkdir -p %D/share/linux-bsd-kmod
> >     @exec echo "installing into %D/share/linux-bsd-kmod"
> >     @unexec echo "uninstalling into %D/share/linux-bsd-kmod"
> >     @unexec rm -rf %D/share/linux-bsd-kmod
> 
> If your build process generates a constant set of files, then
> why wouldn't you just generate a pkg-plist exactly as would be done
> for any other port?  It might be a bit long, but so what?  We have
> computers that can wrangle all that stuff for us.

several reasons:
1. in this specific port i expect rather often, at least at the
   beginning, to be adding or moving files from one revision to
   the next - either in the distribution, or while i or some third
   party decides to update the port in place. With the above, i
   can make deinstall/reinstall without any change to the plist

2. as a human being looking at the plist i can be reasonably
   confident, reading 4 lines, that the install and uninstall
   are confined to a single place. If i have to inspect 500 lines,
   even if automatically generated (but not by me!) my level of
   confidence goes way down.

3. KISS principle - simple is better.

Unless we decide that wildcards or @exec in pkg-plist are forbidden
(which i would understand from a safety/security point of view, but
is totally impractical) there is no reason not to use more powerful
constructs.

	cheers
	luigi


More information about the freebsd-ports mailing list