Refactor get_source() a bit.

Signed-off-by: Mauro Giachero <mauro.giachero@gmail.com>
This commit is contained in:
mauro.giachero 2009-05-21 08:51:04 +00:00
parent 1d47dfab92
commit 9ee548f2c3

View file

@ -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")
while :; do
check_source $PKG $MD5SUM $SRCNAME check_source $PKG $MD5SUM $SRCNAME
SOURCE_STATUS=$? case $? in
while [[ $SOURCE_STATUS != 0 ]] ; do 0 ) # Source OK
if [[ $SOURCE_STATUS == 2 ]]; then break
;;
2 ) # Abort
FAILURE=download FAILURE=download
break break
fi ;;
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