From 8e3b588bb969162234dfa40191482f245c907628 Mon Sep 17 00:00:00 2001 From: rillig Date: Sat, 21 Oct 2006 11:13:10 +0000 Subject: Moved the check whether checkperms(1) exists from load time to run time. --- mk/check/check-perms.mk | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'mk') 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 -- cgit v1.2.3