From d77e72b95e8b1419c3fad8ad4e5e4ae09cb05afa Mon Sep 17 00:00:00 2001 From: Joshua Root Date: Mon, 30 Apr 2012 06:15:25 +0000 Subject: [PATCH] mpab: skip uploading previously deployed archives git-svn-id: https://svn.macports.org/repository/macports/contrib/mpab@92493 d073be05-634f-4543-b044-5fe20cf6d1d6 --- gather_archives.sh | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/gather_archives.sh b/gather_archives.sh index 8c1c625..bb2fe46 100755 --- a/gather_archives.sh +++ b/gather_archives.sh @@ -28,6 +28,11 @@ if [[ -z "$ULPATH" ]]; then 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 @@ fi 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