Don't delete ports just because sync fails

Check the list file instead. If the port doesn't exist or
if it is commented out, then delete it.
This commit is contained in:
John Vogel 2018-01-18 06:26:50 -05:00 committed by Fredrik Rinnestam
parent 444e46c8d1
commit fc3b13901f

6
mpup
View File

@ -160,7 +160,7 @@ while [ "$(cat $TMP_DIR/.pids 2>/dev/null | wc -l)" != "0" ]; do
done
done
# remove ports that were deleted from mpup.lst
# remove ports that were deleted from LIST_FILE
for PORT in $ROOT_DIR/*; do
PORT=${PORT##*/}
[ "$PORT" == "*" ] && continue
@ -172,8 +172,8 @@ for PORT in $ROOT_DIR/*; do
[ -z "$f" ] && continue
# use the basename for file
f="$(basename $f)"
# delete files of a port which was not sync'ed (.checkouts.$PORT missing)
if [ ! -f "$TMP_DIR/.checkouts.$PORT" ]; then
# delete files for ports without valid entries in LIST_FILE
if ! grep -qE "^[[:space:]]*(httpup|rsync).*[[:space:]]+$PORT[[:space:]]*$" $LIST_FILE; then
rm -f $ROOT_DIR/$PORT/$f >/dev/null 2>&1
echo " Delete: $PORT/$f"
fi