Mon Aug 11 15:58:15 2008 UTC ()
pkg_create actually does want to mess with the plist before reading it,
so introduce append_plist to give the old behavior and unbreak
pkg_create.


(joerg)
diff -r1.19.2.3 -r1.19.2.4 pkgsrc/pkgtools/pkg_install/files/create/perform.c
diff -r1.42.2.13 -r1.42.2.14 pkgsrc/pkgtools/pkg_install/files/lib/lib.h
diff -r1.17.4.9 -r1.17.4.10 pkgsrc/pkgtools/pkg_install/files/lib/plist.c

cvs diff -r1.19.2.3 -r1.19.2.4 pkgsrc/pkgtools/pkg_install/files/create/perform.c (expand / switch to context diff)
--- pkgsrc/pkgtools/pkg_install/files/create/perform.c 2008/08/10 22:08:16 1.19.2.3
+++ pkgsrc/pkgtools/pkg_install/files/create/perform.c 2008/08/11 15:58:15 1.19.2.4
@@ -1,4 +1,4 @@
-/*	$NetBSD: perform.c,v 1.19.2.3 2008/08/10 22:08:16 joerg Exp $	*/
+/*	$NetBSD: perform.c,v 1.19.2.4 2008/08/11 15:58:15 joerg Exp $	*/
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -11,7 +11,7 @@
 #if 0
 static const char *rcsid = "from FreeBSD Id: perform.c,v 1.38 1997/10/13 15:03:51 jkh Exp";
 #else
-__RCSID("$NetBSD: perform.c,v 1.19.2.3 2008/08/10 22:08:16 joerg Exp $");
+__RCSID("$NetBSD: perform.c,v 1.19.2.4 2008/08/11 15:58:15 joerg Exp $");
 #endif
 #endif
 
@@ -172,6 +172,8 @@
 			errx(2, "unable to open contents file '%s' for input", Contents);
 	}
 
+	plist.head = plist.tail = NULL;
+
 	/* If a SrcDir override is set, add it now */
 	if (SrcDir) {
 		if (Verbose && !PlistOnly)
@@ -207,7 +209,7 @@
 	}
 
 	/* Slurp in the packing list */
-	read_plist(&plist, pkg_in);
+	append_plist(&plist, pkg_in);
 
 	if (pkg_in != stdin)
 		fclose(pkg_in);

cvs diff -r1.42.2.13 -r1.42.2.14 pkgsrc/pkgtools/pkg_install/files/lib/lib.h (expand / switch to context diff)
--- pkgsrc/pkgtools/pkg_install/files/lib/lib.h 2008/08/05 22:56:24 1.42.2.13
+++ pkgsrc/pkgtools/pkg_install/files/lib/lib.h 2008/08/11 15:58:15 1.42.2.14
@@ -1,4 +1,4 @@
-/* $NetBSD: lib.h,v 1.42.2.13 2008/08/05 22:56:24 joerg Exp $ */
+/* $NetBSD: lib.h,v 1.42.2.14 2008/08/11 15:58:15 joerg Exp $ */
 
 /* from FreeBSD Id: lib.h,v 1.25 1997/10/08 07:48:03 charnier Exp */
 
@@ -337,6 +337,7 @@
 void	stringify_plist(package_t *, char **, size_t *, const char *);
 void	parse_plist(package_t *, const char *);
 void    read_plist(package_t *, FILE *);
+void    append_plist(package_t *, FILE *);
 int     delete_package(Boolean, Boolean, package_t *, Boolean, const char *);
 
 /* Package Database */

cvs diff -r1.17.4.9 -r1.17.4.10 pkgsrc/pkgtools/pkg_install/files/lib/plist.c (expand / switch to context diff)
--- pkgsrc/pkgtools/pkg_install/files/lib/plist.c 2008/08/10 22:09:38 1.17.4.9
+++ pkgsrc/pkgtools/pkg_install/files/lib/plist.c 2008/08/11 15:58:15 1.17.4.10
@@ -1,4 +1,4 @@
-/*	$NetBSD: plist.c,v 1.17.4.9 2008/08/10 22:09:38 joerg Exp $	*/
+/*	$NetBSD: plist.c,v 1.17.4.10 2008/08/11 15:58:15 joerg Exp $	*/
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -11,7 +11,7 @@
 #if 0
 static const char *rcsid = "from FreeBSD Id: plist.c,v 1.24 1997/10/08 07:48:15 charnier Exp";
 #else
-__RCSID("$NetBSD: plist.c,v 1.17.4.9 2008/08/10 22:09:38 joerg Exp $");
+__RCSID("$NetBSD: plist.c,v 1.17.4.10 2008/08/11 15:58:15 joerg Exp $");
 #endif
 #endif
 
@@ -353,7 +353,7 @@
  * Read a packing list from a file
  */
 void
-read_plist(package_t *pkg, FILE * fp)
+append_plist(package_t *pkg, FILE * fp)
 {
 	char    pline[MaxPathSize];
 	char   *cp;
@@ -361,9 +361,6 @@
 	int     len;
 	int	free_cp;
 
-	pkg->head = NULL;
-	pkg->tail = NULL;
-
 	while (fgets(pline, MaxPathSize, fp) != (char *) NULL) {
 		for (len = strlen(pline); len &&
 		    isspace((unsigned char) pline[len - 1]);) {
@@ -390,6 +387,15 @@
 		if (free_cp)
 			free(cp);
 	}
+}
+
+void
+read_plist(package_t *pkg, FILE * fp)
+{
+	pkg->head = NULL;
+	pkg->tail = NULL;
+
+	append_plist(pkg, fp);
 }
 
 /*