summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoerg <joerg>2008-08-10 22:08:16 +0000
committerjoerg <joerg>2008-08-10 22:08:16 +0000
commitbccbed3ce7bde9294fcd33f4858f67090536636c (patch)
treea2b5c7fb3791cc2881f7a61466e12701118435bf
parent5afbec477b4bfd031448d2e6b191496e9569d35c (diff)
downloadpkgsrc-bccbed3ce7bde9294fcd33f4858f67090536636c.tar.gz
Push init of plist into read_plist.
-rw-r--r--pkgtools/pkg_install/files/add/perform.c5
-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.c5
-rw-r--r--pkgtools/pkg_install/files/delete/perform.c8
-rw-r--r--pkgtools/pkg_install/files/lib/conflicts.c6
-rw-r--r--pkgtools/pkg_install/files/lib/plist.c7
7 files changed, 17 insertions, 24 deletions
diff --git a/pkgtools/pkg_install/files/add/perform.c b/pkgtools/pkg_install/files/add/perform.c
index 603b2ba122d..cdbca3cac03 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.70.4.17 2008/08/05 22:56:24 joerg Exp $ */
+/* $NetBSD: perform.c,v 1.70.4.18 2008/08/10 22:08:16 joerg Exp $ */
#if HAVE_CONFIG_H
#include "config.h"
#endif
@@ -6,7 +6,7 @@
#if HAVE_SYS_CDEFS_H
#include <sys/cdefs.h>
#endif
-__RCSID("$NetBSD: perform.c,v 1.70.4.17 2008/08/05 22:56:24 joerg Exp $");
+__RCSID("$NetBSD: perform.c,v 1.70.4.18 2008/08/10 22:08:16 joerg Exp $");
/*-
* Copyright (c) 2003 Grant Beattie <grant@NetBSD.org>
@@ -413,7 +413,6 @@ check_other_installed(struct pkg_task *pkg)
fclose(f);
return -1;
}
- plist.head = plist.tail = NULL;
read_plist(&plist, f_pkg);
fclose(f_pkg);
for (p = plist.head; p != NULL; p = p->next) {
diff --git a/pkgtools/pkg_install/files/admin/check.c b/pkgtools/pkg_install/files/admin/check.c
index d2b835f6c4e..38f55ba3aea 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.2.4.3 2008/08/02 20:33:50 joerg Exp $ */
+/* $NetBSD: check.c,v 1.2.4.4 2008/08/10 22:08:16 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.2.4.3 2008/08/02 20:33:50 joerg Exp $");
+__RCSID("$NetBSD: check.c,v 1.2.4.4 2008/08/10 22:08:16 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 19cb7bfc8d6..555e653df03 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.42.2.6 2008/08/02 20:33:50 joerg Exp $ */
+/* $NetBSD: main.c,v 1.42.2.7 2008/08/10 22:08:16 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.42.2.6 2008/08/02 20:33:50 joerg Exp $");
+__RCSID("$NetBSD: main.c,v 1.42.2.7 2008/08/10 22:08:16 joerg Exp $");
#endif
/*-
@@ -149,7 +149,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 6cdcbadbe47..c1664df0aaf 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.2 2008/08/02 20:33:50 joerg Exp $ */
+/* $NetBSD: perform.c,v 1.19.2.3 2008/08/10 22:08:16 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.2 2008/08/02 20:33:50 joerg Exp $");
+__RCSID("$NetBSD: perform.c,v 1.19.2.3 2008/08/10 22:08:16 joerg Exp $");
#endif
#endif
@@ -171,7 +171,6 @@ pkg_perform(const char *pkg)
if (!pkg_in)
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) {
diff --git a/pkgtools/pkg_install/files/delete/perform.c b/pkgtools/pkg_install/files/delete/perform.c
index 259b1fbe062..1caf4d64191 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.2.10 2008/08/05 22:56:24 joerg Exp $ */
+/* $NetBSD: perform.c,v 1.23.2.11 2008/08/10 22:08:16 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.2.10 2008/08/05 22:56:24 joerg Exp $");
+__RCSID("$NetBSD: perform.c,v 1.23.2.11 2008/08/10 22:08:16 joerg Exp $");
#endif
#endif
@@ -447,10 +447,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 */
best_installed = find_best_matching_installed_pkg(lpp->lp_name);
diff --git a/pkgtools/pkg_install/files/lib/conflicts.c b/pkgtools/pkg_install/files/lib/conflicts.c
index 57280098fa6..17e9491ca66 100644
--- a/pkgtools/pkg_install/files/lib/conflicts.c
+++ b/pkgtools/pkg_install/files/lib/conflicts.c
@@ -1,4 +1,4 @@
-/* $NetBSD: conflicts.c,v 1.4.6.3 2008/08/06 12:58:22 joerg Exp $ */
+/* $NetBSD: conflicts.c,v 1.4.6.4 2008/08/10 22:08:16 joerg Exp $ */
/*-
* Copyright (c) 2007 Roland Illig <rillig@NetBSD.org>.
@@ -48,7 +48,7 @@
#include <sys/cdefs.h>
#endif
-__RCSID("$NetBSD: conflicts.c,v 1.4.6.3 2008/08/06 12:58:22 joerg Exp $");
+__RCSID("$NetBSD: conflicts.c,v 1.4.6.4 2008/08/10 22:08:16 joerg Exp $");
#if HAVE_ERR_H
#include <err.h>
@@ -102,8 +102,6 @@ check_package_conflict(const char *pkgname, void *v)
return 0;
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/plist.c b/pkgtools/pkg_install/files/lib/plist.c
index 7fffbd78d3b..af53de9ed7a 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.7 2008/08/05 22:56:24 joerg Exp $ */
+/* $NetBSD: plist.c,v 1.17.4.8 2008/08/10 22:08:17 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.7 2008/08/05 22:56:24 joerg Exp $");
+__RCSID("$NetBSD: plist.c,v 1.17.4.8 2008/08/10 22:08:17 joerg Exp $");
#endif
#endif
@@ -358,6 +358,9 @@ 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]);) {