Ignore:
Timestamp:
Apr 30, 2012, 6:15:25 AM (5 years ago)
Author:
jmr@…
Message:

mpab: skip uploading previously deployed archives

File:
1 edited

Legend:

Unmodified
Added
Removed
  • contrib/mpab/gather_archives.sh

    r86175 r92493  
    2929fi
    3030
     31# site to check for existing archive
     32if [[ -z "$ARCHIVE_SITE" ]]; then
     33    ARCHIVE_SITE="http://packages.macports.org/"
     34fi
     35
    3136mkdir -p $ULPATH
    3237if [[ `head -n1 $PORTLISTFILE` == "all" ]]; then
     
    4853for portname in $ports; do
    4954    if ls logs-*/success/${portname}.log > /dev/null 2>&1 ; then
    50         if ./mpexport/base/portmgr/jobs/port_binary_distributable.tcl -v ${portname}; then
    51             portversion=$(${PREFIX}/bin/port info --index --version --line ${portname})
    52             portrevision=$(${PREFIX}/bin/port info --index --revision --line ${portname})
    53             for archive in ${PREFIX}/var/macports/software/${portname}/${portname}-${portversion}_${portrevision}[+.]*; do
    54                 aname=$(basename $archive)
    55                 echo preparing archive for upload: $aname
    56                 mkdir -p ${ULPATH}/${portname}
    57                 cp $archive ${ULPATH}/${portname}/
    58             done
    59         fi
     55        distributable=""
     56        portversion=$(${PREFIX}/bin/port info --index --version --revision --line ${portname} | tr '\t' '_')
     57        for archive in ${PREFIX}/var/macports/software/${portname}/${portname}-${portversion}[+.]*; do
     58            aname=$(basename $archive)
     59            if ! /usr/bin/curl -fIs "${ARCHIVE_SITE}${portname}/${aname}" > /dev/null ; then
     60                if [[ -z "$distributable" ]]; then
     61                    ./mpexport/base/portmgr/jobs/port_binary_distributable.tcl -v ${portname}
     62                    distributable=$?
     63                fi
     64                if [[ "$distributable" -eq 0 ]]; then
     65                    echo "preparing archive for upload: $aname"
     66                    mkdir -p ${ULPATH}/${portname}
     67                    cp $archive ${ULPATH}/${portname}/
     68                fi
     69            else
     70                echo "$aname already uploaded"
     71            fi
     72        done
    6073    fi
    6174done
Note: See TracChangeset for help on using the changeset viewer.