aboutsummaryrefslogtreecommitdiffstats
path: root/Mk
diff options
context:
space:
mode:
authorBryan Drewery <bdrewery@FreeBSD.org>2014-04-17 11:47:54 +0800
committerBryan Drewery <bdrewery@FreeBSD.org>2014-04-17 11:47:54 +0800
commitc9e5403827c70cae31384b92bac7d5525232e056 (patch)
tree0b2da37a442e9fab61ab86d181de34b0c5e7e903 /Mk
parentdddc152f090144cadaf6fb1f28c5acec7d52eb20 (diff)
downloadfreebsd-ports-gnome-c9e5403827c70cae31384b92bac7d5525232e056.tar.gz
freebsd-ports-gnome-c9e5403827c70cae31384b92bac7d5525232e056.tar.zst
freebsd-ports-gnome-c9e5403827c70cae31384b92bac7d5525232e056.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!