improve the new sbopkg update download checker by removing duplicate code and providing a more detailed exit message when the download is complete.

This commit is contained in:
chess.griffin 2009-01-14 19:54:47 +00:00
parent b3f8c90ba9
commit 1e0e6a4eb7

View file

@ -1725,14 +1725,7 @@ of sbopkg found on sbopkg.org: $NVRS\n\n$MSG" 16 40
download the new sbopkg package:\n\n$NEWSBOPKG\n\nThe new sbopkg package download the new sbopkg package:\n\n$NEWSBOPKG\n\nThe new sbopkg package
will saved to your OUTPUT directory: $OUTPUT" 13 50 will saved to your OUTPUT directory: $OUTPUT" 13 50
W=$? W=$?
if [ $W = 0 ]; then if [ $W = 1 ]; then
cd $OUTPUT
wget $WGETFLAGS $NEWDLPKG
cd $LOCALREPO/$SLACKVER
if [ "$DIAG" = 1 ]; then
read -n 1 -p "Press any key to continue."
fi
elif [ $W = 1 ]; then
return 0 return 0
fi fi
fi fi
@ -1748,8 +1741,7 @@ else
if [ "$SBOPKGUP" = 1 ]; then if [ "$SBOPKGUP" = 1 ]; then
read ANS read ANS
case $ANS in case $ANS in
y* | Y* ) cd $OUTPUT && wget $WGETFLAGS $NEWDLPKG \ y* | Y* ) continue
&& cd $CWD
;; ;;
n* | N* ) cleanup; exit 0 n* | N* ) cleanup; exit 0
;; ;;
@ -1758,6 +1750,32 @@ else
esac esac
fi fi
fi fi
if [ "$SBOPKGUP" = 1 ]; then
cd $OUTPUT
wget $WGETFLAGS $NEWDLPKG
cd $CWD
echo "######################################################"
echo "Download complete. The downloaded file is located at:"
echo
echo "$TMP/$NEWSBOPKG"
echo
echo "You can now quit sbopkg and upgrade sbopkg manually."
echo
echo "Once you have upgraded sbopkg, please be sure to \
check the"
echo "/etc/sbopkg/sbopkg.conf.new file for any changes \
that may"
echo "need to be merged into your existing \
/etc/sbopkg/sbopkg.conf file."
echo
echo "You can also view a complete ChangeLog.txt in the"
echo "/usr/share/doc/sbopkg-$NVRS/ directory or online at:"
echo "http://www.sbopkg.org/files/ChangeLog.txt"
echo
if [ "$DIAG" = 1 ]; then
read -n 1 -p "Press any key to continue."
fi
fi
} }
utilities_menu () { utilities_menu () {