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 merge pkg_install-20201212



details:   https://anonhg.NetBSD.org/src/rev/9da6fc91e987
branches:  trunk
changeset: 979045:9da6fc91e987
user:      wiz <wiz%NetBSD.org@localhost>
date:      Sat Dec 12 11:00:57 2020 +0000

description:
merge pkg_install-20201212

diffstat:

 external/bsd/pkg_install/dist/add/perform.c             |  32 +++++++++++++---
 external/bsd/pkg_install/dist/lib/lib.h                 |   3 +-
 external/bsd/pkg_install/dist/lib/parse-config.c        |   6 ++-
 external/bsd/pkg_install/dist/lib/pkg_install.conf.5.in |   6 ++-
 external/bsd/pkg_install/dist/lib/version.h             |   4 +-
 5 files changed, 39 insertions(+), 12 deletions(-)

diffs (166 lines):

diff -r da21be54802e -r 9da6fc91e987 external/bsd/pkg_install/dist/add/perform.c
--- a/external/bsd/pkg_install/dist/add/perform.c       Sat Dec 12 10:58:13 2020 +0000
+++ b/external/bsd/pkg_install/dist/add/perform.c       Sat Dec 12 11:00:57 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: perform.c,v 1.7 2020/12/02 13:53:50 wiz Exp $  */
+/*     $NetBSD: perform.c,v 1.8 2020/12/12 11:00:57 wiz Exp $  */
 #if HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -6,7 +6,7 @@
 #if HAVE_SYS_CDEFS_H
 #include <sys/cdefs.h>
 #endif
-__RCSID("$NetBSD: perform.c,v 1.7 2020/12/02 13:53:50 wiz Exp $");
+__RCSID("$NetBSD: perform.c,v 1.8 2020/12/12 11:00:57 wiz Exp $");
 
 /*-
  * Copyright (c) 2003 Grant Beattie <grant%NetBSD.org@localhost>
@@ -151,6 +151,15 @@
 {
     int i = 0;
 
+    /*
+     * If the user has set the CHECK_OS_VERSION variable to "no" then skip any
+     * uname version checks and assume they know what they are doing.  This can
+     * be useful on OS where the kernel version is not a good indicator of
+     * userland compatibility, or differs but retains ABI compatibility.
+     */
+    if (strcasecmp(check_os_version, "no") == 0)
+       return 1;
+
     /* returns 1 if host and package operating system match */
     if (strcmp(host, package) == 0)
        return 1;
@@ -1179,6 +1188,10 @@
                        continue;
 
                best_installed = find_best_matching_installed_pkg(p->name, 0);
+               if (best_installed == NULL) {
+                       warnx("Expected dependency %s still missing", p->name);
+                       return -1;
+               }
 
                for (i = 0; i < pkg->dep_length; ++i) {
                        if (strcmp(best_installed, pkg->dependencies[i]) == 0)
@@ -1225,6 +1238,8 @@
 static int
 start_replacing(struct pkg_task *pkg)
 {
+       int result = -1;
+
        if (preserve_meta_data_file(pkg, REQUIRED_BY_FNAME))
                return -1;
 
@@ -1241,14 +1256,19 @@
                        Destdir ? " -P ": "", Destdir ? Destdir : "",
                        pkg->other_version);
        }
-       if (!Fake)
-               fexec_skipempty(BINDIR "/pkg_delete", "-K", pkgdb_get_dir(),
+       if (!Fake) {
+               result = fexec_skipempty(BINDIR "/pkg_delete", "-K", pkgdb_get_dir(),
                    "-p", pkg->prefix,
                    Destdir ? "-P": "", Destdir ? Destdir : "",
                    pkg->other_version, NULL);
+               if (result != 0) {
+                       warnx("command failed: %s/pkg_delete -K %s -p %s %s%s%s",
+                             BINDIR, pkgdb_get_dir(), pkg->prefix, Destdir ? "-P" : " ",
+                             Destdir ? Destdir : "", pkg->other_version);
+               }
+       }
 
-       /* XXX Check return value and do what? */
-       return 0;
+       return result;
 }
 
 static int check_input(const char *line, size_t len)
diff -r da21be54802e -r 9da6fc91e987 external/bsd/pkg_install/dist/lib/lib.h
--- a/external/bsd/pkg_install/dist/lib/lib.h   Sat Dec 12 10:58:13 2020 +0000
+++ b/external/bsd/pkg_install/dist/lib/lib.h   Sat Dec 12 11:00:57 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lib.h,v 1.10 2020/12/02 13:53:50 wiz Exp $ */
+/* $NetBSD: lib.h,v 1.11 2020/12/12 11:00:57 wiz Exp $ */
 
 /* from FreeBSD Id: lib.h,v 1.25 1997/10/08 07:48:03 charnier Exp */
 
@@ -447,6 +447,7 @@
 extern const char *certs_packages;
 extern const char *certs_pkg_vulnerabilities;
 extern const char *check_eol;
+extern const char *check_os_version;
 extern const char *check_vulnerabilities;
 extern const char *config_file;
 extern const char *config_pkg_dbdir;
diff -r da21be54802e -r 9da6fc91e987 external/bsd/pkg_install/dist/lib/parse-config.c
--- a/external/bsd/pkg_install/dist/lib/parse-config.c  Sat Dec 12 10:58:13 2020 +0000
+++ b/external/bsd/pkg_install/dist/lib/parse-config.c  Sat Dec 12 11:00:57 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: parse-config.c,v 1.3 2019/04/06 00:05:47 sevan Exp $   */
+/*     $NetBSD: parse-config.c,v 1.4 2020/12/12 11:00:57 wiz Exp $     */
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -7,7 +7,7 @@
 #if HAVE_SYS_CDEFS_H
 #include <sys/cdefs.h>
 #endif
-__RCSID("$NetBSD: parse-config.c,v 1.3 2019/04/06 00:05:47 sevan Exp $");
+__RCSID("$NetBSD: parse-config.c,v 1.4 2020/12/12 11:00:57 wiz Exp $");
 
 /*-
  * Copyright (c) 2008, 2009 Joerg Sonnenberger <joerg%NetBSD.org@localhost>.
@@ -66,6 +66,7 @@
 const char *certs_packages;
 const char *certs_pkg_vulnerabilities;
 const char *check_eol = "yes";
+const char *check_os_version = "yes";
 const char *check_vulnerabilities;
 static const char *config_cache_connections;
 static const char *config_cache_connections_host;
@@ -100,6 +101,7 @@
        { "CERTIFICATE_CHAIN", &cert_chain_file },
        { "CHECK_LICENSE", &do_license_check },
        { "CHECK_END_OF_LIFE", &check_eol },
+       { "CHECK_OS_VERSION", &check_os_version },
        { "CHECK_VULNERABILITIES", &check_vulnerabilities },
        { "DEFAULT_ACCEPTABLE_LICENSES", &default_acceptable_licenses },
        { "GPG", &gpg_cmd },
diff -r da21be54802e -r 9da6fc91e987 external/bsd/pkg_install/dist/lib/pkg_install.conf.5.in
--- a/external/bsd/pkg_install/dist/lib/pkg_install.conf.5.in   Sat Dec 12 10:58:13 2020 +0000
+++ b/external/bsd/pkg_install/dist/lib/pkg_install.conf.5.in   Sat Dec 12 11:00:57 2020 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: pkg_install.conf.5.in,v 1.3 2017/04/20 13:18:23 joerg Exp $
+.\"    $NetBSD: pkg_install.conf.5.in,v 1.4 2020/12/12 11:00:57 wiz Exp $
 .\"
 .\" Copyright (c) 2008, 2009, 2012 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -93,6 +93,10 @@
 During vulnerability checks, consider packages that have reached end-of-life
 as vulnerable.
 This option is enabled by default.
+.It Dv CHECK_OS_VERSION
+If "no", pkg_add will not warn if the host OS version does not exactly match
+the OS version the package was built on.
+The default is "yes".
 .It Dv CHECK_OSABI
 If "no", osabi package does not check OS version.
 The default is "yes".
diff -r da21be54802e -r 9da6fc91e987 external/bsd/pkg_install/dist/lib/version.h
--- a/external/bsd/pkg_install/dist/lib/version.h       Sat Dec 12 10:58:13 2020 +0000
+++ b/external/bsd/pkg_install/dist/lib/version.h       Sat Dec 12 11:00:57 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: version.h,v 1.17 2020/12/05 16:21:26 wiz Exp $ */
+/*     $NetBSD: version.h,v 1.18 2020/12/12 11:00:57 wiz Exp $ */
 
 /*
  * Copyright (c) 2001 Thomas Klausner.  All rights reserved.
@@ -27,6 +27,6 @@
 #ifndef _INST_LIB_VERSION_H_
 #define _INST_LIB_VERSION_H_
 
-#define PKGTOOLS_VERSION 20201205
+#define PKGTOOLS_VERSION 20201212
 
 #endif /* _INST_LIB_VERSION_H_ */



Home | Main Index | Thread Index | Old Index