diff --git a/src/usr/sbin/sbopkg b/src/usr/sbin/sbopkg index 7ec6c17..ef1c563 100755 --- a/src/usr/sbin/sbopkg +++ b/src/usr/sbin/sbopkg @@ -2458,6 +2458,7 @@ git_command() { local SYNC_LOCK=$SBOPKGTMP/sbopkg_sync.lck local URL BRANCH CWD + local NEW_REPO=0 eval $(sed 's/^\(.*\)@\(.*\)$/URL=\1; BRANCH=\2/g' <<< $REPO_LINK) @@ -2473,10 +2474,22 @@ git_command() { mkdir -p $REPO_DIR cd $REPO_DIR git init + NEW_REPO=1 fi # Update the repository cd $REPO_DIR git pull $URL $BRANCH + + # If the initial pull fails right after a "git init", the .git + # directory is garbage and will cause further attempts to fail. + if [ "$NEW_REPO" = "1" -a "$?" != 0 ]; then + echo + echo "Failed to check out repository, check the URL or your" + echo "network connection." + rm -rf .git $SYNC_LOCK + return + fi + # Remove leftovers # This is optional, think of it as a way to emulate the --delete --exclude # rsync directives diff --git a/tools/ChangeLog-latest.txt b/tools/ChangeLog-latest.txt index 62592f2..c9ce14e 100644 --- a/tools/ChangeLog-latest.txt +++ b/tools/ChangeLog-latest.txt @@ -1,6 +1,6 @@ SBOPKG NEWS -sbopkg-dev (2019-12-26 05:13:18 UTC) +sbopkg-dev (2020-01-16 05:55:44 UTC) FEATURES * sqg: Parallelize building of single and all packages by option -j. Patch by Marcel Saegebarth. @@ -55,6 +55,8 @@ sbopkg-dev (2019-12-26 05:13:18 UTC) * Fix file ownership changes when unpacking tarball Patch by pv4 (#54) * Handle upper case value for MD5SUMS + * Better handling at git repository during bad network connection. + Patch by Urchlay sbopkg 0.38.1 (2016-09-01 13:42 UTC) FEATURES