Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Apr 2014 14:42:45 +0000 (UTC)
From:      Bryan Drewery <bdrewery@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r351479 - head/Mk/Scripts
Message-ID:  <201404171442.s3HEgjQ2087341@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bdrewery
Date: Thu Apr 17 14:42:44 2014
New Revision: 351479
URL: http://svnweb.freebsd.org/changeset/ports/351479
QAT: https://qat.redports.org/buildarchive/r351479/

Log:
  - Document PLIST_SUB_SED= will disable PLIST_SUB hints
  - Avoid a redundant 'test -d'
  - Properly show %%PORTEXAMPLES%% %%PORTDOCS%% where needed
  - Avoid some forking for always-ignored files
  
  With hat:	portmgr

Modified:
  head/Mk/Scripts/check_leftovers.sh

Modified: head/Mk/Scripts/check_leftovers.sh
==============================================================================
--- head/Mk/Scripts/check_leftovers.sh	Thu Apr 17 14:37:23 2014	(r351478)
+++ head/Mk/Scripts/check_leftovers.sh	Thu Apr 17 14:42:44 2014	(r351479)
@@ -19,6 +19,9 @@
 # stdout:
 #  same -/+/M format, but with files substituted, without approved
 #  whitelisted files, and hides any directories already in plist.
+#
+# The PLIST_SUB feature can be disabled by setting PLIST_SUB_SED=
+# in environment.
 
 origin="$1"
 [ $# -eq 1 ] || { echo "Must supply ORIGIN as parameter" >&2; exit 1; }
@@ -42,11 +45,6 @@ plistsub_sed=$(make -C ${portdir} -VPLIS
 tmpplist=$(make -C ${portdir} -VTMPPLIST)
 
 while read modtype path extra; do
-	ignore_path=0
-	sub_path=$(echo "$path" | sed -e "s|^${PREFIX}/||" -e "${plistsub_sed}")
-	# If this is a directory, use @dirrm in output
-	[ -d "${path}" ] && sub_path="@dirrm ${sub_path}"
-
 	# Ignore everything from these files/directories
 	case "${path}" in
 		${HOME:-/root}/.ccache/*|\
@@ -64,9 +62,26 @@ while read modtype path extra; do
 		# fc-cache - skip for now
 		/var/db/fontconfig/*) continue ;;
 	esac
+
+	ignore_path=0
+	sub_path=$(echo "$path" | sed -e "s|^${PREFIX}/||" -e "${plistsub_sed}")
+	orig_sub_path="${sub_path}"
+	# If this is a directory, use @dirrm in output
+	is_dir=0
+	if [ -d "${path}" ]; then
+		is_dir=1
+		sub_path="@dirrm ${sub_path}"
+	fi
+
+	# Handle PORTDOCS/PORTEXAMPLES/etc
+	case "${orig_sub_path}" in
+		%%DOCSDIR%%*) sub_path="%%PORTDOCS%%${sub_path}" ;;
+		%%EXAMPLESDIR%%*) sub_path="%%PORTEXAMPLES%%${sub_path}" ;;
+	esac
+
 	case $modtype in
 	+)
-		if [ -d "${path}" ]; then
+		if [ ${is_dir} -eq 1 ]; then
 			# home directory of users created
 			case " ${homedirs} " in
 			*\ ${path}\ *) continue ;;



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