Subject: pkg/30099: Allow multiple makefile fragments to be appended to /etc/mk.conf.
To: None <,,>
From: None <>
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
>Release:        NetBSD 1.6.1
Brook G. Milligan                      Internet:
Department of Biology
New Mexico State University            Telephone:  (505) 646-7980
Las Cruces, New Mexico  88003  U.S.A.  FAX:        (505) 646-5665
System: NetBSD 1.6.1 NetBSD 1.6.1 (VIOLA) #0: Thu Dec 2 22:13:05 MST 2004 i386
Architecture: i386
Machine: i386
	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.
	Try to use pkgtools/pkg_comp to install multiple makefile
fragments into the chroot /etc/mk.conf.
	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 .
-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/	Thu Jul 15 08:18:32 2004
+++ files/	Sat Apr 30 10:31:13 2005
@@ -555,11 +555,13 @@
     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
     if [ "$USE_AUDIT_PACKAGES" != "yes" ]; then