mirror of
https://github.com/sbopkg/sbopkg
synced 2024-11-09 19:50:25 +03:00
sbopkg: Better handling git repository during bad network connection.
Signed-off-by: Willy Sudiarto Raharjo <willysr@sbopkg.org>
This commit is contained in:
parent
c702bb8aa0
commit
3fbbe4eb96
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user