Source-Changes-HG archive

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

[src/netbsd-1-6]: src/usr.sbin/pkg_install/add Pull up revision 1.24 (request...



details:   https://anonhg.NetBSD.org/src/rev/9b930f0976a3
branches:  netbsd-1-6
changeset: 529529:9b930f0976a3
user:      tron <tron%NetBSD.org@localhost>
date:      Sun Nov 24 22:34:52 2002 +0000

description:
Pull up revision 1.24 (requested by jschauma in ticket #1011):
- eliminate the hard-coding of pathnames in the default install.
- all command executions now use the path [execvp/execlp/system].
- normalize the macro names as <COMMAND>_CMD.
- in some OS's full pathnames for commands can still be provided, but this
  is not the default.
This was needed to fix -DTAR_FULLPATHNAME="/usr/bin/tar"

diffstat:

 usr.sbin/pkg_install/add/extract.c |  14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diffs (55 lines):

diff -r 6a60bf8d0820 -r 9b930f0976a3 usr.sbin/pkg_install/add/extract.c
--- a/usr.sbin/pkg_install/add/extract.c        Sun Nov 24 22:34:45 2002 +0000
+++ b/usr.sbin/pkg_install/add/extract.c        Sun Nov 24 22:34:52 2002 +0000
@@ -1,11 +1,11 @@
-/*     $NetBSD: extract.c,v 1.23 2001/09/26 13:48:27 hubertf Exp $     */
+/*     $NetBSD: extract.c,v 1.23.2.1 2002/11/24 22:34:52 tron Exp $    */
 
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static const char *rcsid = "FreeBSD - Id: extract.c,v 1.17 1997/10/08 07:45:35 charnier Exp";
 #else
-__RCSID("$NetBSD: extract.c,v 1.23 2001/09/26 13:48:27 hubertf Exp $");
+__RCSID("$NetBSD: extract.c,v 1.23.2.1 2002/11/24 22:34:52 tron Exp $");
 #endif
 #endif
 
@@ -34,7 +34,7 @@
 #include "add.h"
 
 #define TAR_ARGS       " cf - "
-#define TARX_CMD       "|" TAR_FULLPATHNAME " xf - -C "
+#define TARX_CMD       "|" TAR_CMD " xf - -C "
 
 /* 
  * This macro is used to determine if the 'where_args'  buffer is big enough to add the
@@ -50,16 +50,16 @@
                || (strlen(str) + 3 + perm_count >= maxargs))
 
 #define PUSHOUT(todir) /* push out string */                           \
-        if (where_count > sizeof(TAR_FULLPATHNAME) + sizeof(TAR_ARGS)-1) {     \
+        if (where_count > sizeof(TAR_CMD) + sizeof(TAR_ARGS)-1) {              \
                    strcat(where_args, TARX_CMD);                       \
                    strcat(where_args, todir);                          \
                    if (system(where_args)) {                           \
                        cleanup(0);                                     \
                        errx(2, "can not invoke %lu byte %s pipeline: %s", \
-                               (u_long)strlen(where_args), TAR_FULLPATHNAME,   \
+                               (u_long)strlen(where_args), TAR_CMD,    \
                                where_args);                            \
                    }                                                   \
-                   strcpy(where_args, TAR_FULLPATHNAME TAR_ARGS);      \
+                   strcpy(where_args, TAR_CMD TAR_ARGS);                       \
                    where_count = strlen(where_args);                   \
        }                                                               \
        if (perm_count) {                                               \
@@ -118,7 +118,7 @@
                cleanup(0);
                errx(2, "can't get argument list space");
        }
-       strcpy(where_args, TAR_FULLPATHNAME TAR_ARGS);
+       strcpy(where_args, TAR_CMD TAR_ARGS);
        /*
         * we keep track of how many characters are stored in 'where_args' with 'where_count'.
         * Note this doesn't include the trailing null character.



Home | Main Index | Thread Index | Old Index