Subject: pkg/30099: Allow multiple makefile fragments to be appended to /etc/mk.conf.
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <brook@biology.nmsu.edu>
List: pkgsrc-bugs
Date: 04/30/2005 16:42:00
>Number:         30099
>Category:       pkg
>Synopsis:       Allow pkgtoosl/pkg_comp to append multiple makefile fragments to the chroot /etc/mk.conf.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Apr 30 16:42:00 +0000 2005
>Originator:     brook@biology.nmsu.edu
>Release:        NetBSD 1.6.1
>Organization:
Brook G. Milligan                      Internet:  brook@nmsu.edu
Department of Biology
New Mexico State University            Telephone:  (505) 646-7980
Las Cruces, New Mexico  88003  U.S.A.  FAX:        (505) 646-5665
>Environment:
	
	
System: NetBSD viola.nmsu.edu 1.6.1 NetBSD 1.6.1 (VIOLA) #0: Thu Dec 2 22:13:05 MST 2004 root@viola.nmsu.edu:/usr/src-1.6.1/sys/arch/i386/compile/VIOLA i386
Architecture: i386
Machine: i386
>Description:
	The current version of pkgtools/pkg_comp includes a
configuration variable, EXTRAMK, that allows a single makefile
fragment to be appended to /etc/mk.conf during the construction of a
chroot environment.  It may be desirable to divide the information
required for /etc/mk.conf into more than a single file.  The attached
patch allows EXTRAMK to contain a space-separated list of files, each
of which will be appended to /etc/mk.conf.  Note that this has no
effect on the original behavior in which an empty variable did nothing
and a single file name appended the single file.
>How-To-Repeat:
	Try to use pkgtools/pkg_comp to install multiple makefile
fragments into the chroot /etc/mk.conf.
>Fix:
	Apply the following patch in the pkgtools/pkg_comp directory.

--- files/pkg_comp.8.orig	Thu Jul 15 08:18:32 2004
+++ files/pkg_comp.8	Sat Apr 30 10:31:46 2005
@@ -198,7 +198,7 @@
 Defaults to
 .Pa /var/pub/NetBSD .
 .It EXTRAMK
-Specifies a file that must be appended to
+Specifies a space-separated list of files that must be appended to
 .Pa $DESTDIR/etc/mk.conf .
 This is useful to add special items to this configuration file.
 Defaults to nothing.
--- files/pkg_comp.sh.orig	Thu Jul 15 08:18:32 2004
+++ files/pkg_comp.sh	Sat Apr 30 10:31:13 2005
@@ -555,11 +555,13 @@
     done
 
     if [ -n "$EXTRAMK" ]; then
-        if [ ! -f "$EXTRAMK" ]; then
-            err "Cannot find $EXTRAMK"
-        else
-            cat $EXTRAMK >> $file
-        fi
+        for mkfile in $EXTRAMK; do
+	    if [ ! -f "$mkfile" ]; then
+		err "Cannot find $mkfile"
+	    else
+		cat $mkfile >> $file
+	    fi
+        done
     fi
 
     if [ "$USE_AUDIT_PACKAGES" != "yes" ]; then

>Unformatted: