mirror of
https://github.com/sbopkg/sbopkg
synced 2024-09-19 22:40:19 +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 SYNC_LOCK=$SBOPKGTMP/sbopkg_sync.lck
|
||||||
local URL BRANCH CWD
|
local URL BRANCH CWD
|
||||||
|
local NEW_REPO=0
|
||||||
|
|
||||||
eval $(sed 's/^\(.*\)@\(.*\)$/URL=\1; BRANCH=\2/g' <<< $REPO_LINK)
|
eval $(sed 's/^\(.*\)@\(.*\)$/URL=\1; BRANCH=\2/g' <<< $REPO_LINK)
|
||||||
|
|
||||||
@ -2473,10 +2474,22 @@ git_command() {
|
|||||||
mkdir -p $REPO_DIR
|
mkdir -p $REPO_DIR
|
||||||
cd $REPO_DIR
|
cd $REPO_DIR
|
||||||
git init
|
git init
|
||||||
|
NEW_REPO=1
|
||||||
fi
|
fi
|
||||||
# Update the repository
|
# Update the repository
|
||||||
cd $REPO_DIR
|
cd $REPO_DIR
|
||||||
git pull $URL $BRANCH
|
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
|
# Remove leftovers
|
||||||
# This is optional, think of it as a way to emulate the --delete --exclude
|
# This is optional, think of it as a way to emulate the --delete --exclude
|
||||||
# rsync directives
|
# rsync directives
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
SBOPKG NEWS
|
SBOPKG NEWS
|
||||||
|
|
||||||
sbopkg-dev (2019-12-26 05:13:18 UTC)
|
sbopkg-dev (2020-01-16 05:55:44 UTC)
|
||||||
FEATURES
|
FEATURES
|
||||||
* sqg: Parallelize building of single and all packages by option -j.
|
* sqg: Parallelize building of single and all packages by option -j.
|
||||||
Patch by Marcel Saegebarth.
|
Patch by Marcel Saegebarth.
|
||||||
@ -55,6 +55,8 @@ sbopkg-dev (2019-12-26 05:13:18 UTC)
|
|||||||
* Fix file ownership changes when unpacking tarball
|
* Fix file ownership changes when unpacking tarball
|
||||||
Patch by pv4 (#54)
|
Patch by pv4 (#54)
|
||||||
* Handle upper case value for MD5SUMS
|
* 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)
|
sbopkg 0.38.1 (2016-09-01 13:42 UTC)
|
||||||
FEATURES
|
FEATURES
|
||||||
|
Loading…
Reference in New Issue
Block a user