pkgsrc-Changes archive

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

CVS commit: pkgsrc/mk/check



Module Name:    pkgsrc
Committed By:   jperkin
Date:           Wed May  3 13:46:53 UTC 2017

Modified Files:
        pkgsrc/mk/check: check-shlibs-elf.awk check-shlibs.mk

Log Message:
Introduce CHECK_SHLIBS_BLACKLIST which allows users to specify a list of
regexps that will cause the checks to fail if they match resolved RPATHs.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 pkgsrc/mk/check/check-shlibs-elf.awk
cvs rdiff -u -r1.29 -r1.30 pkgsrc/mk/check/check-shlibs.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/mk/check/check-shlibs-elf.awk
diff -u pkgsrc/mk/check/check-shlibs-elf.awk:1.14 pkgsrc/mk/check/check-shlibs-elf.awk:1.15
--- pkgsrc/mk/check/check-shlibs-elf.awk:1.14   Wed Apr 26 11:19:16 2017
+++ pkgsrc/mk/check/check-shlibs-elf.awk        Wed May  3 13:46:53 2017
@@ -1,4 +1,4 @@
-# $NetBSD: check-shlibs-elf.awk,v 1.14 2017/04/26 11:19:16 jperkin Exp $
+# $NetBSD: check-shlibs-elf.awk,v 1.15 2017/05/03 13:46:53 jperkin Exp $
 #
 # Copyright (c) 2007 Joerg Sonnenberger <joerg%NetBSD.org@localhost>.
 # All rights reserved.
@@ -121,13 +121,14 @@ function checkshlib(DSO, needed, rpath, 
        if (!got_rpath)
                nrpath = split(system_rpath, rpath, ":")
        close(cmd)
-       nedirs = split(extradirs, edirs, " ")
        for (p in rpath) {
                if (rpath[p] == wrkdir ||
                    substr(rpath[p], 1, length(wrkdir) + 1) == wrkdir "/") {
                        print DSO ": rpath relative to WRKDIR"
                }
        }
+       nblist = split(blacklist, blist, " ")
+       nedirs = split(extradirs, edirs, " ")
        for (lib in needed) {
                found = 0
                for (p = 1; p <= nrpath; p++) {
@@ -137,6 +138,11 @@ function checkshlib(DSO, needed, rpath, 
                        }
                        if (!libcache[libfile]) {
                                check_pkg(rpath[p] "/" lib)
+                               for (b = 1; b <= nblist; b++) {
+                                       if (match(rpath[p] "/" lib, blist[b])) {
+                                               print DSO ": resolved path " rpath[p] "/" lib " matches blacklist " blist[b]
+                                       }
+                               }
                                for (e = 1; e <= nedirs; e++) {
                                        if (rpath[p] == edirs[e] ||
                                            substr(rpath[p], 1, length(edirs[e]) + 1) == edirs[e] "/") {
@@ -169,6 +175,7 @@ BEGIN {
        readelf = ENVIRON["READELF"]
        wrkdir = ENVIRON["WRKDIR"]
        extradirs = ENVIRON["CHECK_WRKREF_EXTRA_DIRS"]
+       blacklist = ENVIRON["CHECK_SHLIBS_BLACKLIST"]
        pkg_info_cmd = ENVIRON["PKG_INFO_CMD"]
        depends_file = ENVIRON["DEPENDS_FILE"]
        if (readelf == "")

Index: pkgsrc/mk/check/check-shlibs.mk
diff -u pkgsrc/mk/check/check-shlibs.mk:1.29 pkgsrc/mk/check/check-shlibs.mk:1.30
--- pkgsrc/mk/check/check-shlibs.mk:1.29        Sun Apr 10 15:58:02 2016
+++ pkgsrc/mk/check/check-shlibs.mk     Wed May  3 13:46:53 2017
@@ -1,4 +1,4 @@
-# $NetBSD: check-shlibs.mk,v 1.29 2016/04/10 15:58:02 joerg Exp $
+# $NetBSD: check-shlibs.mk,v 1.30 2017/05/03 13:46:53 jperkin Exp $
 #
 # This file verifies that all libraries used by the package can be found
 # at run-time.
@@ -10,6 +10,14 @@
 #
 #      Default value: "yes" for PKG_DEVELOPERs, "no" otherwise.
 #
+# CHECK_SHLIBS_BLACKLIST
+#      A list of regular expressions that will cause the test to fail
+#      if they are matched in the resolved runpath.  For example, set
+#      to ^/usr/lib/lib(crypto|ssl) will ensure that OpenSSL is not
+#      accidentally picked up from the OS.
+#
+#      Default value: empty.
+#
 # Package-settable variables:
 #
 # CHECK_SHLIBS_SKIP
@@ -68,6 +76,9 @@ CHECK_SHLIBS_NATIVE_ENV+=     WRKDIR=${WRKDI
 .  if defined(CHECK_WRKREF) && !empty(CHECK_WRKREF:Mextra)
 CHECK_SHLIBS_NATIVE_ENV+=      CHECK_WRKREF_EXTRA_DIRS=${CHECK_WRKREF_EXTRA_DIRS:Q}
 .  endif
+.  if defined(CHECK_SHLIBS_BLACKLIST)
+CHECK_SHLIBS_NATIVE_ENV+=      CHECK_SHLIBS_BLACKLIST=${CHECK_SHLIBS_BLACKLIST:Q}
+.  endif
 
 _check-shlibs: error-check .PHONY
        @${STEP_MSG} "Checking for missing run-time search paths in ${PKGNAME}"



Home | Main Index | Thread Index | Old Index