From 4211397ac06333cbdd06f029f46459472efa8057 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Sat, 8 May 2010 15:50:51 +0200 Subject: [PATCH] download-gamepacks: more robustness --- download-gamepacks.sh | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/download-gamepacks.sh b/download-gamepacks.sh index e15ded98..efc3951c 100755 --- a/download-gamepacks.sh +++ b/download-gamepacks.sh @@ -35,29 +35,29 @@ pack() $ECHO "Updating $pack..." case "$sourcetype" in svn) - $SVN update "games/$pack" "$@" + $SVN update "games/$pack" "$@" || true ;; zip1) $RM_R zipdownload $MKDIR zipdownload cd zipdownload - $WGET "$source" "$@" + $WGET "$source" "$@" || true $UNZIP * cd .. $RM_R "games/$pack" $MKDIR "games/$pack" - $MV zipdownload/*/* "games/$pack/" + $MV zipdownload/*/* "games/$pack/" || true $RM_R zipdownload ;; gitdir) $RM_R "games/$pack" cd games - $GIT archive --remote="$source" --prefix="$pack/" "$2":"$1" | tar xvf - + $GIT archive --remote="$source" --prefix="$pack/" "$2":"$1" | tar xvf - || true cd .. ;; git) cd "games/$pack" - $GIT pull + $GIT pull || true cd ../.. ;; esac @@ -112,31 +112,38 @@ pack() $ECHO "Downloading $pack..." case "$sourcetype" in svn) - $SVN checkout "$source" "games/$pack" "$@" + $SVN checkout "$source" "games/$pack" "$@" || true ;; zip1) $RM_R zipdownload $MKDIR zipdownload cd zipdownload - $WGET "$source" "$@" - $UNZIP * + $WGET "$source" "$@" || true + $UNZIP * || true cd .. $MKDIR "games/$pack" - $MV zipdownload/*/* "games/$pack/" + $MV zipdownload/*/* "games/$pack/" || true $RM_R zipdownload ;; gitdir) cd games - $GIT archive --remote="$source" --prefix="$pack/" "$2":"$1" | tar xvf - + $GIT archive --remote="$source" --prefix="$pack/" "$2":"$1" | tar xvf - || true cd .. ;; git) cd games - $GIT clone "$source" "$pack" + $GIT clone "$source" "$pack" || true cd .. ;; esac extra_urls "games/$pack" + good=false + for D in "games/$pack"/*.game; do + if [ -d "$D" ]; then + good=true + fi + done + $good || rm -rf "$D" } mkdir -p games -- 2.39.2