diff options
author | joerg <joerg> | 2008-08-11 15:58:15 +0000 |
---|---|---|
committer | joerg <joerg> | 2008-08-11 15:58:15 +0000 |
commit | 01804cf20a0d6597bc74ea1fe8318ddc68ecd1cb (patch) | |
tree | 1af0634e4a0d07f81c699efb987fa6e8a1036a48 | |
parent | 0db91763add9cc4b021602be56c9d40cbe843cfb (diff) | |
download | pkgsrc-01804cf20a0d6597bc74ea1fe8318ddc68ecd1cb.tar.gz |
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.
-rw-r--r-- | pkgtools/pkg_install/files/create/perform.c | 8 | ||||
-rw-r--r-- | pkgtools/pkg_install/files/lib/lib.h | 3 | ||||
-rw-r--r-- | pkgtools/pkg_install/files/lib/plist.c | 18 |
3 files changed, 19 insertions, 10 deletions
diff --git a/pkgtools/pkg_install/files/create/perform.c b/pkgtools/pkg_install/files/create/perform.c index c1664df0aaf..c30970952fb 100644 --- a/pkgtools/pkg_install/files/create/perform.c +++ b/pkgtools/pkg_install/files/create/perform.c @@ -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 @@ pkg_perform(const char *pkg) 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 @@ pkg_perform(const char *pkg) } /* Slurp in the packing list */ - read_plist(&plist, pkg_in); + append_plist(&plist, pkg_in); if (pkg_in != stdin) fclose(pkg_in); diff --git a/pkgtools/pkg_install/files/lib/lib.h b/pkgtools/pkg_install/files/lib/lib.h index 48f4979c7f2..eca555493df 100644 --- a/pkgtools/pkg_install/files/lib/lib.h +++ b/pkgtools/pkg_install/files/lib/lib.h @@ -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 write_plist(package_t *, FILE *, char *); 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 */ diff --git a/pkgtools/pkg_install/files/lib/plist.c b/pkgtools/pkg_install/files/lib/plist.c index 63a5aab45a0..2b0bd10683d 100644 --- a/pkgtools/pkg_install/files/lib/plist.c +++ b/pkgtools/pkg_install/files/lib/plist.c @@ -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 @@ parse_plist(package_t *pkg, const char *buf) * 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 @@ read_plist(package_t *pkg, FILE * fp) 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]);) { @@ -392,6 +389,15 @@ read_plist(package_t *pkg, FILE * fp) } } +void +read_plist(package_t *pkg, FILE * fp) +{ + pkg->head = NULL; + pkg->tail = NULL; + + append_plist(pkg, fp); +} + /* * Write a packing list to a file, converting commands to ASCII equivs */ |