Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 1 Feb 2007 14:14:31 -0800
From:      Luigi Rizzo <rizzo@icir.org>
To:        Matthew Seaman <m.seaman@infracaninophile.co.uk>
Cc:        ports@freebsd.org
Subject:   Re: proper way to do a recursive install ?
Message-ID:  <20070201141431.B85626@xorpc.icir.org>
In-Reply-To: <45C26238.9050405@infracaninophile.co.uk>; from m.seaman@infracaninophile.co.uk on Thu, Feb 01, 2007 at 09:57:12PM %2B0000
References:  <20070201110345.A83474@xorpc.icir.org> <45C26238.9050405@infracaninophile.co.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070201141431.B85626>