From owner-freebsd-ports@FreeBSD.ORG Thu Feb 1 22:14:32 2007 Return-Path: X-Original-To: ports@freebsd.org Delivered-To: freebsd-ports@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 489D316A406 for ; Thu, 1 Feb 2007 22:14:32 +0000 (UTC) (envelope-from rizzo@icir.org) Received: from xorpc.icir.org (xorpc.icir.org [192.150.187.68]) by mx1.freebsd.org (Postfix) with ESMTP id 21FFD13C46B for ; Thu, 1 Feb 2007 22:14:32 +0000 (UTC) (envelope-from rizzo@icir.org) Received: from xorpc.icir.org (localhost [127.0.0.1]) by xorpc.icir.org (8.12.11/8.13.6) with ESMTP id l11MEVrU086148; Thu, 1 Feb 2007 14:14:31 -0800 (PST) (envelope-from rizzo@xorpc.icir.org) Received: (from rizzo@localhost) by xorpc.icir.org (8.12.11/8.12.3/Submit) id l11MEVlt086147; Thu, 1 Feb 2007 14:14:31 -0800 (PST) (envelope-from rizzo) Date: Thu, 1 Feb 2007 14:14:31 -0800 From: Luigi Rizzo To: Matthew Seaman Message-ID: <20070201141431.B85626@xorpc.icir.org> References: <20070201110345.A83474@xorpc.icir.org> <45C26238.9050405@infracaninophile.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <45C26238.9050405@infracaninophile.co.uk>; from m.seaman@infracaninophile.co.uk on Thu, Feb 01, 2007 at 09:57:12PM +0000 Cc: ports@freebsd.org Subject: Re: proper way to do a recursive install ? X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Feb 2007 22:14:32 -0000 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