mpab: skip uploading previously deployed archives

git-svn-id: https://svn.macports.org/repository/macports/contrib/mpab@92493 d073be05-634f-4543-b044-5fe20cf6d1d6
This commit is contained in:
Joshua Root
2012-04-30 06:15:25 +00:00
parent bc05af6942
commit d77e72b95e
+23 -10
View File
@@ -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