summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrillig <rillig>2006-10-21 11:13:10 +0000
committerrillig <rillig>2006-10-21 11:13:10 +0000
commit8e3b588bb969162234dfa40191482f245c907628 (patch)
tree5e772f75c49dc4215f1b5da0c31a8c7b65206e72
parent766c6f977accdf210b255f15d2893043b595cdc4 (diff)
downloadpkgsrc-8e3b588bb969162234dfa40191482f245c907628.tar.gz
Moved the check whether checkperms(1) exists from load time to run time.
-rw-r--r--mk/check/check-perms.mk22
1 files changed, 10 insertions, 12 deletions
diff --git a/mk/check/check-perms.mk b/mk/check/check-perms.mk
index f5a55c6596e..91337a1ff7c 100644
--- a/mk/check/check-perms.mk
+++ b/mk/check/check-perms.mk
@@ -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+= *) ;;
_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 @@ check-perms:
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