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 pkg_install: Introduce supp...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/5a546bf0c3fa
branches:  trunk
changeset: 443379:5a546bf0c3fa
user:      jperkin <jperkin%pkgsrc.org@localhost>
date:      Fri Dec 11 10:06:53 2020 +0000

description:
pkg_install: Introduce support for CHECK_OS_VERSION.

When set to "no", pkg_add will not issue a warning if the host OS version does
not exactly match the OS version the package was built on.  This can be useful
on many OS where the kernel release version has nothing to do with userland
compatibility, or where it may differ without being ABI incompatible.

Ultimately it would be ideal if the version checks were smart enough across all
our supported OS to not need this, but until then this is useful for users who
know what they're doing.

Bump version to 20201211.

diffstat:

 pkgtools/pkg_install/files/add/perform.c               |  13 +++++++++++--
 pkgtools/pkg_install/files/lib/lib.h                   |   3 ++-
 pkgtools/pkg_install/files/lib/parse-config.c          |   6 ++++--
 pkgtools/pkg_install/files/lib/pkg_install.conf.5.in   |   6 +++++-
 pkgtools/pkg_install/files/lib/pkg_install.conf.cat.in |   5 +++++
 pkgtools/pkg_install/files/lib/version.h               |   4 ++--
 6 files changed, 29 insertions(+), 8 deletions(-)

diffs (137 lines):

diff -r 3d19a142b20c -r 5a546bf0c3fa pkgtools/pkg_install/files/add/perform.c
--- a/pkgtools/pkg_install/files/add/perform.c  Fri Dec 11 10:02:16 2020 +0000
+++ b/pkgtools/pkg_install/files/add/perform.c  Fri Dec 11 10:06:53 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: perform.c,v 1.114 2020/12/06 17:23:09 wiz Exp $        */
+/*     $NetBSD: perform.c,v 1.115 2020/12/11 10:06:53 jperkin 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.114 2020/12/06 17:23:09 wiz Exp $");
+__RCSID("$NetBSD: perform.c,v 1.115 2020/12/11 10:06:53 jperkin 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;
diff -r 3d19a142b20c -r 5a546bf0c3fa pkgtools/pkg_install/files/lib/lib.h
--- a/pkgtools/pkg_install/files/lib/lib.h      Fri Dec 11 10:02:16 2020 +0000
+++ b/pkgtools/pkg_install/files/lib/lib.h      Fri Dec 11 10:06:53 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lib.h,v 1.71 2020/12/02 12:10:38 wiz Exp $ */
+/* $NetBSD: lib.h,v 1.72 2020/12/11 10:06:53 jperkin 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 3d19a142b20c -r 5a546bf0c3fa pkgtools/pkg_install/files/lib/parse-config.c
--- a/pkgtools/pkg_install/files/lib/parse-config.c     Fri Dec 11 10:02:16 2020 +0000
+++ b/pkgtools/pkg_install/files/lib/parse-config.c     Fri Dec 11 10:06:53 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: parse-config.c,v 1.16 2019/04/05 21:36:35 sevan Exp $  */
+/*     $NetBSD: parse-config.c,v 1.17 2020/12/11 10:06:53 jperkin 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.16 2019/04/05 21:36:35 sevan Exp $");
+__RCSID("$NetBSD: parse-config.c,v 1.17 2020/12/11 10:06:53 jperkin 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 3d19a142b20c -r 5a546bf0c3fa pkgtools/pkg_install/files/lib/pkg_install.conf.5.in
--- a/pkgtools/pkg_install/files/lib/pkg_install.conf.5.in      Fri Dec 11 10:02:16 2020 +0000
+++ b/pkgtools/pkg_install/files/lib/pkg_install.conf.5.in      Fri Dec 11 10:06:53 2020 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: pkg_install.conf.5.in,v 1.21 2014/11/05 14:40:01 prlw1 Exp $
+.\"    $NetBSD: pkg_install.conf.5.in,v 1.22 2020/12/11 10:06:53 jperkin 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 3d19a142b20c -r 5a546bf0c3fa pkgtools/pkg_install/files/lib/pkg_install.conf.cat.in
--- a/pkgtools/pkg_install/files/lib/pkg_install.conf.cat.in    Fri Dec 11 10:02:16 2020 +0000
+++ b/pkgtools/pkg_install/files/lib/pkg_install.conf.cat.in    Fri Dec 11 10:06:53 2020 +0000
@@ -60,6 +60,11 @@
              During vulnerability checks, consider packages that have reached
              end-of-life as vulnerable.  This option is enabled by default.
 
+     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".
+
      CHECK_OSABI
              If "no", osabi package does not check OS version.  The default is
              "yes".
diff -r 3d19a142b20c -r 5a546bf0c3fa pkgtools/pkg_install/files/lib/version.h
--- a/pkgtools/pkg_install/files/lib/version.h  Fri Dec 11 10:02:16 2020 +0000
+++ b/pkgtools/pkg_install/files/lib/version.h  Fri Dec 11 10:06:53 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: version.h,v 1.182 2020/12/06 17:23:09 wiz Exp $        */
+/*     $NetBSD: version.h,v 1.183 2020/12/11 10:06:53 jperkin 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 20201206
+#define PKGTOOLS_VERSION 20201211
 
 #endif /* _INST_LIB_VERSION_H_ */



Home | Main Index | Thread Index | Old Index