Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/usr.sbin/pkg_install/create Pull up revisions 1.20-1.21...



details:   https://anonhg.NetBSD.org/src/rev/617460ff5c16
branches:  netbsd-1-5
changeset: 492835:617460ff5c16
user:      he <he%NetBSD.org@localhost>
date:      Sat Feb 23 18:06:45 2002 +0000

description:
Pull up revisions 1.20-1.21 (requested by seb):
  Synchronize with recent developments:
   o Add ``-U'' and ``-I'' options
   o Various internal cleanups, bugfixes, and API tweaks

diffstat:

 usr.sbin/pkg_install/create/pl.c |  15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diffs (56 lines):

diff -r 4198d806be4e -r 617460ff5c16 usr.sbin/pkg_install/create/pl.c
--- a/usr.sbin/pkg_install/create/pl.c  Sat Feb 23 18:05:44 2002 +0000
+++ b/usr.sbin/pkg_install/create/pl.c  Sat Feb 23 18:06:45 2002 +0000
@@ -1,11 +1,11 @@
-/*     $NetBSD: pl.c,v 1.18.4.2 2002/02/23 16:41:28 he Exp $   */
+/*     $NetBSD: pl.c,v 1.18.4.3 2002/02/23 18:06:45 he Exp $   */
 
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static const char *rcsid = "from FreeBSD Id: pl.c,v 1.11 1997/10/08 07:46:35 charnier Exp";
 #else
-__RCSID("$NetBSD: pl.c,v 1.18.4.2 2002/02/23 16:41:28 he Exp $");
+__RCSID("$NetBSD: pl.c,v 1.18.4.3 2002/02/23 18:06:45 he Exp $");
 #endif
 #endif
 
@@ -120,7 +120,7 @@
        int     dirc;
 
        /* Open Package Database for writing */
-       if (pkgdb_open(0) == -1) {
+       if (update_pkgdb && pkgdb_open(0) == -1) {
                cleanup(0);
                err(1, "can't open pkgdb");
        }
@@ -146,7 +146,7 @@
                         * but as they are present before pkg_create
                         * starts, it's ok to do this somewhere here
                         */
-                       {
+                       if (update_pkgdb) {
                                char   *s, t[FILENAME_MAX];
 
                                (void) snprintf(t, sizeof(t), "%s/%s", cwd, p->name);
@@ -202,6 +202,9 @@
                                        tmp->type = PLIST_COMMENT;      /* PLIST_MD5 - HF */
                                        tmp->next = p->next;
                                        tmp->prev = p;
+                                       if (p == pkg->tail) {
+                                               pkg->tail = tmp;
+                                       }
                                        p->next = tmp;
                                        p = tmp;
                                }
@@ -213,7 +216,9 @@
                }
        }
 
-       pkgdb_close();
+       if (update_pkgdb) {
+               pkgdb_close();
+       }
 
        if (ReorderDirs && dirc > 0) {
                reorder(pkg, dirc);



Home | Main Index | Thread Index | Old Index