[92493] contrib/mpab/gather_archives.sh

jmr at macports.org jmr at macports.org
Sun Apr 29 23:15:27 PDT 2012


Revision: 92493
          https://trac.macports.org/changeset/92493
Author:   jmr at macports.org
Date:     2012-04-29 23:15:25 -0700 (Sun, 29 Apr 2012)
Log Message:
-----------
mpab: skip uploading previously deployed archives

Modified Paths:
--------------
    contrib/mpab/gather_archives.sh

Modified: contrib/mpab/gather_archives.sh
===================================================================
--- contrib/mpab/gather_archives.sh	2012-04-30 05:48:48 UTC (rev 92492)
+++ contrib/mpab/gather_archives.sh	2012-04-30 06:15:25 UTC (rev 92493)
@@ -28,6 +28,11 @@
     ULPATH="archive_staging"
 fi
 
+# site to check for existing archive
+if [[ -z "$ARCHIVE_SITE" ]]; then
+    ARCHIVE_SITE="http://packages.macports.org/"
+fi
+
 mkdir -p $ULPATH
 if [[ `head -n1 $PORTLISTFILE` == "all" ]]; then
     ports=`${PREFIX}/bin/port -q echo all | tr '\n' ' '`
@@ -47,15 +52,23 @@
 
 for portname in $ports; do
     if ls logs-*/success/${portname}.log > /dev/null 2>&1 ; then
-        if ./mpexport/base/portmgr/jobs/port_binary_distributable.tcl -v ${portname}; then
-            portversion=$(${PREFIX}/bin/port info --index --version --line ${portname})
-            portrevision=$(${PREFIX}/bin/port info --index --revision --line ${portname})
-            for archive in ${PREFIX}/var/macports/software/${portname}/${portname}-${portversion}_${portrevision}[+.]*; do
-                aname=$(basename $archive)
-                echo preparing archive for upload: $aname
-                mkdir -p ${ULPATH}/${portname}
-                cp $archive ${ULPATH}/${portname}/
-            done
-        fi
+        distributable=""
+        portversion=$(${PREFIX}/bin/port info --index --version --revision --line ${portname} | tr '\t' '_')
+        for archive in ${PREFIX}/var/macports/software/${portname}/${portname}-${portversion}[+.]*; do
+            aname=$(basename $archive)
+            if ! /usr/bin/curl -fIs "${ARCHIVE_SITE}${portname}/${aname}" > /dev/null ; then
+                if [[ -z "$distributable" ]]; then
+                    ./mpexport/base/portmgr/jobs/port_binary_distributable.tcl -v ${portname}
+                    distributable=$?
+                fi
+                if [[ "$distributable" -eq 0 ]]; then
+                    echo "preparing archive for upload: $aname"
+                    mkdir -p ${ULPATH}/${portname}
+                    cp $archive ${ULPATH}/${portname}/
+                fi
+            else
+                echo "$aname already uploaded"
+            fi
+        done
     fi
 done
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120429/6f8b2a2c/attachment.html>


More information about the macports-changes mailing list