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 Update the package tools to versio...
details: https://anonhg.NetBSD.org/src/rev/71492cf86646
branches: netbsd-1-6
changeset: 530732:71492cf86646
user: tron <tron%NetBSD.org@localhost>
date: Sun Sep 21 10:32:42 2003 +0000
description:
Update the package tools to version 20030918 (requested by jlam
in ticket 1457).
diffstat:
usr.sbin/pkg_install/Makefile | 4 +-
usr.sbin/pkg_install/README | 6 +-
usr.sbin/pkg_install/add/add.h | 5 +-
usr.sbin/pkg_install/add/extract.c | 12 +-
usr.sbin/pkg_install/add/futil.c | 32 +-
usr.sbin/pkg_install/add/main.c | 86 ++++--
usr.sbin/pkg_install/add/perform.c | 301 +++++++++++++++++-----
usr.sbin/pkg_install/add/pkg_add.1 | 102 ++++++-
usr.sbin/pkg_install/admin/main.c | 399 ++++++++++++++++++------------
usr.sbin/pkg_install/admin/pkg_admin.1 | 113 +++++++-
usr.sbin/pkg_install/create/create.h | 3 +-
usr.sbin/pkg_install/create/main.c | 20 +-
usr.sbin/pkg_install/create/perform.c | 15 +-
usr.sbin/pkg_install/create/pkg_create.1 | 138 ++++++----
usr.sbin/pkg_install/create/pl.c | 17 +-
usr.sbin/pkg_install/delete/main.c | 71 +++--
usr.sbin/pkg_install/delete/perform.c | 278 +++++++++++++++++---
usr.sbin/pkg_install/delete/pkg_delete.1 | 31 ++-
usr.sbin/pkg_install/info/info.h | 4 +-
usr.sbin/pkg_install/info/main.c | 33 ++-
usr.sbin/pkg_install/info/perform.c | 60 ++--
usr.sbin/pkg_install/info/pkg_info.1 | 30 +-
usr.sbin/pkg_install/info/show.c | 45 +++-
usr.sbin/pkg_install/lib/Makefile | 4 +-
usr.sbin/pkg_install/lib/fexec.c | 141 ++++++++++
usr.sbin/pkg_install/lib/file.c | 38 +-
usr.sbin/pkg_install/lib/ftpio.c | 33 +-
usr.sbin/pkg_install/lib/lib.h | 56 ++--
usr.sbin/pkg_install/lib/pen.c | 49 +--
usr.sbin/pkg_install/lib/pkgdb.c | 109 +++++---
usr.sbin/pkg_install/lib/plist.c | 12 +-
usr.sbin/pkg_install/lib/str.c | 6 +-
usr.sbin/pkg_install/lib/version.h | 4 +-
usr.sbin/pkg_install/view/linkfarm.1 | 147 +++++++++++
usr.sbin/pkg_install/view/linkfarm.sh | 221 +++++++++++++++++
usr.sbin/pkg_install/view/pkg_view.1 | 271 +++++++++++++++++++++
usr.sbin/pkg_install/view/pkg_view.sh | 271 +++++++++++++++++++++
37 files changed, 2487 insertions(+), 680 deletions(-)
diffs (truncated from 5206 to 300 lines):
diff -r a9bdb6742eb0 -r 71492cf86646 usr.sbin/pkg_install/Makefile
--- a/usr.sbin/pkg_install/Makefile Sat Sep 20 15:20:09 2003 +0000
+++ b/usr.sbin/pkg_install/Makefile Sun Sep 21 10:32:42 2003 +0000
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.5 2001/01/09 03:13:43 lukem Exp $
+# $NetBSD: Makefile,v 1.5.2.1 2003/09/21 10:32:42 tron Exp $
# Original from FreeBSD, no rcs id.
-SUBDIR=lib .WAIT add admin create delete info
+SUBDIR=lib .WAIT add admin create delete info view
.include <bsd.subdir.mk>
diff -r a9bdb6742eb0 -r 71492cf86646 usr.sbin/pkg_install/README
--- a/usr.sbin/pkg_install/README Sat Sep 20 15:20:09 2003 +0000
+++ b/usr.sbin/pkg_install/README Sun Sep 21 10:32:42 2003 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: README,v 1.6 2002/02/21 14:21:49 agc Exp $
+# $NetBSD: README,v 1.6.2.1 2003/09/21 10:32:42 tron Exp $
# Original from FreeBSD, no rcs id.
This is the pkg_install suite of tools for doing maintainance of
@@ -11,8 +11,8 @@
of dozen features on top. Whee! :-)
In another round of enhancements, NetBSD changes were added by
-Alistair Crooks and Hubert Feyrer, Thorsten Frueauf and Christian E.
-Hopps.
+Alistair Crooks, Hubert Feyrer, Thorsten Frueauf, Christian E. Hopps,
+Johnny Lam and Matthias Scheler.
When making snapshots, please modify PKGTOOLS_VERSION in lib/version.h
to that day's date.
diff -r a9bdb6742eb0 -r 71492cf86646 usr.sbin/pkg_install/add/add.h
--- a/usr.sbin/pkg_install/add/add.h Sat Sep 20 15:20:09 2003 +0000
+++ b/usr.sbin/pkg_install/add/add.h Sun Sep 21 10:32:42 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: add.h,v 1.5 2000/06/17 11:30:49 tron Exp $ */
+/* $NetBSD: add.h,v 1.5.4.1 2003/09/21 10:32:42 tron Exp $ */
/* from FreeBSD Id: add.h,v 1.8 1997/02/22 16:09:15 peter Exp */
@@ -30,6 +30,9 @@
} add_mode_t;
extern char *Prefix;
+extern char *View;
+extern char *Viewbase;
+extern Boolean NoView;
extern Boolean NoInstall;
extern Boolean NoRecord;
extern Boolean Force;
diff -r a9bdb6742eb0 -r 71492cf86646 usr.sbin/pkg_install/add/extract.c
--- a/usr.sbin/pkg_install/add/extract.c Sat Sep 20 15:20:09 2003 +0000
+++ b/usr.sbin/pkg_install/add/extract.c Sun Sep 21 10:32:42 2003 +0000
@@ -1,11 +1,11 @@
-/* $NetBSD: extract.c,v 1.23.2.3 2003/02/08 07:46:17 jmc Exp $ */
+/* $NetBSD: extract.c,v 1.23.2.4 2003/09/21 10:32:42 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.2.3 2003/02/08 07:46:17 jmc Exp $");
+__RCSID("$NetBSD: extract.c,v 1.23.2.4 2003/09/21 10:32:42 tron Exp $");
#endif
#endif
@@ -51,15 +51,15 @@
#define PUSHOUT(todir) /* push out string */ \
if (where_count > sizeof(TAR_CMD) + sizeof(TAR_ARGS)-1) { \
- strcat(where_args, TARX_CMD); \
- strcat(where_args, todir); \
+ strlcat(where_args, TARX_CMD, maxargs); \
+ strlcat(where_args, todir, maxargs); \
if (system(where_args)) { \
cleanup(0); \
errx(2, "can not invoke %lu byte %s pipeline: %s", \
(u_long)strlen(where_args), TAR_CMD, \
where_args); \
} \
- strcpy(where_args, TAR_CMD TAR_ARGS); \
+ strlcpy(where_args, TAR_CMD TAR_ARGS, maxargs); \
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_CMD TAR_ARGS);
+ strlcpy(where_args, TAR_CMD TAR_ARGS, maxargs);
/*
* we keep track of how many characters are stored in 'where_args' with 'where_count'.
* Note this doesn't include the trailing null character.
diff -r a9bdb6742eb0 -r 71492cf86646 usr.sbin/pkg_install/add/futil.c
--- a/usr.sbin/pkg_install/add/futil.c Sat Sep 20 15:20:09 2003 +0000
+++ b/usr.sbin/pkg_install/add/futil.c Sun Sep 21 10:32:42 2003 +0000
@@ -1,11 +1,11 @@
-/* $NetBSD: futil.c,v 1.8.10.1 2002/11/24 22:34:03 tron Exp $ */
+/* $NetBSD: futil.c,v 1.8.10.2 2003/09/21 10:32:43 tron Exp $ */
#include <sys/cdefs.h>
#ifndef lint
#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.10.1 2002/11/24 22:34:03 tron Exp $");
+__RCSID("$NetBSD: futil.c,v 1.8.10.2 2003/09/21 10:32:43 tron Exp $");
#endif
#endif
@@ -53,7 +53,7 @@
if (!(isdir(dir) || islinktodir(dir)))
return FAIL;
} else {
- if (vsystem("mkdir %s", dir))
+ if (fexec("mkdir", dir, NULL))
return FAIL;
apply_perms(NULL, dir);
}
@@ -80,19 +80,25 @@
cd_to = dir;
if (Mode)
- if (vsystem("cd %s && %s -R %s %s", cd_to, CHMOD_CMD, Mode, arg))
- warnx("couldn't change modes of '%s' to '%s'", arg, Mode);
- if (Owner && Group) {
- if (vsystem("cd %s && %s -R %s.%s %s", cd_to, CHOWN_CMD, Owner, Group, arg))
+ if (fcexec(cd_to, CHMOD_CMD, "-R", Mode, arg, NULL))
+ warnx("couldn't change modes of '%s' to '%s'", arg,
+ Mode);
+ if (Owner != NULL && Group != NULL) {
+ if (vsystem("cd %s && %s -R %s.%s %s", cd_to, CHOWN_CMD, Owner,
+ Group, arg))
warnx("couldn't change owner/group of '%s' to '%s.%s'",
arg, Owner, Group);
return;
}
- if (Owner) {
- if (vsystem("cd %s && %s -R %s %s", cd_to, CHOWN_CMD, Owner, arg))
- warnx("couldn't change owner of '%s' to '%s'", arg, Owner);
+ if (Owner != NULL) {
+ if (fcexec(cd_to, CHOWN_CMD, "-R", Owner, arg, NULL))
+ warnx("couldn't change owner of '%s' to '%s'", arg,
+ Owner);
return;
- } else if (Group)
- if (vsystem("cd %s && %s -R %s %s", cd_to, CHGRP_CMD, Group, arg))
- warnx("couldn't change group of '%s' to '%s'", arg, Group);
+ }
+ if (Group != NULL) {
+ if (fcexec(cd_to, CHGRP_CMD, "-R", Group, arg, NULL))
+ warnx("couldn't change group of '%s' to '%s'", arg,
+ Group);
+ }
}
diff -r a9bdb6742eb0 -r 71492cf86646 usr.sbin/pkg_install/add/main.c
--- a/usr.sbin/pkg_install/add/main.c Sat Sep 20 15:20:09 2003 +0000
+++ b/usr.sbin/pkg_install/add/main.c Sun Sep 21 10:32:42 2003 +0000
@@ -1,11 +1,11 @@
-/* $NetBSD: main.c,v 1.23.2.4 2003/02/08 07:46:31 jmc Exp $ */
+/* $NetBSD: main.c,v 1.23.2.5 2003/09/21 10:32:43 tron Exp $ */
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char *rcsid = "from FreeBSD Id: main.c,v 1.16 1997/10/08 07:45:43 charnier Exp";
#else
-__RCSID("$NetBSD: main.c,v 1.23.2.4 2003/02/08 07:46:31 jmc Exp $");
+__RCSID("$NetBSD: main.c,v 1.23.2.5 2003/09/21 10:32:43 tron Exp $");
#endif
#endif
@@ -37,9 +37,12 @@
#include "add.h"
#include "verify.h"
-static char Options[] = "IMRSVfhnp:s:t:uv";
+static char Options[] = "IK:LMRSVW:fhnp:s:t:uvw:";
char *Prefix = NULL;
+char *View = NULL;
+char *Viewbase = NULL;
+Boolean NoView = FALSE;
Boolean NoInstall = FALSE;
Boolean NoRecord = FALSE;
@@ -50,14 +53,15 @@
char *Directory = NULL;
char FirstPen[FILENAME_MAX];
add_mode_t AddMode = NORMAL;
-int upgrade = 0;
+Boolean Replace = FALSE;
static void
usage(void)
{
- (void) fprintf(stderr, "%s\n%s\n",
- "usage: pkg_add [-hVvInfRMSu] [-t template] [-p prefix]",
- " [-s verification-type] pkg-name [pkg-name ...]");
+ (void) fprintf(stderr, "%s\n%s\n%s\n",
+ "usage: pkg_add [-fhILMnRSuVv] [-p prefix] [-s verification-type]",
+ " [-t template] [-W viewbase] [-w view]",
+ " pkg-name [pkg-name ...]");
exit(1);
}
@@ -69,9 +73,35 @@
struct rlimit rlim;
int rc;
+ setprogname(argv[0]);
while ((ch = getopt(argc, argv, Options)) != -1) {
switch (ch) {
- case 'v':
+ case 'f':
+ Force = TRUE;
+ break;
+
+ case 'I':
+ NoInstall = TRUE;
+ break;
+
+ case 'K':
+ _pkgdb_setPKGDB_DIR(optarg);
+ break;
+
+ case 'L':
+ NoView = TRUE;
+ break;
+
+ case 'M':
+ AddMode = MASTER;
+ break;
+
+ case 'R':
+ NoRecord = TRUE;
+ break;
+
+ case 'n':
+ Fake = TRUE;
Verbose = TRUE;
break;
@@ -79,21 +109,8 @@
Prefix = optarg;
break;
- case 'I':
- NoInstall = TRUE;
- break;
-
- case 'R':
- NoRecord = TRUE;
- break;
-
- case 'f':
- Force = TRUE;
- break;
-
- case 'n':
- Fake = TRUE;
- Verbose = TRUE;
+ case 'S':
+ AddMode = SLAVE;
break;
case 's':
@@ -101,24 +118,29 @@
break;
case 't':
- strcpy(FirstPen, optarg);
+ strlcpy(FirstPen, optarg, sizeof(FirstPen));
break;
- case 'S':
- AddMode = SLAVE;
- break;
-
- case 'M':
- AddMode = MASTER;
+ case 'u':
+ Replace = 1;
break;
case 'V':
show_version();
/* NOTREACHED */
- case 'u':
- upgrade = 1;
+ case 'v':
+ Verbose = TRUE;
break;
+
+ case 'W':
+ Viewbase = optarg;
Home |
Main Index |
Thread Index |
Old Index