mirror of
https://github.com/sbopkg/sbopkg
synced 2024-12-31 10:23:25 +01:00
Refactor get_source() a bit.
Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>
This commit is contained in:
parent
1d47dfab92
commit
9ee548f2c3
1 changed files with 13 additions and 14 deletions
|
@ -2191,20 +2191,24 @@ get_source() {
|
||||||
local DLDIR=$SBOPKGTMP/sbopkg-download
|
local DLDIR=$SBOPKGTMP/sbopkg-download
|
||||||
local PIDLIST=$SBOPKGTMP/sbopkgpidlist
|
local PIDLIST=$SBOPKGTMP/sbopkgpidlist
|
||||||
local TMPSUMMARYLOG=$SBOPKGTMP/sbopkg-tmp-summarylog
|
local TMPSUMMARYLOG=$SBOPKGTMP/sbopkg-tmp-summarylog
|
||||||
local SRCNAME DL FAILURE ANS MD5CHK SOURCE_STATUS
|
local SRCNAME DL FAILURE ANS MD5CHK
|
||||||
# Don't pollute the environment with the .info content...
|
# Don't pollute the environment with the .info content...
|
||||||
local PRGNAM VERSION HOMEPAGE DOWNLOAD MD5SUM MAINTAINER EMAIL APPROVED
|
local PRGNAM VERSION HOMEPAGE DOWNLOAD MD5SUM MAINTAINER EMAIL APPROVED
|
||||||
|
|
||||||
. "$INFO"
|
. "$INFO"
|
||||||
SRCNAME=$(get_source_names "$INFO")
|
SRCNAME=$(get_source_names "$INFO")
|
||||||
|
|
||||||
check_source $PKG $MD5SUM $SRCNAME
|
while :; do
|
||||||
SOURCE_STATUS=$?
|
check_source $PKG $MD5SUM $SRCNAME
|
||||||
while [[ $SOURCE_STATUS != 0 ]] ; do
|
case $? in
|
||||||
if [[ $SOURCE_STATUS == 2 ]]; then
|
0 ) # Source OK
|
||||||
FAILURE=download
|
break
|
||||||
break
|
;;
|
||||||
fi
|
2 ) # Abort
|
||||||
|
FAILURE=download
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
mkdir -p $DLDIR
|
mkdir -p $DLDIR
|
||||||
cd $DLDIR
|
cd $DLDIR
|
||||||
|
@ -2226,12 +2230,7 @@ get_source() {
|
||||||
fi
|
fi
|
||||||
cd $SRCDIR
|
cd $SRCDIR
|
||||||
rm -rf $DLDIR
|
rm -rf $DLDIR
|
||||||
|
[[ $FAILURE ]] && break
|
||||||
if [[ $FAILURE ]]; then
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
check_source $PKG $MD5SUM $SRCNAME
|
|
||||||
SOURCE_STATUS=$?
|
|
||||||
done
|
done
|
||||||
|
|
||||||
cd $REPO_DIR/$PKGPATH
|
cd $REPO_DIR/$PKGPATH
|
||||||
|
|
Loading…
Reference in a new issue