summaryrefslogtreecommitdiff
path: root/pkgtools/pkg_install
diff options
context:
space:
mode:
authorben <ben@pkgsrc.org>2005-11-23 04:49:51 +0000
committerben <ben@pkgsrc.org>2005-11-23 04:49:51 +0000
commitf1c76720818742646aa6086511d57c2002b876bf (patch)
treef02999ba8540c15c45d2e3159b38d3d6b764211b /pkgtools/pkg_install
parent7ee7c2292f666774cdb94d5f7a268d7cd24f5034 (diff)
downloadpkgsrc-f1c76720818742646aa6086511d57c2002b876bf.tar.gz
Remove unused variables, fix variable names to avoid shadowing globals,
and add PAX_CMD fallback macro.
Diffstat (limited to 'pkgtools/pkg_install')
-rw-r--r--pkgtools/pkg_install/files/lib/fexec.c4
-rw-r--r--pkgtools/pkg_install/files/lib/file.c33
-rw-r--r--pkgtools/pkg_install/files/lib/lib.h7
3 files changed, 23 insertions, 21 deletions
diff --git a/pkgtools/pkg_install/files/lib/fexec.c b/pkgtools/pkg_install/files/lib/fexec.c
index 2a29b63cc9b..0d0f18990de 100644
--- a/pkgtools/pkg_install/files/lib/fexec.c
+++ b/pkgtools/pkg_install/files/lib/fexec.c
@@ -65,7 +65,7 @@
#include "lib.h"
#ifndef lint
-__RCSID("$NetBSD: fexec.c,v 1.6 2005/11/22 15:44:59 ben Exp $");
+__RCSID("$NetBSD: fexec.c,v 1.7 2005/11/23 04:49:51 ben Exp $");
#endif
static int vfcexec(const char *, int, const char *, va_list);
@@ -111,8 +111,6 @@ vfcexec(const char *path, int skipempty, const char *arg, va_list ap)
static unsigned int max = 4;
static const char **argv = NULL;
unsigned int argc;
- pid_t child;
- int status;
if (argv == NULL) {
argv = malloc(max * sizeof(const char *));
diff --git a/pkgtools/pkg_install/files/lib/file.c b/pkgtools/pkg_install/files/lib/file.c
index 746cdffec1b..19233be269a 100644
--- a/pkgtools/pkg_install/files/lib/file.c
+++ b/pkgtools/pkg_install/files/lib/file.c
@@ -1,4 +1,4 @@
-/* $NetBSD: file.c,v 1.15 2005/11/22 15:44:59 ben Exp $ */
+/* $NetBSD: file.c,v 1.16 2005/11/23 04:49:51 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.15 2005/11/22 15:44:59 ben Exp $");
+__RCSID("$NetBSD: file.c,v 1.16 2005/11/23 04:49:51 ben Exp $");
#endif
#endif
@@ -624,14 +624,13 @@ remove_files(const char *path, const char *pattern)
int
unpack(const char *pkg, const lfile_head_t *filesp)
{
- char cmd[MaxPathSize];
const char *decompress_cmd = NULL;
const char *suf;
int count = 0;
lfile_t *lfp;
char **up_argv;
int up_argc = 7;
- int index = 0;
+ int i = 0;
int result;
if (filesp != NULL)
@@ -652,28 +651,28 @@ unpack(const char *pkg, const lfile_head_t *filesp)
} else
decompress_cmd = GZIP_CMD;
- up_argv[index] = strrchr(TAR_CMD, '/');
- if (up_argv[index] == NULL)
- up_argv[index] = TAR_CMD;
+ up_argv[i] = strrchr(TAR_CMD, '/');
+ if (up_argv[i] == NULL)
+ up_argv[i] = TAR_CMD;
else
- up_argv[index]++; /* skip / character */
+ up_argv[i]++; /* skip / character */
if (count > 0)
- up_argv[++index] = "--fast-read";
+ up_argv[++i] = "--fast-read";
if (decompress_cmd != NULL) {
- up_argv[++index] = "--use-compress-program";
- up_argv[++index] = (char *)decompress_cmd;
+ up_argv[++i] = "--use-compress-program";
+ up_argv[++i] = (char *)decompress_cmd;
}
- up_argv[++index] = "-xpf";
- up_argv[++index] = (char *)pkg;
+ up_argv[++i] = "-xpf";
+ up_argv[++i] = (char *)pkg;
if (count > 0)
TAILQ_FOREACH(lfp, filesp, lf_link)
- up_argv[++index] = lfp->lf_name;
- up_argv[++index] = NULL;
+ up_argv[++i] = lfp->lf_name;
+ up_argv[++i] = NULL;
if (Verbose) {
printf("running: %s", TAR_CMD);
- for (index = 1; up_argv[index] != NULL; index++)
- printf(" %s", up_argv[index]);
+ for (i = 1; up_argv[i] != NULL; i++)
+ printf(" %s", up_argv[i]);
printf("\n");
}
diff --git a/pkgtools/pkg_install/files/lib/lib.h b/pkgtools/pkg_install/files/lib/lib.h
index a0a397130cc..c552df1601f 100644
--- a/pkgtools/pkg_install/files/lib/lib.h
+++ b/pkgtools/pkg_install/files/lib/lib.h
@@ -1,4 +1,4 @@
-/* $NetBSD: lib.h,v 1.18 2005/11/22 15:44:59 ben Exp $ */
+/* $NetBSD: lib.h,v 1.19 2005/11/23 04:49:51 ben Exp $ */
/* from FreeBSD Id: lib.h,v 1.25 1997/10/08 07:48:03 charnier Exp */
@@ -97,6 +97,11 @@
#define TAR_CMD "tar"
#endif
+/* Define pax as a string, used to copy files from staging area */
+#ifndef PAX_CMD
+#define PAX_CMD "tar"
+#endif
+
/* Define gzip and bzip2, used to unpack binary packages */
#ifndef GZIP_CMD
#define GZIP_CMD "gzip"