summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorjoerg <joerg@pkgsrc.org>2008-09-17 15:21:30 +0000
committerjoerg <joerg@pkgsrc.org>2008-09-17 15:21:30 +0000
commit1a04e21a8be3e37054f3007a5defd711e596451e (patch)
tree8c0cf12d138e09a18b37cd7f22e75527b7cf6010 /pkgtools
parent63dfb5ba451793208dd43c26c0546100d2a39e2f (diff)
downloadpkgsrc-1a04e21a8be3e37054f3007a5defd711e596451e.tar.gz
pkg_install-20080916:
Merge from changes for read_plist from pkg_install-renovation to always initialize the plist and add append_plist for the one case where this is not desired. Fixes PR 39276.
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/pkg_install/files/add/perform.c6
-rw-r--r--pkgtools/pkg_install/files/admin/check.c5
-rw-r--r--pkgtools/pkg_install/files/admin/main.c5
-rw-r--r--pkgtools/pkg_install/files/create/perform.c6
-rw-r--r--pkgtools/pkg_install/files/delete/perform.c8
-rw-r--r--pkgtools/pkg_install/files/lib/conflicts.c2
-rw-r--r--pkgtools/pkg_install/files/lib/lib.h3
-rw-r--r--pkgtools/pkg_install/files/lib/plist.c15
-rw-r--r--pkgtools/pkg_install/files/lib/version.h4
9 files changed, 27 insertions, 27 deletions
diff --git a/pkgtools/pkg_install/files/add/perform.c b/pkgtools/pkg_install/files/add/perform.c
index 60696fb67ca..b2a178557a3 100644
--- a/pkgtools/pkg_install/files/add/perform.c
+++ b/pkgtools/pkg_install/files/add/perform.c
@@ -1,4 +1,4 @@
-/* $NetBSD: perform.c,v 1.72 2008/04/26 17:40:01 joerg Exp $ */
+/* $NetBSD: perform.c,v 1.73 2008/09/17 15:21:30 joerg Exp $ */
#if HAVE_CONFIG_H
#include "config.h"
@@ -14,7 +14,7 @@
#if 0
static const char *rcsid = "from FreeBSD Id: perform.c,v 1.44 1997/10/13 15:03:46 jkh Exp";
#else
-__RCSID("$NetBSD: perform.c,v 1.72 2008/04/26 17:40:01 joerg Exp $");
+__RCSID("$NetBSD: perform.c,v 1.73 2008/09/17 15:21:30 joerg Exp $");
#endif
#endif
@@ -278,8 +278,6 @@ pkg_do_installed(int *replacing, char replace_via[MaxPathSize], char replace_to[
plist_t *depp;
char depC[MaxPathSize];
- depPlist.head = depPlist.tail = NULL;
-
s = strrchr(pkg2chk, '\n');
if (s)
*s = '\0'; /* strip trailing '\n' */
diff --git a/pkgtools/pkg_install/files/admin/check.c b/pkgtools/pkg_install/files/admin/check.c
index 9d69eaa0870..2aaac0b7a2e 100644
--- a/pkgtools/pkg_install/files/admin/check.c
+++ b/pkgtools/pkg_install/files/admin/check.c
@@ -1,4 +1,4 @@
-/* $NetBSD: check.c,v 1.4 2008/09/16 13:32:58 joerg Exp $ */
+/* $NetBSD: check.c,v 1.5 2008/09/17 15:21:30 joerg Exp $ */
#if HAVE_CONFIG_H
#include "config.h"
@@ -8,7 +8,7 @@
#include <sys/cdefs.h>
#endif
#ifndef lint
-__RCSID("$NetBSD: check.c,v 1.4 2008/09/16 13:32:58 joerg Exp $");
+__RCSID("$NetBSD: check.c,v 1.5 2008/09/17 15:21:30 joerg Exp $");
#endif
/*-
@@ -98,7 +98,6 @@ check1pkg(const char *pkgdir, int *filecnt, int *pkgcnt)
err(EXIT_FAILURE, "can't open %s", content);
free(content);
- Plist.head = Plist.tail = NULL;
read_plist(&Plist, f);
p = find_plist(&Plist, PLIST_NAME);
if (p == NULL)
diff --git a/pkgtools/pkg_install/files/admin/main.c b/pkgtools/pkg_install/files/admin/main.c
index 439d32c7046..159b9cbc0c2 100644
--- a/pkgtools/pkg_install/files/admin/main.c
+++ b/pkgtools/pkg_install/files/admin/main.c
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.44 2008/09/16 13:32:58 joerg Exp $ */
+/* $NetBSD: main.c,v 1.45 2008/09/17 15:21:30 joerg Exp $ */
#if HAVE_CONFIG_H
#include "config.h"
@@ -8,7 +8,7 @@
#include <sys/cdefs.h>
#endif
#ifndef lint
-__RCSID("$NetBSD: main.c,v 1.44 2008/09/16 13:32:58 joerg Exp $");
+__RCSID("$NetBSD: main.c,v 1.45 2008/09/17 15:21:30 joerg Exp $");
#endif
/*-
@@ -147,7 +147,6 @@ add_pkg(const char *pkgdir, void *vp)
errx(EXIT_FAILURE, "%s: can't open `%s'", pkgdir, CONTENTS_FNAME);
free(contents);
- Plist.head = Plist.tail = NULL;
read_plist(&Plist, f);
if ((p = find_plist(&Plist, PLIST_NAME)) == NULL) {
errx(EXIT_FAILURE, "Package `%s' has no @name, aborting.", pkgdir);
diff --git a/pkgtools/pkg_install/files/create/perform.c b/pkgtools/pkg_install/files/create/perform.c
index 066a8898c21..6cb63435da9 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.21 2008/04/26 17:40:01 joerg Exp $ */
+/* $NetBSD: perform.c,v 1.22 2008/09/17 15:21:30 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.21 2008/04/26 17:40:01 joerg Exp $");
+__RCSID("$NetBSD: perform.c,v 1.22 2008/09/17 15:21:30 joerg Exp $");
#endif
#endif
@@ -177,7 +177,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/delete/perform.c b/pkgtools/pkg_install/files/delete/perform.c
index 95cf9d34146..26896527cfb 100644
--- a/pkgtools/pkg_install/files/delete/perform.c
+++ b/pkgtools/pkg_install/files/delete/perform.c
@@ -1,4 +1,4 @@
-/* $NetBSD: perform.c,v 1.23 2008/04/23 20:54:39 joerg Exp $ */
+/* $NetBSD: perform.c,v 1.24 2008/09/17 15:21:30 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.15 1997/10/13 15:03:52 jkh Exp";
#else
-__RCSID("$NetBSD: perform.c,v 1.23 2008/04/23 20:54:39 joerg Exp $");
+__RCSID("$NetBSD: perform.c,v 1.24 2008/09/17 15:21:30 joerg Exp $");
#endif
#endif
@@ -492,10 +492,6 @@ require_find_recursive_down(lpkg_t *thislpp, package_t *plist)
/* remove a direct req from our queue */
TAILQ_REMOVE(&reqq, lpp, lp_link);
- /* Reset some state */
- rPlist.head = NULL;
- rPlist.tail = NULL;
-
/* prepare for recursion */
chdir(_pkgdb_getPKGDB_DIR());
if (ispkgpattern(lpp->lp_name)) {
diff --git a/pkgtools/pkg_install/files/lib/conflicts.c b/pkgtools/pkg_install/files/lib/conflicts.c
index 35dd204ccf7..0be50f3b1cc 100644
--- a/pkgtools/pkg_install/files/lib/conflicts.c
+++ b/pkgtools/pkg_install/files/lib/conflicts.c
@@ -71,8 +71,6 @@ check_package_conflict(const char *pkgname, void *v)
int rv;
rv = 0;
- pkg.head = NULL;
- pkg.tail = NULL;
f = fopen_contents(pkgname, "r");
read_plist(&pkg, f);
diff --git a/pkgtools/pkg_install/files/lib/lib.h b/pkgtools/pkg_install/files/lib/lib.h
index 35292dd327c..b803b6746e1 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.44 2008/04/26 17:40:01 joerg Exp $ */
+/* $NetBSD: lib.h,v 1.45 2008/09/17 15:21:30 joerg Exp $ */
/* from FreeBSD Id: lib.h,v 1.25 1997/10/08 07:48:03 charnier Exp */
@@ -407,6 +407,7 @@ void write_plist(package_t *, FILE *, char *);
void stringify_plist(package_t *, char **, size_t *, 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);
/* Package Database */
diff --git a/pkgtools/pkg_install/files/lib/plist.c b/pkgtools/pkg_install/files/lib/plist.c
index c0df04b36ca..6701edda7cd 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.20 2008/09/16 13:32:58 joerg Exp $ */
+/* $NetBSD: plist.c,v 1.21 2008/09/17 15:21:30 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.20 2008/09/16 13:32:58 joerg Exp $");
+__RCSID("$NetBSD: plist.c,v 1.21 2008/09/17 15:21:30 joerg Exp $");
#endif
#endif
@@ -360,7 +360,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;
@@ -396,6 +396,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
*/
diff --git a/pkgtools/pkg_install/files/lib/version.h b/pkgtools/pkg_install/files/lib/version.h
index cffe0d0d1de..676216d2bfc 100644
--- a/pkgtools/pkg_install/files/lib/version.h
+++ b/pkgtools/pkg_install/files/lib/version.h
@@ -1,4 +1,4 @@
-/* $NetBSD: version.h,v 1.104 2008/09/16 13:32:58 joerg Exp $ */
+/* $NetBSD: version.h,v 1.105 2008/09/17 15:21:30 joerg Exp $ */
/*
* Copyright (c) 2001 Thomas Klausner. All rights reserved.
@@ -27,6 +27,6 @@
#ifndef _INST_LIB_VERSION_H_
#define _INST_LIB_VERSION_H_
-#define PKGTOOLS_VERSION "20080915"
+#define PKGTOOLS_VERSION "20080916"
#endif /* _INST_LIB_VERSION_H_ */