[135069] trunk/base/portmgr/jobs/mirror_macports.sh

cal at macports.org cal at macports.org
Tue Apr 14 13:36:11 PDT 2015


Revision: 135069
          https://trac.macports.org/changeset/135069
Author:   cal at macports.org
Date:     2015-04-14 13:36:11 -0700 (Tue, 14 Apr 2015)
Log Message:
-----------
base: portmgr/jobs/mirror_macports.sh: fix variant extraction code and loops

I'm not sure if this script is actively being used, but it certainly didn't
correctly extract variants (it ran, e.g. port mirror collectd +[+]ntpd).
Additionally, a loop over a quoted string in bash does not tokenize the
contents of the string and loop over the tokens, but loops over the whole thing
at once, so let's remove the quotes where we don't really want them.

Modified Paths:
--------------
    trunk/base/portmgr/jobs/mirror_macports.sh

Modified: trunk/base/portmgr/jobs/mirror_macports.sh
===================================================================
--- trunk/base/portmgr/jobs/mirror_macports.sh	2015-04-14 20:34:15 UTC (rev 135068)
+++ trunk/base/portmgr/jobs/mirror_macports.sh	2015-04-14 20:36:11 UTC (rev 135069)
@@ -41,7 +41,7 @@
   $PORT mirror $P;
 
   # for each variant
-  for V in `$PORT -q variants $P | $CUT -d " " -f 1 | $CUT -d ":" -f 1 | $GREP -v universal | $XARGS`;
+  for V in `$PORT -q variants $P | $CUT -c 4- | $CUT -d ":" -f 1 | $GREP -v universal | $XARGS`;
   do
     # mirror with each variant
     echo "Mirroring ${P} +${V}";
@@ -50,15 +50,15 @@
   done
 
   # mirror with each platform (can exclude the one the server is running)
-  for VERS in "8 9";
+  for VERS in 8 9;
   do
-    for ARCH in "i386 powerpc";
+    for ARCH in i386 powerpc;
     do
       echo "Mirroring ${P} with platform darwin ${VERS} ${ARCH}"
       $PORT mirror $P os.platform=darwin os.subplatform=macosx os.major=${VERS} os.arch=${ARCH}
     done
   done
-  for VERS in "10 11 12 13 14";
+  for VERS in 10 11 12 13 14;
   do
     echo "Mirroring ${P} with platform darwin ${VERS} i386"
     $PORT mirror $P os.platform=darwin os.subplatform=macosx os.major=${VERS} os.arch=i386
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20150414/a18a832c/attachment.html>


More information about the macports-changes mailing list