Subject: Re: Installing files needed by instmp.Qq2aav -- and repeated comments
To: Jeremy C. Reed <reed@reedmedia.net>
From: Johnny Lam <jlam@NetBSD.org>
List: tech-pkg
Date: 02/14/2005 14:29:14
Jeremy C. Reed wrote:
> I noticed a few days ago and again today that +INSTALL messages are saying
> the temporary extraction directory name for the package name, for example:
> 
> ===========================================================================
> Installing files needed by instmp.Qq2aav:
> 
>         /etc/rc.d/kdm already exists.
> 
> or
> 
> ===========================================================================
> Installing files needed by instmp.Qq2aav:
> 
>         /etc/kdm/kdmrc already exists.
> 
> 
> So I look at my created-today /var/db/pkg/kdebase-3.3.2nb3/+INSTALL and it
> has:

This should have been fixed in pkg_install two weeks ago, and was what 
prompted the PKGTOOLS_REQD bump in pkgsrc.  Are your pkg_install tools 
up-to-date?  If so, this is still a bug and you should file a PR.

> Then also while looking at same file I see the same comments and
> definitions repeated. It is 1538 lines long.
> 
> $ grep NetBSD /var/db/pkg/kdebase-3.3.2nb3/+INSTALL
> # $NetBSD: header,v 1.32 2005/02/02 10:33:01 jlam Exp $
> # $NetBSD: usergroup,v 1.7 2005/01/31 21:41:06 jlam Exp $
> # $NetBSD: perms,v 1.1 2005/02/02 10:33:01 jlam Exp $
> # $NetBSD: files,v 1.1 2005/02/02 10:33:01 jlam Exp $
> # $NetBSD: files,v 1.1 2005/02/02 10:33:01 jlam Exp $
> # $NetBSD: dirs,v 1.5 2005/01/31 21:41:06 jlam Exp $
> # $NetBSD: install,v 1.36 2005/02/02 10:33:01 jlam Exp $
> # $NetBSD: install-post,v 1.1 2003/11/23 07:14:43 jlam Exp $
> # $NetBSD: footer,v 1.1 2001/11/19 16:18:44 jlam Exp $
> 
> (No ident here.)
> 
> And it sets the same variables several times.
> 
> $ egrep '^[A-Z]+=' /var/db/pkg/kdebase-3.3.2nb3/+INSTALL | sort | uniq -c
> | sort -n | tail
>       5 GREP="/usr/bin/grep"
>       5 MKDIR="/bin/mkdir -p"
>       5 RM="/bin/rm"
>       5 RMDIR="/bin/rmdir"
>       5 SELF=$0
>       6 CHGRP="/bin/chgrp"
>       6 ECHO="echo"
>       6 SED="/bin/sed"
>       6 SORT="/usr/bin/sort"
>       6 TEST="test"
> 
> And it has repeated comments, etc.

The +INSTALL script unpacks several stand-alone helper scripts (+DIRS, 
+FILES, +RCD_SCRIPTS, etc.) when it is run for the first time.  These 
lines are simply in each of those subscripts.  While I could have used a 
more sophisticated implementation that generated the helper scripts on 
the fly, I thought that would make creating and maintaining the helper 
scripts much harder than it should be.  I chose instead to embed the 
complete scripts directly into the +INSTALL script.  This simple 
mechanism is both easy to use and to debug.

	Cheers,

	-- Johnny Lam <jlam@NetBSD.org>