summaryrefslogtreecommitdiff
path: root/mk/check
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2006-11-12 00:44:24 +0000
committerrillig <rillig@pkgsrc.org>2006-11-12 00:44:24 +0000
commit918d65cc093fc4d6b640d2c2b912268851edabc3 (patch)
tree6f6ff09cba6d13b961d4791e89b21e8d1b0a45e9 /mk/check
parentb7ceab86aace099e0cccb8547253e9c1e1089df1 (diff)
downloadpkgsrc-918d65cc093fc4d6b640d2c2b912268851edabc3.tar.gz
Added the CHECK_PERMS_AUTOFIX variable, which allows packages to say
that the file permissions should be fixed automatically. Moved the test whether this check should be enabled from ../install/install.mk to here. Renamed the target from check-perms to _check-perms.
Diffstat (limited to 'mk/check')
-rw-r--r--mk/check/check-perms.mk25
1 files changed, 17 insertions, 8 deletions
diff --git a/mk/check/check-perms.mk b/mk/check/check-perms.mk
index 941139464bf..908a0f2625a 100644
--- a/mk/check/check-perms.mk
+++ b/mk/check/check-perms.mk
@@ -1,4 +1,4 @@
-# $NetBSD: check-perms.mk,v 1.3 2006/11/02 02:44:17 rillig Exp $
+# $NetBSD: check-perms.mk,v 1.4 2006/11/12 00:44:24 rillig Exp $
#
# This file checks that after installation of a package, all files and
# directories of that package have sensible permissions set.
@@ -15,6 +15,9 @@
# check. Note that a * in a pattern also matches a slash in a
# pathname.
#
+# CHECK_PERMS_AUTOFIX: YesNo
+# If set to yes, any unusual permissions are fixed automatically.
+#
.if defined(PKG_DEVELOPER)
CHECK_PERMS?= yes
@@ -22,11 +25,18 @@ CHECK_PERMS?= yes
CHECK_PERMS?= no
.endif
-CHECK_PERMS_SKIP?= # none
+CHECK_PERMS_SKIP?= # none
+CHECK_PERMS_AUTOFIX?= no
-#.if !empty(CHECK_PERMS:M[Yy][Ee][Ss])
-#_POST_INSTALL_CHECKS+= check-perms
-#.endif
+.if !empty(CHECK_PERMS_AUTOFIX:M[Yy][Ee][Ss])
+_CHECK_PERMS_FLAGS= -cff
+.else
+_CHECK_PERMS_FLAGS= -c
+.endif
+
+.if !empty(CHECK_PERMS:M[Yy][Ee][Ss])
+privileged-install-hook: _check-perms
+.endif
_CHECK_PERMS_CMD= ${LOCALBASE}/bin/checkperms
_CHECK_PERMS_GETDIRS_AWK= \
@@ -41,8 +51,7 @@ _CHECK_PERMS_GETDIRS_AWK= \
} \
}
-.PHONY: check-perms
-check-perms:
+_check-perms: .PHONY
@${STEP_MSG} "Checking file permissions in ${PKGNAME}"
${_PKG_SILENT}${_PKG_DEBUG} set -eu; \
${PKG_INFO} -qe "checkperms>=1.1" \
@@ -62,4 +71,4 @@ check-perms:
printf "%s\\n" "$$file"; \
done \
| awk ${_CHECK_PERMS_GETDIRS_AWK:Q} \
- | ${_CHECK_PERMS_CMD} -c
+ | ${_CHECK_PERMS_CMD} ${_CHECK_PERMS_FLAGS}