Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Sep 2014 17:06:20 +0000 (UTC)
From:      Antoine Brodin <antoine@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r366901 - in head: Keywords Mk/Scripts
Message-ID:  <201409011706.s81H6KcN040573@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: antoine
Date: Mon Sep  1 17:06:19 2014
New Revision: 366901
URL: http://svnweb.freebsd.org/changeset/ports/366901
QAT: https://qat.redports.org/buildarchive/r366901/

Log:
  - Make it possible to use sample keyword with a full path
  - Prefer @dirrmtry over @unexec rmdir in makeplist
  
  Differential Revision:	https://reviews.freebsd.org/D705
  Reviewed by:	bapt
  With hat:	portmgr

Modified:
  head/Keywords/sample.ucl
  head/Keywords/sample.yaml
  head/Mk/Scripts/check-stagedir.sh

Modified: head/Keywords/sample.ucl
==============================================================================
--- head/Keywords/sample.ucl	Mon Sep  1 16:56:27 2014	(r366900)
+++ head/Keywords/sample.ucl	Mon Sep  1 17:06:19 2014	(r366901)
@@ -16,14 +16,20 @@
 
 actions: [file]
 post-install: <<EOD
-  sample_file="%D/%@"
+  case "%@" in
+  /*) sample_file="%@" ;;
+  *) sample_file="%D/%@" ;;
+  esac
   target_file="${sample_file%.sample}"
   if ! [ -f "${target_file}" ]; then
     /bin/cp -p "${sample_file}" "${target_file}"
   fi
 EOD
 pre-deinstall: <<EOD
-  sample_file="%D/%@"
+  case "%@" in
+  /*) sample_file="%@" ;;
+  *) sample_file="%D/%@" ;;
+  esac
   target_file="${sample_file%.sample}"
   if cmp -s "${target_file}" "${sample_file}"; then
     rm -f "${target_file}"

Modified: head/Keywords/sample.yaml
==============================================================================
--- head/Keywords/sample.yaml	Mon Sep  1 16:56:27 2014	(r366900)
+++ head/Keywords/sample.yaml	Mon Sep  1 17:06:19 2014	(r366901)
@@ -16,13 +16,19 @@
 
 actions: [file]
 post-install: |
-  sample_file="%D/%@"
+  case "%@" in
+  /*) sample_file="%@" ;;
+  *) sample_file="%D/%@" ;;
+  esac
   target_file="${sample_file%.sample}"
   if ! [ -f "${target_file}" ]; then
     /bin/cp -p "${sample_file}" "${target_file}"
   fi
 pre-deinstall: |
-  sample_file="%D/%@"
+  case "%@" in
+  /*) sample_file="%@" ;;
+  *) sample_file="%D/%@" ;;
+  esac
   target_file="${sample_file%.sample}"
   if cmp -s "${target_file}" "${sample_file}"; then
     rm -f "${target_file}"

Modified: head/Mk/Scripts/check-stagedir.sh
==============================================================================
--- head/Mk/Scripts/check-stagedir.sh	Mon Sep  1 16:56:27 2014	(r366900)
+++ head/Mk/Scripts/check-stagedir.sh	Mon Sep  1 17:06:19 2014	(r366901)
@@ -73,8 +73,16 @@ parse_plist() {
 			set -- $line
 			shift
 			# Ignore the actual file if it is in stagedir
+			case "$@" in
+			/*)
+			echo "@comment ${@%.sample}"
+			echo "${comment}$@"
+			;;
+			*)
 			echo "@comment ${cwd}/${@%.sample}"
 			echo "${comment}${cwd}/$@"
+			;;
+			esac
 		;;
 		# Handle [dirrmty] Keywords
 		@fc\ *|@fcfontsdir\ *|@fontsdir\ *)
@@ -234,13 +242,11 @@ setup_plist_seds() {
 	    ${sed_portdocsexamples} /^share\/licenses/d;"
 	sed_dirs_gen="s!${PREFIX}/!!g; ${sed_plist_sub} s,^,@dirrmtry ,; \
 	    ${sed_portdocsexamples} \
-	    s!@dirrmtry \(/.*\)!@unexec rmdir \"\1\" >/dev/null 2>\&1 || :!; \
 	    /^@dirrmtry share\/licenses/d;"
 
 	# These prevent ignoring DOCS/EXAMPLES dirs with sed_portdocsexamples
 	sed_files="s!${PREFIX}/!!g; ${sed_plist_sub} /^share\/licenses/d;"
 	sed_dirs="s!${PREFIX}/!!g; ${sed_plist_sub} s,^,@dirrmtry ,; \
-	    s!@dirrmtry \(/.*\)!@unexec rmdir \"\1\" >/dev/null 2>\&1 || :!; \
 	    /^@dirrmtry share\/licenses/d;"
 
 }
@@ -334,7 +340,7 @@ check_invalid_directories_mtree() {
 			if [ "${PREFIX}" != "${LOCALBASE}" ]; then
 				case "${line}" in
 					"@dirrmtry info") continue ;;
-					"@unexec rmdir \"${PREFIX}\" >/dev/null 2>&1 || :") continue ;;
+					"@dirrmtry ${PREFIX}") continue ;;
 				esac
 			fi
 			ret=1



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