aboutsummaryrefslogtreecommitdiffstats
path: root/Mk
diff options
context:
space:
mode:
authorbdrewery <bdrewery@FreeBSD.org>2014-04-17 11:47:54 +0800
committerbdrewery <bdrewery@FreeBSD.org>2014-04-17 11:47:54 +0800
commitaa5543d2ca83b4f0c163853dee48252a2fdb0706 (patch)
tree0b2da37a442e9fab61ab86d181de34b0c5e7e903 /Mk
parent6b4e0221d2302be074254937c7944e304e08a19f (diff)
downloadfreebsd-ports-gnome-aa5543d2ca83b4f0c163853dee48252a2fdb0706.tar.gz
freebsd-ports-gnome-aa5543d2ca83b4f0c163853dee48252a2fdb0706.tar.zst
freebsd-ports-gnome-aa5543d2ca83b4f0c163853dee48252a2fdb0706.zip
- Add PLIST_SUB_SED which is used to replace absolute paths with PLIST_SUB'd
paths. This will be used for check-stagedir.sh and poudriere/tinderbox leftover handling. This version handles several flaws of other implementations: - Remove VARS that are too generic - Remove empty values - Remove @comment values - Remove quotes - Replace . with \. for later sed(1) usage - Handle values with spaces - By default only use values 2+ characters long. Let this be overridable with PLIST_SUB_SED_MIN. Reviewed by: antoine, mat With hat: portmgr
Diffstat (limited to 'Mk')
-rw-r--r--Mk/bsd.port.mk9
1 files changed, 9 insertions, 0 deletions
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
index 79ed61f57c46..4d92d60238b7 100644
--- a/Mk/bsd.port.mk
+++ b/Mk/bsd.port.mk
@@ -1614,6 +1614,15 @@ PLIST_SUB+= OSREL=${OSREL} PREFIX=%D LOCALBASE=${LOCALBASE}
SUB_LIST+= PREFIX=${PREFIX} LOCALBASE=${LOCALBASE} \
DATADIR=${DATADIR} DOCSDIR=${DOCSDIR} EXAMPLESDIR=${EXAMPLESDIR} \
WWWDIR=${WWWDIR} ETCDIR=${ETCDIR}
+# This is used for check-stagedir.sh and check_leftover.sh to replace
+# directories/files with PLIST_SUB %%KEYS%%.
+# Remove VARS that are too generic
+# Remove empty values
+# Remove @comment values
+# Remove quotes
+# Replace . with \. for later sed(1) usage
+PLIST_SUB_SED_MIN?= 2
+PLIST_SUB_SED?= ${PLIST_SUB:C/.*=.{1,${PLIST_SUB_SED_MIN}}$//g:NEXTRACT_SUFX=*:NOSREL=*:NLIB32DIR=*:NPREFIX=*:NLOCALBASE=*:N*="":N*="@comment*:C/(.*)="?([^"]*)"?/s!\2!%%\1%%!g;/g:C/\./\\./g}
PLIST_REINPLACE+= dirrmtry stopdaemon rmtry
PLIST_REINPLACE_DIRRMTRY=s!^@dirrmtry \(.*\)!@unexec rmdir "%D/\1" 2>/dev/null || true!