Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/pkg_install/create * Bugfix: if PLIST_SRC directly ...



details:   https://anonhg.NetBSD.org/src/rev/44ea854a50ca
branches:  trunk
changeset: 512717:44ea854a50ca
user:      hubertf <hubertf%NetBSD.org@localhost>
date:      Sun Jul 15 00:23:14 2001 +0000

description:
* Bugfix: if PLIST_SRC directly follows PLIST_CWD, ignore
   the PLIST_CWD in creating the tar pipe.

   This takes care of pkg_create -p PREFIX -L FAKE
   where PREFIX does not exist at pkg creation time.

   From OpenBSD's rev. 1.9->1.10

 * Register PLIST_SRC before dependencies and conflicts so that the
   PLIST_CWD != PLIST_SRC hack works with dependencies present.

   From OpenBSD's rev. 1.10->1.11

 * improve error message to tell full path of exec() that failed

diffstat:

 usr.sbin/pkg_install/create/perform.c |  34 +++++++++++++++++++++-------------
 1 files changed, 21 insertions(+), 13 deletions(-)

diffs (78 lines):

diff -r 74fdb2adba86 -r 44ea854a50ca usr.sbin/pkg_install/create/perform.c
--- a/usr.sbin/pkg_install/create/perform.c     Sat Jul 14 21:56:45 2001 +0000
+++ b/usr.sbin/pkg_install/create/perform.c     Sun Jul 15 00:23:14 2001 +0000
@@ -1,11 +1,11 @@
-/*     $NetBSD: perform.c,v 1.27 2001/05/21 12:03:53 agc Exp $ */
+/*     $NetBSD: perform.c,v 1.28 2001/07/15 00:23:14 hubertf Exp $     */
 
 #include <sys/cdefs.h>
 #ifndef lint
 #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.27 2001/05/21 12:03:53 agc Exp $");
+__RCSID("$NetBSD: perform.c,v 1.28 2001/07/15 00:23:14 hubertf Exp $");
 #endif
 #endif
 
@@ -86,7 +86,7 @@
        }
        if ((pid = fork()) == -1) {
                cleanup(0);
-               errx(2, "cannot fork process for %s", TAR_CMD);
+               errx(2, "cannot fork process for %s", TAR_FULLPATHNAME);
        }
        if (pid == 0) {         /* The child */
                dup2(pipefds[0], 0);
@@ -137,12 +137,20 @@
        }
 
        for (p = plist->head; p; p = p->next) {
-               if (p->type == PLIST_FILE)
+               if (p->type == PLIST_FILE) {
                        fprintf(totar, "%s\n", p->name);
-               else if (p->type == PLIST_CWD || p->type == PLIST_SRC)
+               } else if (p->type == PLIST_CWD || p->type == PLIST_SRC) {
+                       
+                       /* XXX let PLIST_SRC override PLIST_CWD */
+                       if (p->type == PLIST_CWD && p->next != NULL &&
+                           p->next->type == PLIST_SRC) {
+                               continue;
+                       }
+
                        fprintf(totar, "-C\n%s\n", p->name);
-               else if (p->type == PLIST_IGNORE)
+               } else if (p->type == PLIST_IGNORE) {
                        p = p->next;
+               }
        }
 
        fclose(totar);
@@ -233,6 +241,13 @@
        } else
                suffix = "tgz";
 
+       /* If a SrcDir override is set, add it now */
+       if (SrcDir) {
+               if (Verbose && !PlistOnly)
+                       printf("Using SrcDir value of %s\n", (realprefix) ? realprefix : SrcDir);
+               add_plist(&plist, PLIST_SRC, SrcDir);
+       }
+
        /* Stick the dependencies, if any, at the top */
        if (Pkgdeps) {
                if (Verbose && !PlistOnly)
@@ -265,13 +280,6 @@
                        printf(".\n");
        }
 
-       /* If a SrcDir override is set, add it now */
-       if (SrcDir) {
-               if (Verbose && !PlistOnly)
-                       printf("Using SrcDir value of %s\n", (realprefix) ? realprefix : SrcDir);
-               add_plist(&plist, PLIST_SRC, SrcDir);
-       }
-
        /* Slurp in the packing list */
        read_plist(&plist, pkg_in);
 



Home | Main Index | Thread Index | Old Index