Subject: pkg_create -O bug fixes
To: None <tech-install@netbsd.org>
From: David Young <dyoung@pobox.com>
List: tech-install
Date: 06/29/2003 01:03:18
Seems to me that pkg_create -O (emit packing list only) should not have
the side-effect of writing to the package-files database. Correct?

Also, seems like pkg_create -O should refrain from interpreting the last
'.' in the pkg-name argument as the beginning of a filename extension,
e.g., etc-sysutil-rc-1.6U.0 yields '@name etc-sysutil-rc-1.6U.0', and
etc-sysutil-rc-1.6U yields '@name etc-sysutil-rc-1'.

If there are no objections, I will commit this patch:

Index: usr.sbin/pkg_install//create/perform.c
===================================================================
RCS file: /cvsroot/src/usr.sbin/pkg_install/create/perform.c,v
retrieving revision 1.36
diff -u -r1.36 perform.c
--- usr.sbin/pkg_install//create/perform.c      2003/04/11 19:57:06     1.36
+++ usr.sbin/pkg_install//create/perform.c      2003/06/29 06:01:41
@@ -242,7 +242,7 @@
        plist.head = plist.tail = NULL;
 
        /* Break the package name into base and desired suffix (if any) */
-       if ((cp = strrchr(pkg, '.')) != NULL) {
+       if (!PlistOnly && (cp = strrchr(pkg, '.')) != NULL) {
                suffix = cp + 1;
                *cp = '\0';
        } else
Index: usr.sbin/pkg_install//create/pl.c
===================================================================
RCS file: /cvsroot/src/usr.sbin/pkg_install/create/pl.c,v
retrieving revision 1.26
diff -u -r1.26 pl.c
--- usr.sbin/pkg_install//create/pl.c   2003/06/12 13:29:32     1.26
+++ usr.sbin/pkg_install//create/pl.c   2003/06/29 06:01:41
@@ -161,7 +161,7 @@
                                if (s && PlistOnly)
                                        warnx("Overwriting %s - "
                                            "pkg %s bogus/conflicting?", t, s);
-                               else {
+                               else if (!PlistOnly) {
                                        pkgdb_store(t, PkgName);
 #ifdef PKGDB_DEBUG
                                        fprintf(stderr, "pkgdb_store(\"%s\", \"%s\")\n", t, PkgName);   /* pkgdb-debug - HF */

Dave

-- 
David Young             OJC Technologies
dyoung@ojctech.com      Urbana, IL * (217) 278-3933