From 46732b01e929c9779c82b5f7c3ab05684e31a798 Mon Sep 17 00:00:00 2001 From: bigeagle Date: Wed, 27 Jul 2016 23:56:18 +0800 Subject: [PATCH] pypi: use todo file to inspect sync status --- pypi.sh | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/pypi.sh b/pypi.sh index 92c32b5..6003f24 100755 --- a/pypi.sh +++ b/pypi.sh @@ -20,8 +20,7 @@ workers = 10 stop-on-error = true delete-packages = true EOF - /usr/bin/timeout -s INT 7200 $BANDERSNATCH -c $CONF mirror || exit 1 - + /usr/bin/timeout -s INT 7200 $BANDERSNATCH -c $CONF mirror else cat > $CONF << EOF [mirror] @@ -33,5 +32,17 @@ stop-on-error = false delete-packages = false EOF - $BANDERSNATCH -c $CONF mirror || exit 1 + $BANDERSNATCH -c $CONF mirror fi + +TODOFILE="${TUNASYNC_WORKING_DIR}/todo" +if [[ -f $TODOFILE ]]; then + rsize=`stat -c "%s" ${dest_filename}` + if [[ "$rsize" != "0" ]]; then + echo "Sync Failed T_T" + exit 1 + fi +fi + +echo "Sync Done ^_-" +exit 0