pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/pkg_install/files Specify the full path to ta...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/ebb9abc51ea2
branches:  trunk
changeset: 504157:ebb9abc51ea2
user:      ben <ben%pkgsrc.org@localhost>
date:      Tue Dec 06 01:08:09 2005 +0000

description:
Specify the full path to tar when unpacking a package.
Modify pfcexec so the new process file name can be different from argv[0].
This fix is from Peter Postma, and it addresses PR#32228

diffstat:

 pkgtools/pkg_install/files/add/futil.c |  12 ++++++------
 pkgtools/pkg_install/files/lib/fexec.c |   8 ++++----
 pkgtools/pkg_install/files/lib/file.c  |   6 +++---
 pkgtools/pkg_install/files/lib/lib.h   |   4 ++--
 4 files changed, 15 insertions(+), 15 deletions(-)

diffs (138 lines):

diff -r 27386327fc5d -r ebb9abc51ea2 pkgtools/pkg_install/files/add/futil.c
--- a/pkgtools/pkg_install/files/add/futil.c    Tue Dec 06 01:07:20 2005 +0000
+++ b/pkgtools/pkg_install/files/add/futil.c    Tue Dec 06 01:08:09 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: futil.c,v 1.8 2005/11/23 14:33:50 ben Exp $    */
+/*     $NetBSD: futil.c,v 1.9 2005/12/06 01:08:09 ben Exp $    */
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -11,7 +11,7 @@
 #if 0
 static const char *rcsid = "from FreeBSD Id: futil.c,v 1.7 1997/10/08 07:45:39 charnier Exp";
 #else
-__RCSID("$NetBSD: futil.c,v 1.8 2005/11/23 14:33:50 ben Exp $");
+__RCSID("$NetBSD: futil.c,v 1.9 2005/12/06 01:08:09 ben Exp $");
 #endif
 #endif
 
@@ -107,7 +107,7 @@
                argv[0] = CHMOD_CMD;
                argv[1] = "-R";
                argv[2] = Mode;
-               if (pfcexec(cd_to, argv))
+               if (pfcexec(cd_to, argv[0], argv))
                        warnx("couldn't change modes of '%s' ... to '%s'",
                            args[0], Mode);
        }
@@ -122,7 +122,7 @@
                argv[0] = CHOWN_CMD;
                argv[1] = "-R";
                argv[2] = owner_group;
-               if (pfcexec(cd_to, argv))
+               if (pfcexec(cd_to, argv[0], argv))
                        warnx("couldn't change owner/group of '%s' ... to '%s:%s'",
                                args[0], Owner, Group);
                free(argv);
@@ -132,7 +132,7 @@
                argv[0] = CHOWN_CMD;
                argv[1] = "-R";
                argv[2] = Owner;
-               if (pfcexec(cd_to, argv))
+               if (pfcexec(cd_to, argv[0], argv))
                        warnx("couldn't change owner of '%s' ... to '%s'",
                                args[0], Owner);
                free(argv);
@@ -143,7 +143,7 @@
                argv[0] = CHGRP_CMD;
                argv[1] = "-R";
                argv[2] = Group;
-               if (pfcexec(cd_to, argv))
+               if (pfcexec(cd_to, argv[0], argv))
                        warnx("couldn't change group of '%s' ... to '%s'",
                                args[0], Group);
        }
diff -r 27386327fc5d -r ebb9abc51ea2 pkgtools/pkg_install/files/lib/fexec.c
--- a/pkgtools/pkg_install/files/lib/fexec.c    Tue Dec 06 01:07:20 2005 +0000
+++ b/pkgtools/pkg_install/files/lib/fexec.c    Tue Dec 06 01:08:09 2005 +0000
@@ -65,7 +65,7 @@
 #include "lib.h"
 
 #ifndef lint
-__RCSID("$NetBSD: fexec.c,v 1.7 2005/11/23 04:49:51 ben Exp $");
+__RCSID("$NetBSD: fexec.c,v 1.8 2005/12/06 01:08:09 ben Exp $");
 #endif
 
 static int     vfcexec(const char *, int, const char *, va_list);
@@ -76,7 +76,7 @@
  * wait for the command to finish, then return the exit status.
  */
 int
-pfcexec(const char *path, const char **argv)
+pfcexec(const char *path, const char *file, const char **argv)
 {
        pid_t                   child;
        int                     status;
@@ -87,7 +87,7 @@
                if ((path != NULL) && (chdir(path) < 0))
                        _exit(127);
 
-               (void) execvp(argv[0], (char ** const)argv);
+               (void)execvp(file, (char ** const)argv);
                _exit(127);
                /* NOTREACHED */
        case -1:
@@ -146,7 +146,7 @@
                argv[argc++] = arg;
        } while (arg != NULL);
 
-       return pfcexec(path, argv);
+       return pfcexec(path, argv[0], argv);
 }
 
 int
diff -r 27386327fc5d -r ebb9abc51ea2 pkgtools/pkg_install/files/lib/file.c
--- a/pkgtools/pkg_install/files/lib/file.c     Tue Dec 06 01:07:20 2005 +0000
+++ b/pkgtools/pkg_install/files/lib/file.c     Tue Dec 06 01:08:09 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: file.c,v 1.16 2005/11/23 04:49:51 ben Exp $    */
+/*     $NetBSD: file.c,v 1.17 2005/12/06 01:08:09 ben Exp $    */
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -17,7 +17,7 @@
 #if 0
 static const char *rcsid = "from FreeBSD Id: file.c,v 1.29 1997/10/08 07:47:54 charnier Exp";
 #else
-__RCSID("$NetBSD: file.c,v 1.16 2005/11/23 04:49:51 ben Exp $");
+__RCSID("$NetBSD: file.c,v 1.17 2005/12/06 01:08:09 ben Exp $");
 #endif
 #endif
 
@@ -676,7 +676,7 @@
                printf("\n");
        }
 
-       result = pfcexec(NULL, (const char **)up_argv);
+       result = pfcexec(NULL, TAR_CMD, (const char **)up_argv);
        free(up_argv);
        if (result != 0) {
                warnx("extract of %s failed", pkg);
diff -r 27386327fc5d -r ebb9abc51ea2 pkgtools/pkg_install/files/lib/lib.h
--- a/pkgtools/pkg_install/files/lib/lib.h      Tue Dec 06 01:07:20 2005 +0000
+++ b/pkgtools/pkg_install/files/lib/lib.h      Tue Dec 06 01:08:09 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lib.h,v 1.20 2005/11/28 01:50:21 ben Exp $ */
+/* $NetBSD: lib.h,v 1.21 2005/12/06 01:08:09 ben Exp $ */
 
 /* from FreeBSD Id: lib.h,v 1.25 1997/10/08 07:48:03 charnier Exp */
 
@@ -313,7 +313,7 @@
 int    fexec(const char *, ...);
 int    fexec_skipempty(const char *, ...);
 int    fcexec(const char *, const char *, ...);
-int    pfcexec(const char *path, const char **argv);
+int    pfcexec(const char *, const char *, const char **);
 pipe_to_system_t       *pipe_to_system_begin(const char *, char *const *, void (*)(void));
 int    pipe_to_system_end(pipe_to_system_t *);
 



Home | Main Index | Thread Index | Old Index