Source-Changes-HG archive

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

[src/trunk]: src/external/bsd/pkg_install/dist Import pkg_install-20170419.



details:   https://anonhg.NetBSD.org/src/rev/05285b9658ab
branches:  trunk
changeset: 823365:05285b9658ab
user:      joerg <joerg%NetBSD.org@localhost>
date:      Thu Apr 20 13:12:46 2017 +0000

description:
Import pkg_install-20170419.

diffstat:

 external/bsd/pkg_install/dist/add/main.c                 |   36 +--
 external/bsd/pkg_install/dist/add/pkg_add.1              |   26 +--
 external/bsd/pkg_install/dist/admin/main.c               |   26 +-
 external/bsd/pkg_install/dist/admin/pkg_admin.1          |   17 +-
 external/bsd/pkg_install/dist/create/build.c             |   25 +-
 external/bsd/pkg_install/dist/create/create.h            |    4 +-
 external/bsd/pkg_install/dist/create/main.c              |   18 +-
 external/bsd/pkg_install/dist/create/perform.c           |    9 +-
 external/bsd/pkg_install/dist/create/pl.c                |   40 +---
 external/bsd/pkg_install/dist/create/util.c              |   13 +-
 external/bsd/pkg_install/dist/delete/pkg_delete.1        |   13 +-
 external/bsd/pkg_install/dist/delete/pkg_delete.c        |  160 +-------------
 external/bsd/pkg_install/dist/info/info.h                |    3 +-
 external/bsd/pkg_install/dist/info/perform.c             |   42 +--
 external/bsd/pkg_install/dist/lib/config.h.in            |   18 +-
 external/bsd/pkg_install/dist/lib/file.c                 |    7 +-
 external/bsd/pkg_install/dist/lib/gpgsig.c               |  126 +++--------
 external/bsd/pkg_install/dist/lib/pkg_io.c               |   47 +++-
 external/bsd/pkg_install/dist/lib/vulnerabilities-file.c |   41 +-
 19 files changed, 183 insertions(+), 488 deletions(-)

diffs (truncated from 1467 to 300 lines):

diff -r f5056367d414 -r 05285b9658ab external/bsd/pkg_install/dist/add/main.c
--- a/external/bsd/pkg_install/dist/add/main.c  Thu Apr 20 13:11:35 2017 +0000
+++ b/external/bsd/pkg_install/dist/add/main.c  Thu Apr 20 13:12:46 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.1.1.10 2011/02/18 22:32:27 aymeric Exp $    */
+/*     $NetBSD: main.c,v 1.1.1.11 2017/04/20 13:12:46 joerg Exp $      */
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -7,7 +7,7 @@
 #if HAVE_SYS_CDEFS_H
 #include <sys/cdefs.h>
 #endif
-__RCSID("$NetBSD: main.c,v 1.1.1.10 2011/02/18 22:32:27 aymeric Exp $");
+__RCSID("$NetBSD: main.c,v 1.1.1.11 2017/04/20 13:12:46 joerg Exp $");
 
 /*
  *
@@ -33,20 +33,14 @@
 #if HAVE_ERR_H
 #include <err.h>
 #endif
-#if HAVE_SYS_PARAM_H
-#include <sys/param.h>
-#endif
 #include "lib.h"
 #include "add.h"
 
-static char Options[] = "AC:DIK:LP:RVW:fhm:np:t:Uuvw:";
+static char Options[] = "AC:DIK:P:RVfhm:np:t:Uuv";
 
 char   *Destdir = NULL;
 char   *OverrideMachine = NULL;
 char   *Prefix = NULL;
-char   *View = NULL;
-char   *Viewbase = NULL;
-Boolean NoView = FALSE;
 Boolean NoInstall = FALSE;
 Boolean NoRecord = FALSE;
 Boolean Automatic = FALSE;
@@ -65,10 +59,9 @@
 static void
 usage(void)
 {
-       (void) fprintf(stderr, "%s\n%s\n%s\n%s\n",
-           "usage: pkg_add [-AfhILnRuVv] [-C config] [-P destdir] [-K pkg_dbdir]",
-           "               [-m machine] [-p prefix] [-s verification-type",
-           "               [-W viewbase] [-w view]\n",
+       (void) fprintf(stderr, "%s\n%s\n%s\n",
+           "usage: pkg_add [-AfhInRuVv] [-C config] [-P destdir] [-K pkg_dbdir]",
+           "               [-m machine] [-p prefix]",
            "               [[ftp|http]://[user[:password]@]host[:port]][/path/]pkg-name ...");
        exit(1);
 }
@@ -112,10 +105,6 @@
                        pkgdb_set_dir(optarg, 3);
                        break;
 
-               case 'L':
-                       NoView = TRUE;
-                       break;
-
                case 'R':
                        NoRecord = TRUE;
                        break;
@@ -150,14 +139,6 @@
                        Verbose = TRUE;
                        break;
 
-               case 'W':
-                       Viewbase = optarg;
-                       break;
-
-               case 'w':
-                       View = optarg;
-                       break;
-
                case 'h':
                case '?':
                default:
@@ -178,7 +159,10 @@
                free(pkgdbdir);
        }
 
+#ifndef BOOTSTRAP
        process_pkg_path();
+#endif
+
        TAILQ_INIT(&pkgs);
 
        if (argc == 0) {
@@ -187,6 +171,7 @@
                usage();
        }
 
+#ifndef BOOTSTRAP
        if (strcasecmp(do_license_check, "no") == 0)
                LicenseCheck = 0;
        else if (strcasecmp(do_license_check, "yes") == 0)
@@ -199,6 +184,7 @@
 
        if (LicenseCheck)
                load_license_lists();
+#endif
 
        /* Get all the remaining package names, if any */
        for (; argc > 0; --argc, ++argv) {
diff -r f5056367d414 -r 05285b9658ab external/bsd/pkg_install/dist/add/pkg_add.1
--- a/external/bsd/pkg_install/dist/add/pkg_add.1       Thu Apr 20 13:11:35 2017 +0000
+++ b/external/bsd/pkg_install/dist/add/pkg_add.1       Thu Apr 20 13:12:46 2017 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: pkg_add.1,v 1.1.1.12 2011/02/18 22:32:28 aymeric Exp $
+.\" $NetBSD: pkg_add.1,v 1.1.1.13 2017/04/20 13:12:46 joerg Exp $
 .\"
 .\" FreeBSD install - a package for the installation and maintenance
 .\" of non-core utilities.
@@ -17,7 +17,7 @@
 .\"
 .\"     @(#)pkg_add.1
 .\"
-.Dd June 16, 2010
+.Dd December 27, 2014
 .Dt PKG_ADD 1
 .Os
 .Sh NAME
@@ -25,14 +25,12 @@
 .Nd a utility for installing and upgrading software package distributions
 .Sh SYNOPSIS
 .Nm
-.Op Fl AfILnRUuVv
+.Op Fl AfInRUuVv
 .Op Fl C Ar config
 .Op Fl K Ar pkg_dbdir
 .Op Fl m Ar machine
 .Op Fl P Ar destdir
 .Op Fl p Ar prefix
-.Op Fl W Ar viewbase
-.Op Fl w Ar view
 .Ar Oo Oo Li ftp|http Oc Ns Li :// Ns Oo Ar user Oc Ns \
 Oo Li \&: Ns Ar password Oc \
 Ns Li @ Oc Ns Ar host Ns Oo Li \&: Ns Ar port Oc Ns \
@@ -142,8 +140,6 @@
 .Dv PKG_DBDIR
 configuration option with the value
 .Ar pkg_dbdir .
-.It Fl L
-Don't add the package to any views after installation.
 .It Fl m
 Override the machine architecture returned by uname with
 .Ar machine .
@@ -179,14 +175,6 @@
 Print version number and exit.
 .It Fl v
 Turn on verbose output.
-.It Fl W Ar viewbase
-Passed down to
-.Xr pkg_view 1
-for managed views.
-.It Fl w Ar view
-Passed down to
-.Xr pkg_view 1
-for managed views.
 .El
 .Pp
 One or more
@@ -337,11 +325,6 @@
 .Pa +REQUIRED_BY
 file.
 .It
-If the package is a depoted package, then add it to the registered
-by calling
-.Xr pkg_view 1
-accordingly.
-.It
 Finally, if we were upgrading a package, any
 .Pa +REQUIRED_BY
 file that was moved aside before upgrading was started is now moved
@@ -386,9 +369,6 @@
 See
 .Xr pkg_install.conf 5
 for options, that can also be specified using the environment.
-Packages using views are also affected by the environment variables
-documented for
-.Xr pkg_view 1 .
 .Sh EXAMPLES
 In all cases,
 .Nm
diff -r f5056367d414 -r 05285b9658ab external/bsd/pkg_install/dist/admin/main.c
--- a/external/bsd/pkg_install/dist/admin/main.c        Thu Apr 20 13:11:35 2017 +0000
+++ b/external/bsd/pkg_install/dist/admin/main.c        Thu Apr 20 13:12:46 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.1.1.15 2010/04/23 20:54:07 joerg Exp $      */
+/*     $NetBSD: main.c,v 1.1.1.16 2017/04/20 13:12:47 joerg Exp $      */
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -7,7 +7,7 @@
 #if HAVE_SYS_CDEFS_H
 #include <sys/cdefs.h>
 #endif
-__RCSID("$NetBSD: main.c,v 1.1.1.15 2010/04/23 20:54:07 joerg Exp $");
+__RCSID("$NetBSD: main.c,v 1.1.1.16 2017/04/20 13:12:47 joerg Exp $");
 
 /*-
  * Copyright (c) 1999-2009 The NetBSD Foundation, Inc.
@@ -104,7 +104,6 @@
            " rebuild-tree                - rebuild +REQUIRED_BY files from forward deps\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"
            " set variable=value pkg ...  - set installation variable for package\n"
            " unset variable pkg ...      - unset installation variable for package\n"
            " lsall /path/to/pkgpattern   - list all pkgs matching the pattern\n"
@@ -220,15 +219,6 @@
        return 0;
 }
 
-static void
-delete1pkg(const char *pkgdir)
-{
-       if (!pkgdb_open(ReadWrite))
-               err(EXIT_FAILURE, "cannot open pkgdb");
-       (void) pkgdb_remove_pkg(pkgdir);
-       pkgdb_close();
-}
-
 static void 
 rebuild(void)
 {
@@ -248,7 +238,7 @@
        iterate_pkg_db(add_pkg, &count);
 
        printf("\n");
-       printf("Stored %" PRIzu " file%s and %zu explicit director%s"
+       printf("Stored %" PRIzu " file%s and %" PRIzu " explicit director%s"
            " from %"PRIzu " package%s in %s.\n",
            count.files, count.files == 1 ? "" : "s",
            count.directories, count.directories == 1 ? "y" : "ies",
@@ -525,12 +515,6 @@
 
                for (++argv; *argv != NULL; ++argv)
                        add_pkg(*argv, &count);
-       } else if (strcasecmp(argv[0], "delete") == 0) {
-               argv++;         /* "delete" */
-               while (*argv != NULL) {
-                       delete1pkg(*argv);
-                       argv++;
-               }
        } else if (strcasecmp(argv[0], "set") == 0) {
                argv++;         /* "set" */
                set_unset_variable(argv, FALSE);
@@ -624,8 +608,8 @@
                        if (pkg_full_signature_check(archive_name, &pkg))
                                rc = 1;
                        free(archive_name);
-                       if (!pkg)
-                               archive_read_finish(pkg);
+                       if (pkg != NULL)
+                               archive_read_free(pkg);
                }
                return rc;
        } else if (strcasecmp(argv[0], "x509-sign-package") == 0) {
diff -r f5056367d414 -r 05285b9658ab external/bsd/pkg_install/dist/admin/pkg_admin.1
--- a/external/bsd/pkg_install/dist/admin/pkg_admin.1   Thu Apr 20 13:11:35 2017 +0000
+++ b/external/bsd/pkg_install/dist/admin/pkg_admin.1   Thu Apr 20 13:12:46 2017 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: pkg_admin.1,v 1.1.1.12 2013/04/20 15:26:52 wiz Exp $
+.\"    $NetBSD: pkg_admin.1,v 1.1.1.13 2017/04/20 13:12:47 joerg Exp $
 .\"
 .\" Copyright (c) 1999-2010 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -34,7 +34,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd December 14, 2012
+.Dd December 27, 2014
 .Dt PKG_ADMIN 1
 .Os
 .Sh NAME
@@ -106,13 +106,6 @@
 .Pp
 The following commands are supported:
 .Bl -tag -width indent
-.It Cm add Ar pkg ...
-For each listed package, write the absolute pathnames of the files listed in
-its
-.Pa +CONTENTS
-file together with the package they belong to into the package database.
-This should be used only by
-.Xr pkg_view 1 .
 .It Cm audit Oo Fl es Oc Oo Fl t Ar type Oc Oo Ar pkg Oc ...
 Check the listed installed packages for vulnerabilities.
 If no package is given, check all installed packages.
@@ -187,11 +180,6 @@
 Print the current value of
 .Ar variable
 as used after parsing the configuration file.
-.It Cm delete Ar pkg ...
-For each listed package, remove all file entries in the package database that



Home | Main Index | Thread Index | Old Index