pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/pkg_install-renovation]: pkgsrc/pkgtools/pkg_install/files pkg_create...
details: https://anonhg.NetBSD.org/pkgsrc/rev/6e68567537f7
branches: pkg_install-renovation
changeset: 541595:6e68567537f7
user: joerg <joerg%pkgsrc.org@localhost>
date: Mon Aug 11 15:58:15 2008 +0000
description:
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.
diffstat:
pkgtools/pkg_install/files/create/perform.c | 8 +++++---
pkgtools/pkg_install/files/lib/lib.h | 3 ++-
pkgtools/pkg_install/files/lib/plist.c | 18 ++++++++++++------
3 files changed, 19 insertions(+), 10 deletions(-)
diffs (106 lines):
diff -r 4a620a1d4119 -r 6e68567537f7 pkgtools/pkg_install/files/create/perform.c
--- a/pkgtools/pkg_install/files/create/perform.c Sun Aug 10 22:09:38 2008 +0000
+++ b/pkgtools/pkg_install/files/create/perform.c Mon Aug 11 15:58:15 2008 +0000
@@ -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);
diff -r 4a620a1d4119 -r 6e68567537f7 pkgtools/pkg_install/files/lib/lib.h
--- a/pkgtools/pkg_install/files/lib/lib.h Sun Aug 10 22:09:38 2008 +0000
+++ b/pkgtools/pkg_install/files/lib/lib.h Mon Aug 11 15:58:15 2008 +0000
@@ -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 */
diff -r 4a620a1d4119 -r 6e68567537f7 pkgtools/pkg_install/files/lib/plist.c
--- a/pkgtools/pkg_install/files/lib/plist.c Sun Aug 10 22:09:38 2008 +0000
+++ b/pkgtools/pkg_install/files/lib/plist.c Mon Aug 11 15:58:15 2008 +0000
@@ -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]);) {
@@ -392,6 +389,15 @@
}
}
+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
*/
Home |
Main Index |
Thread Index |
Old Index