pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk/check Moved the check whether checkperms(1) exists ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/d873de68efb1
branches:  trunk
changeset: 520422:d873de68efb1
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sat Oct 21 11:13:10 2006 +0000

description:
Moved the check whether checkperms(1) exists from load time to run time.

diffstat:

 mk/check/check-perms.mk |  22 ++++++++++------------
 1 files changed, 10 insertions(+), 12 deletions(-)

diffs (50 lines):

diff -r 2bef76ac4de0 -r d873de68efb1 mk/check/check-perms.mk
--- a/mk/check/check-perms.mk   Sat Oct 21 11:11:34 2006 +0000
+++ b/mk/check/check-perms.mk   Sat Oct 21 11:13:10 2006 +0000
@@ -1,15 +1,15 @@
-# $NetBSD: check-perms.mk,v 1.1 2006/10/13 06:32:15 rillig Exp $
+# $NetBSD: check-perms.mk,v 1.2 2006/10/21 11:13:10 rillig Exp $
 #
 # This file checks that after installation of a package, all files and
 # directories of that package have sensible permissions set.
 #
-# The following variables may be set by a package:
-#
-# The following variables may be set by the pkgsrc user in mk.conf:
+# User-settable variables:
 #
 # CHECK_PERMS: YesNo (default: yes for PKG_DEVELOPER, no otherwise)
 #      Specifies whether the permissions check should be run at all.
 #
+# Package-settable variables:
+#
 # CHECK_PERMS_SKIP: List of PathMask (default: empty)
 #      A list of patterns (like man/*) that should be excluded from the
 #      check. Note that a * in a pattern also matches a slash in a
@@ -46,11 +46,14 @@
 _CHECK_PERMS_SKIP_FILTER+=     esac
 
 .PHONY: check-perms
-.if exists(${_CHECK_PERMS_CMD})
 check-perms:
        @${STEP_MSG} "Checking file permissions in ${PKGNAME}"
-       ${_PKG_SILENT}${_PKG_DEBUG}                                     \
-       set -e;                                                         \
+       ${_PKG_SILENT}${_PKG_DEBUG} set -eu;                            \
+       if [ ! -x ${_CHECK_PERMS_CMD:Q}"" ]; then                       \
+               ${WARNING_MSG} "[check-perms.mk] Skipping file permissions check."; \
+               ${WARNING_MSG} "[check-perms.mk] Install sysutils/checkperms to enable this check."; \
+               exit 0;                                                 \
+       fi;                                                             \
        ${PKG_FILELIST_CMD}                                             \
        | sort                                                          \
        | sed -e 's,\\,\\\\,g'                                          \
@@ -60,8 +63,3 @@
          done                                                          \
        | awk ${_CHECK_PERMS_GETDIRS_AWK:Q}                             \
        | ${_CHECK_PERMS_CMD}
-.else
-check-perms:
-       @${WARNING_MSG} "[check-perms.mk] Skipping file permissions check."
-       @${WARNING_MSG} "[check-perms.mk] Install sysutils/checkperms to enable this check."
-.endif



Home | Main Index | Thread Index | Old Index