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 Merge src/usr.sbin/pkg_install on the p...



details:   https://anonhg.NetBSD.org/src/rev/4cbf52fc436f
branches:  trunk
changeset: 551231:4cbf52fc436f
user:      jlam <jlam%NetBSD.org@localhost>
date:      Tue Sep 02 07:34:47 2003 +0000

description:
Merge src/usr.sbin/pkg_install on the pkgviews branch into the HEAD by
running:

        cd src/usr.sbin/pkg_install
        cvs update -Pd -A
        cvs update -Pd -j pkgviews-base -j pkgviews

diffstat:

 usr.sbin/pkg_install/Makefile            |    4 +-
 usr.sbin/pkg_install/Makefile.inc        |    2 +-
 usr.sbin/pkg_install/README              |    6 +-
 usr.sbin/pkg_install/add/add.h           |    5 +-
 usr.sbin/pkg_install/add/extract.c       |    4 +-
 usr.sbin/pkg_install/add/futil.c         |    4 +-
 usr.sbin/pkg_install/add/main.c          |   81 +++++---
 usr.sbin/pkg_install/add/perform.c       |   97 ++++++++--
 usr.sbin/pkg_install/add/pkg_add.1       |   66 ++++++-
 usr.sbin/pkg_install/admin/main.c        |   72 +++++--
 usr.sbin/pkg_install/admin/pkg_admin.1   |   45 ++++-
 usr.sbin/pkg_install/create/create.h     |    3 +-
 usr.sbin/pkg_install/create/main.c       |   17 +-
 usr.sbin/pkg_install/create/perform.c    |   12 +-
 usr.sbin/pkg_install/create/pkg_create.1 |   27 ++-
 usr.sbin/pkg_install/create/pl.c         |    4 +-
 usr.sbin/pkg_install/delete/main.c       |   61 +++---
 usr.sbin/pkg_install/delete/perform.c    |  213 ++++++++++++++++++++---
 usr.sbin/pkg_install/delete/pkg_delete.1 |   27 ++-
 usr.sbin/pkg_install/info/info.h         |    4 +-
 usr.sbin/pkg_install/info/main.c         |   21 +-
 usr.sbin/pkg_install/info/perform.c      |   24 +-
 usr.sbin/pkg_install/info/pkg_info.1     |   28 ++-
 usr.sbin/pkg_install/info/show.c         |   42 ++++-
 usr.sbin/pkg_install/lib/Makefile        |    2 +-
 usr.sbin/pkg_install/lib/fexec.c         |    2 +-
 usr.sbin/pkg_install/lib/file.c          |    6 +-
 usr.sbin/pkg_install/lib/ftpio.c         |    4 +-
 usr.sbin/pkg_install/lib/lib.h           |   13 +-
 usr.sbin/pkg_install/lib/lpkg.c          |    2 +-
 usr.sbin/pkg_install/lib/path.c          |    4 +-
 usr.sbin/pkg_install/lib/path.h          |    2 +-
 usr.sbin/pkg_install/lib/pen.c           |    4 +-
 usr.sbin/pkg_install/lib/pkgdb.c         |   41 +++-
 usr.sbin/pkg_install/lib/plist.c         |    4 +-
 usr.sbin/pkg_install/lib/str.c           |    4 +-
 usr.sbin/pkg_install/lib/version.h       |    4 +-
 usr.sbin/pkg_install/view/Makefile       |    6 +
 usr.sbin/pkg_install/view/linkfarm.1     |  144 ++++++++++++++++
 usr.sbin/pkg_install/view/linkfarm.sh    |  221 ++++++++++++++++++++++++
 usr.sbin/pkg_install/view/pkg_view.1     |  269 ++++++++++++++++++++++++++++++
 usr.sbin/pkg_install/view/pkg_view.sh    |  276 +++++++++++++++++++++++++++++++
 42 files changed, 1626 insertions(+), 251 deletions(-)

diffs (truncated from 3071 to 300 lines):

diff -r 9437850bfd32 -r 4cbf52fc436f usr.sbin/pkg_install/Makefile
--- a/usr.sbin/pkg_install/Makefile     Tue Sep 02 06:36:22 2003 +0000
+++ b/usr.sbin/pkg_install/Makefile     Tue Sep 02 07:34:47 2003 +0000
@@ -1,6 +1,6 @@
-# $NetBSD: Makefile,v 1.5 2001/01/09 03:13:43 lukem Exp $
+# $NetBSD: Makefile,v 1.6 2003/09/02 07:34:47 jlam 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 9437850bfd32 -r 4cbf52fc436f usr.sbin/pkg_install/Makefile.inc
--- a/usr.sbin/pkg_install/Makefile.inc Tue Sep 02 06:36:22 2003 +0000
+++ b/usr.sbin/pkg_install/Makefile.inc Tue Sep 02 07:34:47 2003 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.23 2002/10/26 14:43:44 hubertf Exp $
+# $NetBSD: Makefile.inc,v 1.24 2003/09/02 07:34:47 jlam Exp $
 # Original from FreeBSD, no rcs id.
 
 .include <bsd.own.mk>
diff -r 9437850bfd32 -r 4cbf52fc436f usr.sbin/pkg_install/README
--- a/usr.sbin/pkg_install/README       Tue Sep 02 06:36:22 2003 +0000
+++ b/usr.sbin/pkg_install/README       Tue Sep 02 07:34:47 2003 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: README,v 1.6 2002/02/21 14:21:49 agc Exp $
+# $NetBSD: README,v 1.7 2003/09/02 07:34:48 jlam 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,
+and Johnny Lam.
 
 When making snapshots, please modify PKGTOOLS_VERSION in lib/version.h
 to that day's date.
diff -r 9437850bfd32 -r 4cbf52fc436f usr.sbin/pkg_install/add/add.h
--- a/usr.sbin/pkg_install/add/add.h    Tue Sep 02 06:36:22 2003 +0000
+++ b/usr.sbin/pkg_install/add/add.h    Tue Sep 02 07:34:47 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.6 2003/09/02 07:34:49 jlam 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 9437850bfd32 -r 4cbf52fc436f usr.sbin/pkg_install/add/extract.c
--- a/usr.sbin/pkg_install/add/extract.c        Tue Sep 02 06:36:22 2003 +0000
+++ b/usr.sbin/pkg_install/add/extract.c        Tue Sep 02 07:34:47 2003 +0000
@@ -1,11 +1,11 @@
-/*     $NetBSD: extract.c,v 1.30 2003/07/14 06:00:44 itojun Exp $      */
+/*     $NetBSD: extract.c,v 1.31 2003/09/02 07:34:49 jlam 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.30 2003/07/14 06:00:44 itojun Exp $");
+__RCSID("$NetBSD: extract.c,v 1.31 2003/09/02 07:34:49 jlam Exp $");
 #endif
 #endif
 
diff -r 9437850bfd32 -r 4cbf52fc436f usr.sbin/pkg_install/add/futil.c
--- a/usr.sbin/pkg_install/add/futil.c  Tue Sep 02 06:36:22 2003 +0000
+++ b/usr.sbin/pkg_install/add/futil.c  Tue Sep 02 07:34:47 2003 +0000
@@ -1,11 +1,11 @@
-/*     $NetBSD: futil.c,v 1.11 2003/08/25 10:35:28 tron Exp $  */
+/*     $NetBSD: futil.c,v 1.12 2003/09/02 07:34:49 jlam 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.11 2003/08/25 10:35:28 tron Exp $");
+__RCSID("$NetBSD: futil.c,v 1.12 2003/09/02 07:34:49 jlam Exp $");
 #endif
 #endif
 
diff -r 9437850bfd32 -r 4cbf52fc436f usr.sbin/pkg_install/add/main.c
--- a/usr.sbin/pkg_install/add/main.c   Tue Sep 02 06:36:22 2003 +0000
+++ b/usr.sbin/pkg_install/add/main.c   Tue Sep 02 07:34:47 2003 +0000
@@ -1,11 +1,11 @@
-/*     $NetBSD: main.c,v 1.30 2003/07/14 06:17:54 itojun Exp $ */
+/*     $NetBSD: main.c,v 1.31 2003/09/02 07:34:49 jlam 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.30 2003/07/14 06:17:54 itojun Exp $");
+__RCSID("$NetBSD: main.c,v 1.31 2003/09/02 07:34:49 jlam 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;
 
@@ -55,9 +58,10 @@
 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);
 }
 
@@ -72,7 +76,32 @@
        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;
 
@@ -80,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':
@@ -105,21 +121,26 @@
                        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':
-                       Replace = 1;
+               case 'v':
+                       Verbose = TRUE;
                        break;
+
+               case 'W':
+                       Viewbase = optarg;
+                       break;
+
+               case 'w':
+                       View = optarg;
+                       break;
+
                case 'h':
                case '?':
                default:
diff -r 9437850bfd32 -r 4cbf52fc436f usr.sbin/pkg_install/add/perform.c
--- a/usr.sbin/pkg_install/add/perform.c        Tue Sep 02 06:36:22 2003 +0000
+++ b/usr.sbin/pkg_install/add/perform.c        Tue Sep 02 07:34:47 2003 +0000
@@ -1,11 +1,11 @@
-/*     $NetBSD: perform.c,v 1.85 2003/08/25 10:35:28 tron Exp $        */
+/*     $NetBSD: perform.c,v 1.86 2003/09/02 07:34:50 jlam Exp $        */
 
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static const char *rcsid = "from FreeBSD Id: perform.c,v 1.44 1997/10/13 15:03:46 jkh Exp";
 #else
-__RCSID("$NetBSD: perform.c,v 1.85 2003/08/25 10:35:28 tron Exp $");
+__RCSID("$NetBSD: perform.c,v 1.86 2003/09/02 07:34:50 jlam Exp $");
 #endif
 #endif
 
@@ -37,7 +37,6 @@
 
 #include <signal.h>
 #include <string.h>
-#include <sys/wait.h>
 
 static char LogDir[FILENAME_MAX];
 static int zapLogDir;          /* Should we delete LogDir? */
@@ -73,9 +72,14 @@
        if (Verbose)
                printf("Loading it from %s.\n", name);
        path_setenv("PKG_PATH");
-       if (vsystem("%s/pkg_add -s %s %s%s%s %s%s",
+       if (vsystem("%s/pkg_add -s %s %s%s%s %s%s %s%s%s %s%s",
                        BINDIR,
                        get_verification(),
+                       NoView ? "-L " : "",
+                       View ? "-w " : "",
+                       View ? View : "",
+                       Viewbase ? "-W " : "",
+                       Viewbase ? Viewbase : "",
                        Force ? "-f " : "",
                        Prefix ? "-p " : "",
                        Prefix ? Prefix : "",
@@ -105,7 +109,7 @@
        char    replace_via[FILENAME_MAX];
        char    replace_to[FILENAME_MAX];
        int     replacing = 0;
-       char   *where_to, *tmp, *extract;
+       char   *where_to, *extract;
        char   *dbdir;
        const char *exact;
        FILE   *cfile;
@@ -114,22 +118,13 @@
        struct stat sb;
        int     inPlace;
        int     rc;
+       Boolean is_depoted_pkg = FALSE;
 
        errc = 0;
        zapLogDir = 0;
        LogDir[0] = '\0';
        strlcpy(playpen, FirstPen, sizeof(playpen));
        inPlace = 0;
-       dbdir = (tmp = getenv(PKG_DBDIR)) ? tmp : DEF_LOG_DIR;
-
-       /* make sure dbdir actually exists! */
-       if (!(isdir(dbdir) || islinktodir(dbdir))) {
-               if (fexec("mkdir", "-m", "755", "-p", dbdir, NULL)) {
-                       errx(EXIT_FAILURE,
-                           "Database-dir %s cannot be generated, aborting.",



Home | Main Index | Thread Index | Old Index