From e4e3ebed3dee31638bbcc5f425c9e0e90ad6bc88 Mon Sep 17 00:00:00 2001 From: John Vogel <jvogel4@stny.rr.com> Date: Thu, 18 Jan 2018 06:26:50 -0500 Subject: [PATCH] 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. --- mpup | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mpup b/mpup index 7730f20..cc6aa84 100755 --- a/mpup +++ b/mpup @@ -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 of a port removed or commented out in LIST_FILE + if ! grep -qE "^[^#].*[[:space:]]+$PORT$" $LIST_FILE; then rm -f $ROOT_DIR/$PORT/$f >/dev/null 2>&1 echo " Delete: $PORT/$f" fi -- 2.15.1