From 2d6e839b6779d9b9fcd6ac8d4543ddd4e3df753d Mon Sep 17 00:00:00 2001 From: joerg Date: Sun, 10 Aug 2008 22:08:16 +0000 Subject: Push init of plist into read_plist. --- pkgtools/pkg_install/files/add/perform.c | 5 ++--- pkgtools/pkg_install/files/admin/check.c | 5 ++--- pkgtools/pkg_install/files/admin/main.c | 5 ++--- pkgtools/pkg_install/files/create/perform.c | 5 ++--- pkgtools/pkg_install/files/delete/perform.c | 8 ++------ pkgtools/pkg_install/files/lib/conflicts.c | 6 ++---- pkgtools/pkg_install/files/lib/plist.c | 7 +++++-- 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 #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 @@ -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 #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 #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 . @@ -48,7 +48,7 @@ #include #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 @@ -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]);) { -- cgit v1.2.3