Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Oct 2014 21:39:48 +0000 (UTC)
From:      Alex Kozlov <ak@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r370490 - in head: Keywords Mk/Scripts
Message-ID:  <201410082139.s98Ldmhp027672@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ak
Date: Wed Oct  8 21:39:47 2014
New Revision: 370490
URL: https://svnweb.freebsd.org/changeset/ports/370490
QAT: https://qat.redports.org/buildarchive/r370490/

Log:
  - Accept absolute path for @fc, @fontsdir, @fcfontsdir, @shell keywords
  
  Approved by:	portmgr (antoine, bapt)
  Differential Revision:	https://reviews.freebsd.org/D721

Modified:
  head/Keywords/fc.ucl
  head/Keywords/fcfontsdir.ucl
  head/Keywords/fontsdir.ucl
  head/Keywords/shell.ucl
  head/Mk/Scripts/check-stagedir.sh

Modified: head/Keywords/fc.ucl
==============================================================================
--- head/Keywords/fc.ucl	Wed Oct  8 21:28:48 2014	(r370489)
+++ head/Keywords/fc.ucl	Wed Oct  8 21:39:47 2014	(r370490)
@@ -4,8 +4,16 @@
 
 actions: [dir]
 post-install: <<EOD
-  fc-cache -s %D/%@ 2>/dev/null || true
+  case "%@" in
+  /*) fontsdir="%@" ;;
+  *) fontsdir="%D/%@" ;;
+  esac
+  fc-cache -s ${fontsdir} 2>/dev/null || true
 EOD
 post-deinstall: <<EOD
-  fc-cache -s %D/%@ 2>/dev/null || true
+  case "%@" in
+  /*) fontsdir="%@" ;;
+  *) fontsdir="%D/%@" ;;
+  esac
+  fc-cache -s ${fontsdir} 2>/dev/null || true
 EOD

Modified: head/Keywords/fcfontsdir.ucl
==============================================================================
--- head/Keywords/fcfontsdir.ucl	Wed Oct  8 21:28:48 2014	(r370489)
+++ head/Keywords/fcfontsdir.ucl	Wed Oct  8 21:39:47 2014	(r370490)
@@ -4,18 +4,26 @@
 
 actions: [dir]
 post-install: <<EOD
-  fc-cache -s %D/%@ 2>/dev/null || true
-  mkfontscale %D/%@ 2>/dev/null || true
-  mkfontdir %D/%@ 2>/dev/null || true
+  case "%@" in
+  /*) fontsdir="%@" ;;
+  *) fontsdir="%D/%@" ;;
+  esac
+  fc-cache -s ${fontsdir} 2>/dev/null || true
+  mkfontscale ${fontsdir} 2>/dev/null || true
+  mkfontdir ${fontsdir} 2>/dev/null || true
 EOD
 post-deinstall: <<EOD
-  fc-cache -s %D/%@ 2>/dev/null || true
-  mkfontscale %D/%@ 2>/dev/null || true
-  if [ -e %D/%@/fonts.scale -a "`stat -f '%%z' %D/%@/fonts.scale 2>/dev/null`" = '2' ]; then
-    rm %D/%@/fonts.scale
+  case "%@" in
+  /*) fontsdir="%@" ;;
+  *) fontsdir="%D/%@" ;;
+  esac
+  fc-cache -s ${fontsdir} 2>/dev/null || true
+  mkfontscale ${fontsdir} 2>/dev/null || true
+  if [ -e ${fontsdir}/fonts.scale -a "`stat -f '%%z' ${fontsdir}/fonts.scale 2>/dev/null`" = '2' ]; then
+    rm ${fontsdir}/fonts.scale
   fi
-  mkfontdir %D/%@ 2>/dev/null || true
-  if [ -e %D/%@/fonts.dir -a "`stat -f '%%z' %D/%@/fonts.dir 2>/dev/null`" = '2' ]; then
-    rm %D/%@/fonts.dir
+  mkfontdir ${fontsdir} 2>/dev/null || true
+  if [ -e ${fontsdir}/fonts.dir -a "`stat -f '%%z' ${fontsdir}/fonts.dir 2>/dev/null`" = '2' ]; then
+    rm ${fontsdir}/fonts.dir
   fi
 EOD

Modified: head/Keywords/fontsdir.ucl
==============================================================================
--- head/Keywords/fontsdir.ucl	Wed Oct  8 21:28:48 2014	(r370489)
+++ head/Keywords/fontsdir.ucl	Wed Oct  8 21:39:47 2014	(r370490)
@@ -4,16 +4,24 @@
 
 actions: [dir]
 post-install: <<EOD
-  mkfontscale %D/%@ 2>/dev/null || true
-  mkfontdir %D/%@ 2>/dev/null || true
+  case "%@" in
+  /*) fontsdir="%@" ;;
+  *) fontsdir="%D/%@" ;;
+  esac
+  mkfontscale ${fontsdir} 2>/dev/null || true
+  mkfontdir ${fontsdir} 2>/dev/null || true
 EOD
 post-deinstall: <<EOD
-  mkfontscale %D/%@ 2>/dev/null || true
-  if [ -e %D/%@/fonts.scale -a "`stat -f '%%z' %D/%@/fonts.scale 2>/dev/null`" = '2' ]; then
-    rm %D/%@/fonts.scale
+  case "%@" in
+  /*) fontsdir="%@" ;;
+  *) fontsdir="%D/%@" ;;
+  esac
+  mkfontscale ${fontsdir} 2>/dev/null || true
+  if [ -e ${fontsdir}/fonts.scale -a "`stat -f '%%z' ${fontsdir}/fonts.scale 2>/dev/null`" = '2' ]; then
+    rm ${fontsdir}/fonts.scale
   fi
-  mkfontdir %D/%@ 2>/dev/null || true
-  if [ -e %D/%@/fonts.dir -a "`stat -f '%%z' %D/%@/fonts.dir 2>/dev/null`" = '2' ]; then
-    rm %D/%@/fonts.dir
+  mkfontdir ${fontsdir} 2>/dev/null || true
+  if [ -e ${fontsdir}/fonts.dir -a "`stat -f '%%z' ${fontsdir}/fonts.dir 2>/dev/null`" = '2' ]; then
+    rm ${fontsdir}/fonts.dir
   fi
 EOD

Modified: head/Keywords/shell.ucl
==============================================================================
--- head/Keywords/shell.ucl	Wed Oct  8 21:28:48 2014	(r370489)
+++ head/Keywords/shell.ucl	Wed Oct  8 21:39:47 2014	(r370490)
@@ -13,12 +13,20 @@
 
 actions: [file]
 post-install: <<EOD
+  case "%@" in
+  /*) file="%@" ;;
+  *) file="%D/%@" ;;
+  esac
         cp /etc/shells /etc/shells.bak
-        (grep -v %D/%@ /etc/shells.bak; echo %D/%@) > /etc/shells
+        (grep -v ${file} /etc/shells.bak; echo ${file}) > /etc/shells
         rm -f /etc/shells.bak
 EOD
 pre-deinstall: <<EOD
+  case "%@" in
+  /*) file="%@" ;;
+  *) file="%D/%@" ;;
+  esac
         cp /etc/shells /etc/shells.bak
-        grep -v %D/%@ /etc/shells.bak > /etc/shells
+        grep -v ${file} /etc/shells.bak > /etc/shells
         rm -f /etc/shells.bak
 EOD

Modified: head/Mk/Scripts/check-stagedir.sh
==============================================================================
--- head/Mk/Scripts/check-stagedir.sh	Wed Oct  8 21:28:48 2014	(r370489)
+++ head/Mk/Scripts/check-stagedir.sh	Wed Oct  8 21:39:47 2014	(r370490)
@@ -95,7 +95,14 @@ parse_plist() {
 		@fc\ *|@fcfontsdir\ *|@fontsdir\ *)
 			set -- $line
 			shift
+			case "$@" in
+			/*)
+			echo >&3 "${comment}$@"
+			;;
+			*)
 			echo >&3 "${comment}${cwd}/$@"
+			;;
+			esac
 		;;
 
 		# order matters here - we must check @cwd first because



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