Received: by mail.netbsd.org (Postfix, from userid 605) id 8717E84D2D; Sun, 21 Jan 2024 02:12:22 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id B3E4884D08 for ; Sun, 21 Jan 2024 02:12:21 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([127.0.0.1]) by localhost (mail.netbsd.org [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id uLvcKZHrmbcB for ; Sun, 21 Jan 2024 02:12:21 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.NetBSD.org [IPv6:2001:470:a085:999:28c:faff:fe03:5984]) by mail.netbsd.org (Postfix) with ESMTP id 1B5E184CCC for ; Sun, 21 Jan 2024 02:12:21 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id 0C957FA42; Sun, 21 Jan 2024 02:12:21 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_1705803141298350" MIME-Version: 1.0 Date: Sun, 21 Jan 2024 02:12:21 +0000 From: "Roland Illig" Subject: CVS commit: pkgsrc/mk/check To: pkgsrc-changes@NetBSD.org Reply-To: rillig@netbsd.org X-Mailer: log_accum Message-Id: <20240121021221.0C957FA42@cvs.NetBSD.org> Sender: pkgsrc-changes-owner@NetBSD.org List-Id: Precedence: bulk List-Unsubscribe: This is a multi-part message in MIME format. --_----------=_1705803141298350 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Module Name: pkgsrc Committed By: rillig Date: Sun Jan 21 02:12:20 UTC 2024 Modified Files: pkgsrc/mk/check: check-files.mk Log Message: mk/check-files: allow detection of packages that install outside PREFIX An example package that does this is textproc/p5-Publican, many other packages are fine. To generate a diff of this commit: cvs rdiff -u -r1.45 -r1.46 pkgsrc/mk/check/check-files.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. --_----------=_1705803141298350 Content-Disposition: inline Content-Length: 3110 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii Modified files: Index: pkgsrc/mk/check/check-files.mk diff -u pkgsrc/mk/check/check-files.mk:1.45 pkgsrc/mk/check/check-files.mk:1.46 --- pkgsrc/mk/check/check-files.mk:1.45 Sun Jan 21 00:34:26 2024 +++ pkgsrc/mk/check/check-files.mk Sun Jan 21 02:12:20 2024 @@ -1,4 +1,4 @@ -# $NetBSD: check-files.mk,v 1.45 2024/01/21 00:34:26 rillig Exp $ +# $NetBSD: check-files.mk,v 1.46 2024/01/21 02:12:20 rillig Exp $ # # This file checks that the list of installed files matches the PLIST. # For that purpose it records the file list of LOCALBASE before and @@ -16,6 +16,10 @@ # When set to "yes", VARBASE and PKG_SYSCONFDIR are checked in # addition to LOCALBASE. # +# CHECK_FILES_ONLY_PREFIX +# When set to "yes", the only directory below DESTDIR that may be +# modified during installation is PREFIX itself. +# # Package-settable variables: # # CHECK_FILES_SKIP @@ -26,7 +30,8 @@ # _VARGROUPS+= check-files -_USER_VARS.check-files= CHECK_FILES CHECK_FILES_STRICT +_USER_VARS.check-files= \ + CHECK_FILES CHECK_FILES_STRICT CHECK_FILES_ONLY_PREFIX _PKG_VARS.check-files= CHECK_FILES_SUPPORTED CHECK_FILES_SKIP _USE_VARS.check-files= \ DESTDIR PREFIX PKG_SYSCONFDIR VARBASE PKG_DBDIR DISTDIR PACKAGES \ @@ -40,8 +45,9 @@ _LISTED_VARS.check-files= MAKE_DIRS MAKE _SORTED_VARS.check-files= CHECK_FILES_SKIP -CHECK_FILES?= yes -CHECK_FILES_STRICT?= no +CHECK_FILES?= yes +CHECK_FILES_STRICT?= no +CHECK_FILES_ONLY_PREFIX?= no # Info index files updated when a new info file is added. .if defined(INFO_FILES) @@ -145,12 +151,17 @@ _CHECK_FILES_ERRMSG.varbase= ${ERROR_DIR _CHECK_FILES_PRE.varbase= ${WRKDIR}/.check-files.varbase.pre _CHECK_FILES_POST.varbase= ${WRKDIR}/.check-files.varbase.post +_CHECK_FILES_ERRMSG.only-prefix= ${ERROR_DIR}/check-files-only-prefix + _CHECK_FILES_ERRMSGS= # empty _CHECK_FILES_ERRMSGS+= ${_CHECK_FILES_ERRMSG.prefix} .if ${CHECK_FILES_STRICT:tl} != no _CHECK_FILES_ERRMSGS+= ${_CHECK_FILES_ERRMSG.sysconfdir} _CHECK_FILES_ERRMSGS+= ${_CHECK_FILES_ERRMSG.varbase} .endif +.if ${CHECK_FILES_ONLY_PREFIX:tl} == yes +_CHECK_FILES_ERRMSGS+= ${_CHECK_FILES_ERRMSG.only-prefix} +.endif ########################################################################### # _CHECK_FILES_PRE holds the list of targets that are built as part of @@ -378,6 +389,17 @@ ${_CHECK_FILES_ERRMSG.varbase}: \ ${GREP} '^+[^+]' | ${SED} "s|^+| |"; \ fi > ${.TARGET} +${_CHECK_FILES_ERRMSG.only-prefix}: + ${RUN} \ + files=${WRKDIR}/.check-files-only-prefix; \ + ${FIND} ${DESTDIR} \( -type f -o -type l \) -print \ + | ${GREP} -v '^${DESTDIR}${PREFIX}/' > "$$files" || :; \ + if [ -s "$$files" ]; then \ + ${ECHO} "************************************************************"; \ + ${ECHO} "The package has installed files outside ${PREFIX}:"; \ + ${SED} -e 's,^, ,' "$$files"; \ + fi > ${.TARGET} + ########################################################################### # check-files-clean removes the state files related to the "check-files" # target so that the check-files-{pre,post} targets may be re-run. --_----------=_1705803141298350--