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 sync with NetBSD-current's ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/4e7ea60c5245
branches:  trunk
changeset: 461874:4e7ea60c5245
user:      grant <grant%pkgsrc.org@localhost>
date:      Tue Sep 23 07:13:45 2003 +0000

description:
sync with NetBSD-current's pkg_install-20030923.

diffstat:

 pkgtools/pkg_install/files/README                 |    4 +-
 pkgtools/pkg_install/files/add/add.h              |    2 +-
 pkgtools/pkg_install/files/add/futil.c            |    4 +-
 pkgtools/pkg_install/files/add/main.c             |    4 +-
 pkgtools/pkg_install/files/add/perform.c          |    6 +-
 pkgtools/pkg_install/files/add/pkg_add.1          |    2 +-
 pkgtools/pkg_install/files/add/pkg_add.cat1       |    8 +-
 pkgtools/pkg_install/files/add/verify.c           |    4 +-
 pkgtools/pkg_install/files/add/verify.h           |    2 +-
 pkgtools/pkg_install/files/admin/main.c           |  102 ++++++++++++---------
 pkgtools/pkg_install/files/admin/pkg_admin.1      |   10 +-
 pkgtools/pkg_install/files/admin/pkg_admin.cat1   |    8 +-
 pkgtools/pkg_install/files/create/create.h        |    2 +-
 pkgtools/pkg_install/files/create/main.c          |    4 +-
 pkgtools/pkg_install/files/create/perform.c       |    4 +-
 pkgtools/pkg_install/files/create/pkg_create.1    |    2 +-
 pkgtools/pkg_install/files/create/pkg_create.cat1 |    8 +-
 pkgtools/pkg_install/files/create/pl.c            |    4 +-
 pkgtools/pkg_install/files/delete/delete.h        |    2 +-
 pkgtools/pkg_install/files/delete/main.c          |    4 +-
 pkgtools/pkg_install/files/delete/perform.c       |    4 +-
 pkgtools/pkg_install/files/delete/pkg_delete.1    |    2 +-
 pkgtools/pkg_install/files/delete/pkg_delete.cat1 |   15 +-
 pkgtools/pkg_install/files/info/info.h            |    2 +-
 pkgtools/pkg_install/files/info/main.c            |    4 +-
 pkgtools/pkg_install/files/info/perform.c         |    4 +-
 pkgtools/pkg_install/files/info/pkg_info.1        |    2 +-
 pkgtools/pkg_install/files/info/pkg_info.cat1     |   14 +-
 pkgtools/pkg_install/files/info/show.c            |    4 +-
 pkgtools/pkg_install/files/lib/defs.h             |    2 +-
 pkgtools/pkg_install/files/lib/exec.c             |    4 +-
 pkgtools/pkg_install/files/lib/fexec.c            |    2 +-
 pkgtools/pkg_install/files/lib/file.c             |    4 +-
 pkgtools/pkg_install/files/lib/global.c           |    4 +-
 pkgtools/pkg_install/files/lib/lib.h              |   30 ++++--
 pkgtools/pkg_install/files/lib/lpkg.c             |    2 +-
 pkgtools/pkg_install/files/lib/path.c             |    4 +-
 pkgtools/pkg_install/files/lib/path.h             |    2 +-
 pkgtools/pkg_install/files/lib/pen.c              |    4 +-
 pkgtools/pkg_install/files/lib/plist.c            |    4 +-
 pkgtools/pkg_install/files/lib/str.c              |    4 +-
 pkgtools/pkg_install/files/lib/version.c          |    4 +-
 pkgtools/pkg_install/files/lib/version.h          |    4 +-
 pkgtools/pkg_install/files/view/linkfarm.1        |    2 +-
 pkgtools/pkg_install/files/view/linkfarm.cat1     |    4 +-
 pkgtools/pkg_install/files/view/pkg_view.1        |    2 +-
 pkgtools/pkg_install/files/view/pkg_view.cat1     |    8 +-
 47 files changed, 179 insertions(+), 148 deletions(-)

diffs (truncated from 1022 to 300 lines):

diff -r 5ea1ac2cb6ed -r 4e7ea60c5245 pkgtools/pkg_install/files/README
--- a/pkgtools/pkg_install/files/README Tue Sep 23 06:59:24 2003 +0000
+++ b/pkgtools/pkg_install/files/README Tue Sep 23 07:13:45 2003 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: README,v 1.2 2003/09/01 16:27:09 jlam Exp $
+# $NetBSD: README,v 1.3 2003/09/23 07:13:45 grant Exp $
 # Original from FreeBSD, no rcs id.
 
 This is the pkg_install suite of tools for doing maintainance of
@@ -12,7 +12,7 @@
 
 In another round of enhancements, NetBSD changes were added by
 Alistair Crooks, Hubert Feyrer, Thorsten Frueauf, Christian E. Hopps,
-and Johnny Lam.
+Johnny Lam and Matthias Scheler.
 
 When making snapshots, please modify PKGTOOLS_VERSION in lib/version.h
 to that day's date.
diff -r 5ea1ac2cb6ed -r 4e7ea60c5245 pkgtools/pkg_install/files/add/add.h
--- a/pkgtools/pkg_install/files/add/add.h      Tue Sep 23 06:59:24 2003 +0000
+++ b/pkgtools/pkg_install/files/add/add.h      Tue Sep 23 07:13:45 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: add.h,v 1.2 2003/09/01 16:27:11 jlam Exp $ */
+/* $NetBSD: add.h,v 1.3 2003/09/23 07:13:46 grant Exp $ */
 
 /* from FreeBSD Id: add.h,v 1.8 1997/02/22 16:09:15 peter Exp  */
 
diff -r 5ea1ac2cb6ed -r 4e7ea60c5245 pkgtools/pkg_install/files/add/futil.c
--- a/pkgtools/pkg_install/files/add/futil.c    Tue Sep 23 06:59:24 2003 +0000
+++ b/pkgtools/pkg_install/files/add/futil.c    Tue Sep 23 07:13:45 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: futil.c,v 1.3 2003/09/02 08:28:23 jlam Exp $   */
+/*     $NetBSD: futil.c,v 1.4 2003/09/23 07:13:46 grant 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.3 2003/09/02 08:28:23 jlam Exp $");
+__RCSID("$NetBSD: futil.c,v 1.4 2003/09/23 07:13:46 grant Exp $");
 #endif
 #endif
 
diff -r 5ea1ac2cb6ed -r 4e7ea60c5245 pkgtools/pkg_install/files/add/main.c
--- a/pkgtools/pkg_install/files/add/main.c     Tue Sep 23 06:59:24 2003 +0000
+++ b/pkgtools/pkg_install/files/add/main.c     Tue Sep 23 07:13:45 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.4 2003/09/02 08:28:23 jlam Exp $    */
+/*     $NetBSD: main.c,v 1.5 2003/09/23 07:13:46 grant Exp $   */
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -11,7 +11,7 @@
 #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.4 2003/09/02 08:28:23 jlam Exp $");
+__RCSID("$NetBSD: main.c,v 1.5 2003/09/23 07:13:46 grant Exp $");
 #endif
 #endif
 
diff -r 5ea1ac2cb6ed -r 4e7ea60c5245 pkgtools/pkg_install/files/add/perform.c
--- a/pkgtools/pkg_install/files/add/perform.c  Tue Sep 23 06:59:24 2003 +0000
+++ b/pkgtools/pkg_install/files/add/perform.c  Tue Sep 23 07:13:45 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: perform.c,v 1.10 2003/09/09 13:34:17 jlam Exp $        */
+/*     $NetBSD: perform.c,v 1.11 2003/09/23 07:13:46 grant Exp $       */
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -11,7 +11,7 @@
 #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.10 2003/09/09 13:34:17 jlam Exp $");
+__RCSID("$NetBSD: perform.c,v 1.11 2003/09/23 07:13:46 grant Exp $");
 #endif
 #endif
 
@@ -654,7 +654,7 @@
                if (Verbose)
                        printf("mtree -U -f %s -d -e -p %s\n", MTREE_FNAME, p ? p->name : "/");
                if (!Fake) {
-                       if (vsystem("%s/mtree -U -f %s -d -e -p %s", BINDIR, MTREE_FNAME, p ? p->name : "/"))
+                       if (vsystem("%s -U -f %s -d -e -p %s", MTREE_CMD, MTREE_FNAME, p ? p->name : "/"))
                                warnx("mtree returned a non-zero status - continuing");
                }
                unlink(MTREE_FNAME); /* remove this line to tar up pkg later  - HF */
diff -r 5ea1ac2cb6ed -r 4e7ea60c5245 pkgtools/pkg_install/files/add/pkg_add.1
--- a/pkgtools/pkg_install/files/add/pkg_add.1  Tue Sep 23 06:59:24 2003 +0000
+++ b/pkgtools/pkg_install/files/add/pkg_add.1  Tue Sep 23 07:13:45 2003 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: pkg_add.1,v 1.4 2003/09/09 13:34:18 jlam Exp $
+.\" $NetBSD: pkg_add.1,v 1.5 2003/09/23 07:13:47 grant Exp $
 .\"
 .\" FreeBSD install - a package for the installation and maintenance
 .\" of non-core utilities.
diff -r 5ea1ac2cb6ed -r 4e7ea60c5245 pkgtools/pkg_install/files/add/pkg_add.cat1
--- a/pkgtools/pkg_install/files/add/pkg_add.cat1       Tue Sep 23 06:59:24 2003 +0000
+++ b/pkgtools/pkg_install/files/add/pkg_add.cat1       Tue Sep 23 07:13:45 2003 +0000
@@ -1,4 +1,4 @@
-PKG_ADD(1)                  NetBSD Reference Manual                 PKG_ADD(1)
+PKG_ADD(1)              NetBSD General Commands Manual              PKG_ADD(1)
 
 NNAAMMEE
      ppkkgg__aadddd - a utility for installing and upgrading software package distri-
@@ -149,11 +149,11 @@
      extract files directly from their anonymous ftp or WWW locations (e.g.
      ppkkgg__aadddd ftp://ftp.NetBSD.org/pub/NetBSD/pack-
      ages/1.5/i386/shells/bash-2.04.tgz).  Note:  If you wish to use _p_a_s_s_i_v_e
-     _m_o_d_e  ftp in such transfers, set the variable _F_T_P___P_A_S_S_I_V_E___M_O_D_E  to some
+     _m_o_d_e ftp in such transfers, set the variable _F_T_P___P_A_S_S_I_V_E___M_O_D_E to some
      value in your environment.  Otherwise, the more standard ACTIVE mode may
      be used.  If ppkkgg__aadddd consistently fails to fetch a package from a site
      known to work, it may be because you have a firewall that demands the us-
-     age of _p_a_s_s_i_v_e _m_o_d_e  ftp.
+     age of _p_a_s_s_i_v_e _m_o_d_e ftp.
 
 TTEECCHHNNIICCAALL DDEETTAAIILLSS
      ppkkgg__aadddd extracts each package's "packing list" into a special staging di-
@@ -334,4 +334,4 @@
 
      Sure to be others.
 
-NetBSD 1.6.1_STABLE            September 8, 2003                             6
+NetBSD 1.6                     September 8, 2003                    NetBSD 1.6
diff -r 5ea1ac2cb6ed -r 4e7ea60c5245 pkgtools/pkg_install/files/add/verify.c
--- a/pkgtools/pkg_install/files/add/verify.c   Tue Sep 23 06:59:24 2003 +0000
+++ b/pkgtools/pkg_install/files/add/verify.c   Tue Sep 23 07:13:45 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: verify.c,v 1.3 2003/09/02 08:28:24 jlam Exp $ */
+/* $NetBSD: verify.c,v 1.4 2003/09/23 07:13:47 grant Exp $ */
 
 /*
  * Copyright (c) 2001 Alistair G. Crooks.  All rights reserved.
@@ -41,7 +41,7 @@
 #ifndef lint
 __COPYRIGHT("@(#) Copyright (c) 1999 \
                The NetBSD Foundation, Inc.  All rights reserved.");
-__RCSID("$NetBSD: verify.c,v 1.3 2003/09/02 08:28:24 jlam Exp $");
+__RCSID("$NetBSD: verify.c,v 1.4 2003/09/23 07:13:47 grant Exp $");
 #endif
 
 #if HAVE_SYS_TYPES_H
diff -r 5ea1ac2cb6ed -r 4e7ea60c5245 pkgtools/pkg_install/files/add/verify.h
--- a/pkgtools/pkg_install/files/add/verify.h   Tue Sep 23 06:59:24 2003 +0000
+++ b/pkgtools/pkg_install/files/add/verify.h   Tue Sep 23 07:13:45 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: verify.h,v 1.2 2003/09/01 16:27:11 jlam Exp $ */
+/* $NetBSD: verify.h,v 1.3 2003/09/23 07:13:47 grant Exp $ */
 
 /*
  * Copyright (c) 2001 Alistair G. Crooks.  All rights reserved.
diff -r 5ea1ac2cb6ed -r 4e7ea60c5245 pkgtools/pkg_install/files/admin/main.c
--- a/pkgtools/pkg_install/files/admin/main.c   Tue Sep 23 06:59:24 2003 +0000
+++ b/pkgtools/pkg_install/files/admin/main.c   Tue Sep 23 07:13:45 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.12 2003/09/13 05:50:26 jlam Exp $   */
+/*     $NetBSD: main.c,v 1.13 2003/09/23 07:13:48 grant Exp $  */
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -8,7 +8,7 @@
 #include <sys/cdefs.h>
 #endif
 #ifndef lint
-__RCSID("$NetBSD: main.c,v 1.12 2003/09/13 05:50:26 jlam Exp $");
+__RCSID("$NetBSD: main.c,v 1.13 2003/09/23 07:13:48 grant Exp $");
 #endif
 
 /*
@@ -73,15 +73,35 @@
 
 #define DEFAULT_SFX    ".t[bg]z"       /* default suffix for ls{all,best} */
 
-static const char Options[] = "bd:K:s:V";
-
-void    usage(void);
+static const char Options[] = "K:SVbd:s:";
 
 int     filecnt;
 int     pkgcnt;
 
 static int checkpattern_fn(const char *, void *);
 
+/* print usage message and exit */
+static void 
+usage(const char *prog)
+{
+       (void) fprintf(stderr, "usage: %s [-b] [-d lsdir] [-V] [-s sfx] command args ...\n"
+           "Where 'commands' and 'args' are:\n"
+           " rebuild                     - rebuild pkgdb from +CONTENTS files\n"
+           " check [pkg ...]             - check md5 checksum of installed files\n"
+           " add pkg ...                 - add pkg files to database\n"
+           " delete pkg ...              - delete file entries for pkg in database\n"
+#ifdef PKGDB_DEBUG
+           " addkey key value            - add key and value\n"
+           " delkey key                  - delete reference to key\n"
+#endif
+           " lsall /path/to/pkgpattern   - list all pkgs matching the pattern\n"
+           " lsbest /path/to/pkgpattern  - list pkgs matching the pattern best\n"
+           " dump                        - dump database\n"
+           " pmatch pattern pkg          - returns true if pkg matches pattern, otherwise false\n",
+           prog);
+       exit(EXIT_FAILURE);
+}
+
 /*
  * Assumes CWD is in /var/db/pkg/<pkg>!
  */
@@ -190,7 +210,7 @@
        char           *PkgDBDir, *PkgName, *dirp;
        char            file[FILENAME_MAX];
        char            dir[FILENAME_MAX];
-       int             cnt;
+       int             cnt = 0;
 
        if (!pkgdb_open(ReadWrite))
                err(EXIT_FAILURE, "cannot open pkgdb");
@@ -401,20 +421,34 @@
 int 
 main(int argc, char *argv[])
 {
-       int     ch;
-       char    lsdir[FILENAME_MAX];
-       char   *lsdirp = NULL;
-       char    sfx[FILENAME_MAX];
-       Boolean use_default_sfx = TRUE;
-       Boolean show_basename_only = FALSE;
+       const char      *prog;
+       Boolean          use_default_sfx = TRUE;
+       Boolean          show_basename_only = FALSE;
+       char             lsdir[FILENAME_MAX];
+       char             sfx[FILENAME_MAX];
+       char            *lsdirp = NULL;
+       int              ch;
 
-       setprogname(argv[0]);
+       setprogname(prog = argv[0]);
 
        if (argc < 2)
-               usage();
+               usage(prog);
 
        while ((ch = getopt(argc, argv, Options)) != -1)
                switch (ch) {
+               case 'K':
+                       _pkgdb_setPKGDB_DIR(optarg);
+                       break;
+
+               case 'S':
+                       sfx[0] = 0x0;
+                       use_default_sfx = FALSE;
+                       break;
+
+               case 'V':
+                       show_version();
+                       /* NOTREACHED */
+
                case 'b':
                        show_basename_only = TRUE;
                        break;
@@ -424,26 +458,23 @@
                        lsdirp = lsdir;
                        break;
 
-               case 'K':
-                       _pkgdb_setPKGDB_DIR(optarg);
-                       break;
-
                case 's':
                        (void) strlcpy(sfx, optarg, sizeof(sfx));
                        use_default_sfx = FALSE;
                        break;
 
-               case 'V':
-                       show_version();
-                       /* NOTREACHED */
-
                default:
-                       usage();
+                       usage(prog);
                        /* NOTREACHED */
                }
+
        argc -= optind;
        argv += optind;
 
+       if (argc <= 0) {
+               usage(prog);
+       }
+
        if (use_default_sfx)
                (void) snprintf(sfx, sizeof(sfx), "%s", DEFAULT_SFX);
 
@@ -457,7 +488,7 @@
                pkg = argv[1];
 



Home | Main Index | Thread Index | Old Index