[137300] trunk/dports/print/ghostscript/Portfile

larryv at macports.org larryv at macports.org
Mon Jun 8 11:06:12 PDT 2015


Revision: 137300
          https://trac.macports.org/changeset/137300
Author:   larryv at macports.org
Date:     2015-06-08 11:06:12 -0700 (Mon, 08 Jun 2015)
Log Message:
-----------
ghostscript: Avoid calling `xinstall` inside loops

`glob` is more expressive than you think.

Modified Paths:
--------------
    trunk/dports/print/ghostscript/Portfile

Modified: trunk/dports/print/ghostscript/Portfile
===================================================================
--- trunk/dports/print/ghostscript/Portfile	2015-06-08 18:06:10 UTC (rev 137299)
+++ trunk/dports/print/ghostscript/Portfile	2015-06-08 18:06:12 UTC (rev 137300)
@@ -125,27 +125,26 @@
     # std fonts - install into FontCache-compatible directory.
     # Check: could break on case-sensitive file systems...
     xinstall -m 0755 -d ${destroot}${prefix}/share/fonts/Type1/gsfonts
-    foreach f {{[a-z][0-9][0-9][0-9][0-9][0-9][0-9][a-z].*} fonts.scale fonts.dir} {
-        xinstall -m 0644 {*}[glob [join [concat "${workpath}/fonts/" ${f}] ""]] ${destroot}${prefix}/share/fonts/Type1/gsfonts
-    }
+    xinstall -m 0644 \
+            {*}[glob -directory ${workpath}/fonts {[a-z][0-9][0-9][0-9][0-9][0-9][0-9][a-z].*} fonts.scale fonts.dir] \
+            ${destroot}${prefix}/share/fonts/Type1/gsfonts
 
     # Delete the already copied fonts to not copy them again when installing the "other" fonts.
-    delete {*}[glob [join [concat "${workpath}/fonts/" {[a-z][0-9][0-9][0-9][0-9][0-9][0-9][a-z].*}] ""]]
+    delete {*}[glob -directory ${workpath}/fonts {[a-z][0-9][0-9][0-9][0-9][0-9][0-9][a-z].*}]
 
     # other fonts - install into private ghostscript directory.
     xinstall -m 755 -d ${destroot}${prefix}/share/${name}/fonts
-    foreach f {*.afm *.gsf *.pfa *.pfm} {
-        xinstall -m 644 {*}[glob ${workpath}/fonts/${f}] ${destroot}${prefix}/share/${name}/fonts
-    }
+    xinstall -m 644 {*}[glob -directory ${workpath}/fonts *.afm *.gsf *.pfa *.pfm] \
+            ${destroot}${prefix}/share/${name}/fonts
 
     xinstall -m 755 -d ${destroot}${prefix}/share/doc
     ln -s ../${name}/${version}/doc ${destroot}${prefix}/share/doc/${name}
 
     # std fonts - "documentation"
     xinstall -m 0755 -d ${destroot}${prefix}/share/doc/${name}/fonts
-    foreach docfile {COPYING ChangeLog README README.tweaks TODO} {
-        xinstall -m 0644 ${workpath}/fonts/${docfile} ${destroot}${prefix}/share/doc/${name}/fonts
-    }
+    xinstall -m 0644 -W ${workpath}/fonts \
+            COPYING ChangeLog README README.tweaks TODO \
+            ${destroot}${prefix}/share/doc/${name}/fonts
 }
 
 post-activate {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20150608/ae265542/attachment.html>


More information about the macports-changes mailing list