summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2006-10-21 11:13:10 +0000
committerrillig <rillig@pkgsrc.org>2006-10-21 11:13:10 +0000
commitce502552c2c6ce9687629edc1c07e1c4fa3d9970 (patch)
tree5e772f75c49dc4215f1b5da0c31a8c7b65206e72 /mk
parent5818ceb381e46839a9d0a0a02c147000217d4e44 (diff)
downloadpkgsrc-ce502552c2c6ce9687629edc1c07e1c4fa3d9970.tar.gz
Moved the check whether checkperms(1) exists from load time to run time.
Diffstat (limited to 'mk')
-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