Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Jan 2014 14:16:30 +0000 (UTC)
From:      Mathieu Arnold <mat@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r341573 - in head/Mk: . Scripts
Message-ID:  <201401281416.s0SEGUXa007500@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mat
Date: Tue Jan 28 14:16:30 2014
New Revision: 341573
URL: http://svnweb.freebsd.org/changeset/ports/341573
QAT: https://qat.redports.org/buildarchive/r341573/

Log:
  Greatly enhance makeplist to replace all it can find in PLIST_SUB.
  
  With hat:	portmgr
  Sponsored by:	Absolight

Modified:
  head/Mk/Scripts/check-stagedir.sh
  head/Mk/bsd.stage.mk

Modified: head/Mk/Scripts/check-stagedir.sh
==============================================================================
--- head/Mk/Scripts/check-stagedir.sh	Tue Jan 28 14:15:54 2014	(r341572)
+++ head/Mk/Scripts/check-stagedir.sh	Tue Jan 28 14:16:30 2014	(r341573)
@@ -24,7 +24,7 @@ esac
 # validate environment
 envfault=
 for i in STAGEDIR PREFIX LOCALBASE WRKDIR WRKSRC MTREE_FILE \
-    TMPPLIST DATADIR DOCSDIR EXAMPLESDIR
+    TMPPLIST DOCSDIR EXAMPLESDIR PLIST_SUB
 do
     if ! ( eval ": \${${i}?}" ) 2>/dev/null ; then
 		envfault="${envfault}${envfault:+" "}${i}"
@@ -98,14 +98,27 @@ fi
 	done
 } > ${WRKDIR}/.mtree
 
+for i in $PLIST_SUB
+do
+	echo $i
+done | awk -F= '{print length($2), $1, $2 | "sort -nr" }' | while read l k v
+do
+	if [ $l -ne 0 ]
+	then
+		echo "s,${v},%%${k}%%,g;"
+	fi
+done > ${WRKDIR}/.plist_sub
+
+sed_plist_sub=`cat ${WRKDIR}/.plist_sub`
+
 ### HANDLE FILES
 find ${STAGEDIR} -type f -o -type l | sort | sed -e "s,${STAGEDIR},," >${WRKDIR}/.staged-files
 comm -13 ${WRKDIR}/.plist-files ${WRKDIR}/.staged-files \
 	| sed \
 	-e "s,${DOCSDIR},%%PORTDOCS%%%%DOCSDIR%%,g" \
 	-e "s,${EXAMPLESDIR},%%PORTEXAMPLES%%%%EXAMPLESDIR%%,g" \
-	-e "s,${DATADIR},%%DATADIR%%,g" \
-	-e "s,${PREFIX}/,,g" | grep -v "^share/licenses" || [ $? = 1 ]
+	-e "s,${PREFIX}/,,g" \
+	-e "${sed_plist_sub}" | grep -v "^share/licenses" || [ $? = 1 ]
 
 ### HANDLE DIRS
 cat ${WRKDIR}/.plist-dirs-unsorted ${WRKDIR}/.mtree | sort -u >${WRKDIR}/.traced-dirs
@@ -115,6 +128,6 @@ comm -13 ${WRKDIR}/.traced-dirs ${WRKDIR
 	-e 's,^,@dirrmtry ,' \
 	-e "s,\(.*\)${DOCSDIR},%%PORTDOCS%%\1%%DOCSDIR%%,g" \
 	-e "s,\(.*\)${EXAMPLESDIR},%%PORTEXAMPLES%%\1%%EXAMPLESDIR%%,g" \
-	-e "s,${DATADIR},%%DATADIR%%,g" \
 	-e "s,${PREFIX}/,,g" \
+	-e "${sed_plist_sub}" \
 	-e 's,@dirrmtry \(/.*\),@unexec rmdir >/dev/null 2>\&1 \1 || :,' | grep -v "^@dirrmtry share/licenses" || [ $? = 1 ]

Modified: head/Mk/bsd.stage.mk
==============================================================================
--- head/Mk/bsd.stage.mk	Tue Jan 28 14:15:54 2014	(r341572)
+++ head/Mk/bsd.stage.mk	Tue Jan 28 14:16:30 2014	(r341573)
@@ -24,9 +24,9 @@ CO_ENV+=	STAGEDIR=${STAGEDIR} \
 		WRKSRC=${WRKSRC} \
 		MTREE_FILE=${MTREE_FILE} \
 		TMPPLIST=${TMPPLIST} \
-		DATADIR=${DATADIR} \
 		DOCSDIR=${DOCSDIR} \
-		EXAMPLESDIR=${EXAMPLESDIR}
+		EXAMPLESDIR=${EXAMPLESDIR} \
+		PLIST_SUB="${PLIST_SUB:NPREFIX=*:NLOCALBASE=*:NOSREL=*:NLIB32DIR=*:NDOCSDIR=*:NEXAMPLESDIR=*}"
 
 .if !target(stage-dir)
 stage-dir:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201401281416.s0SEGUXa007500>