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:   rillig
Date:           Fri Mar 13 08:04:08 UTC 2020

Modified Files:
        pkgsrc/mk/check: check-perms.mk check-portability.mk
            check-portability.sh
Removed Files:
        pkgsrc/mk/check: check-portability.awk

Log Message:
mk/check/check-perms: allow packages to skip the check completely

When all files are skipped, the tool dependency is not added as well.
This allows packages to skip the check without defining the user-settable
variable CHECK_PERMS.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 pkgsrc/mk/check/check-perms.mk
cvs rdiff -u -r1.9 -r0 pkgsrc/mk/check/check-portability.awk
cvs rdiff -u -r1.12 -r1.13 pkgsrc/mk/check/check-portability.mk
cvs rdiff -u -r1.17 -r1.18 pkgsrc/mk/check/check-portability.sh

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-perms.mk
diff -u pkgsrc/mk/check/check-perms.mk:1.21 pkgsrc/mk/check/check-perms.mk:1.22
--- pkgsrc/mk/check/check-perms.mk:1.21 Tue Oct  1 21:56:11 2019
+++ pkgsrc/mk/check/check-perms.mk      Fri Mar 13 08:04:08 2020
@@ -1,4 +1,4 @@
-# $NetBSD: check-perms.mk,v 1.21 2019/10/01 21:56:11 rillig Exp $
+# $NetBSD: check-perms.mk,v 1.22 2020/03/13 08:04:08 rillig Exp $
 #
 # This file checks that after installation of a package, all files and
 # directories of that package have sensible permissions set.
@@ -53,7 +53,7 @@ _CHECK_PERMS_FLAGS=   -cff
 _CHECK_PERMS_FLAGS=    -c
 .endif
 
-.if !empty(CHECK_PERMS:M[Yy][Ee][Ss])
+.if ${CHECK_PERMS:tl} == yes && ${CHECK_PERMS_SKIP} != "*"
 TOOL_DEPENDS+= checkperms>=1.1:../../sysutils/checkperms
 
 privileged-install-hook: _check-perms

Index: pkgsrc/mk/check/check-portability.mk
diff -u pkgsrc/mk/check/check-portability.mk:1.12 pkgsrc/mk/check/check-portability.mk:1.13
--- pkgsrc/mk/check/check-portability.mk:1.12   Fri Mar 13 06:31:43 2020
+++ pkgsrc/mk/check/check-portability.mk        Fri Mar 13 08:04:08 2020
@@ -1,40 +1,39 @@
-# $NetBSD: check-portability.mk,v 1.12 2020/03/13 06:31:43 rillig Exp $
+# $NetBSD: check-portability.mk,v 1.13 2020/03/13 08:04:08 rillig Exp $
 #
-# This file contains some checks that are applied to the configure
-# scripts to check for certain constructs that are known to cause
-# problems on some platforms. The detailed checks are in
-# check-portability.sh.
+# This file checks that the extracted shell programs don't contain
+# bashisms and other constructs that only work on some platforms.
 #
 # User-settable variables:
 #
 # CHECK_PORTABILITY
-#      Whether to enable some portability checks for the configure
-#      scripts before they are run.
+#      Whether to enable the portability checks.
 #
 #      Default value: yes for PKG_DEVELOPERs, no otherwise.
 #
 # Package-settable variables:
 #
 # CHECK_PORTABILITY_SKIP
-#      The list of files that should be skipped in the portability
-#      check.
+#      The shell patterns that should not be checked.
+#      Note that a * in a pattern also matches a slash in a pathname.
 #
 #      Default value: ${REPLACE_BASH}
-#      Example: debian/*
+#      Examples: debian/* test/* *.bash
 
 _VARGROUPS+=                   check-portability
 _USER_VARS.check-portability=  CHECK_PORTABILITY
 _PKG_VARS.check-portability=   CHECK_PORTABILITY_SKIP
 
-.if ${PKG_DEVELOPER:Uno} != "no"
+.if ${PKG_DEVELOPER:Uno} != no
 CHECK_PORTABILITY?=            yes
 .endif
 CHECK_PORTABILITY?=            no
 CHECK_PORTABILITY_SKIP?=       ${REPLACE_BASH}
 
 .if ${CHECK_PORTABILITY:tl} == yes && ${CHECK_PORTABILITY_SKIP} != "*"
+TOOL_DEPENDS+= check-portability>=19.4.1:../../pkgtools/check-portability
 pre-configure-checks-hook: _check-portability
 .endif
+
 .PHONY: _check-portability
 _check-portability:
        @${STEP_MSG} "Checking for portability problems in extracted files"

Index: pkgsrc/mk/check/check-portability.sh
diff -u pkgsrc/mk/check/check-portability.sh:1.17 pkgsrc/mk/check/check-portability.sh:1.18
--- pkgsrc/mk/check/check-portability.sh:1.17   Thu Mar 12 19:09:41 2020
+++ pkgsrc/mk/check/check-portability.sh        Fri Mar 13 08:04:08 2020
@@ -1,4 +1,4 @@
-# $NetBSD: check-portability.sh,v 1.17 2020/03/12 19:09:41 rillig Exp $
+# $NetBSD: check-portability.sh,v 1.18 2020/03/13 08:04:08 rillig Exp $
 #
 # This program checks all files in the current directory and any
 # subdirectories for portability issues that are likely to result in
@@ -20,18 +20,8 @@ cs_setprogname "$0"
 
 # usage: check_shell <fname>
 check_shell() {
-       env \
-               CK_FNAME="$1" \
-               CK_PROGNAME="check-portability.awk" \
-               awk     -f "$checkdir/check-subr.awk" \
-                       -f "$checkdir/check-portability.awk" \
-               < "$1" 1>&2 \
+       ${PREFIX}/bin/check-portability "$1" 1>&2 \
        || cs_exitcode=1
-
-       if test -f "${PREFIX}/bin/check-portability"; then
-               ${PREFIX}/bin/check-portability "$1" 1>&2 \
-               || cs_exitcode=1
-       fi
 }
 
 find ./* -type f -print 2>/dev/null \



Home | Main Index | Thread Index | Old Index