modifications to new code to allow changing slackware version; add in a few checks to make sure $LOCALREPO/$SLACKVER exists at various points during the menu

This commit is contained in:
chess.griffin 2008-04-03 22:57:43 +00:00
parent 590667bb8c
commit 531a3cc087

View file

@ -94,14 +94,14 @@ check_slack_version () {
if [ ! -d "$LOCALREPO/$SLACKVER" ]; then if [ ! -d "$LOCALREPO/$SLACKVER" ]; then
if [ "$DIAG" = 1 ]; then if [ "$DIAG" = 1 ]; then
dialog --title "Create directory?" --yesno "The directory \ dialog --title "Create directory?" --yesno "The directory \
$LOCALREPO/$SLACKVER was not found. Would like to create it? \ $LOCALREPO/$SLACKVER was not found. Would you like to create it? \
Select YES to create or NO to return." 10 30 Select YES to create or NO to cancel." 10 30
if [ $? = 0 ]; then if [ $? = 0 ]; then
check_root check_write $LOCALREPO/$SLACKVER/
if [ $ROOT = "false" ]; then if [ "$WRITE" = "false" ]; then
dialog --title "ERROR" --msgbox "Sorry, only the root \ dialog --title "ERROR" --msgbox "You do not have \
user can create this directory." 8 30 write permissions on the target directory." 8 30
break continue
else else
mkdir -p $LOCALREPO/$SLACKVER mkdir -p $LOCALREPO/$SLACKVER
dialog --title "Done" --msgbox "The directory has been \ dialog --title "Done" --msgbox "The directory has been \
@ -156,6 +156,13 @@ exit 0
get_category_list () { get_category_list () {
# This function displays the list of SBo categories in the dialog # This function displays the list of SBo categories in the dialog
if [ ! -d $LOCALREPO/$SLACKVER ]; then
dialog --title "ERROR" --msgbox "The directory \
$LOCALREPO/$SLACKVER was not found. Please make sure your \
repository directory is set correctly and that you have done an \
rsync first." 10 30
continue
fi
cd $LOCALREPO/$SLACKVER cd $LOCALREPO/$SLACKVER
rm -f $TMP/sbopkg_category_list 2> /dev/null rm -f $TMP/sbopkg_category_list 2> /dev/null
DIR=( */ ) DIR=( */ )