add non-dialog message for no repo exists function; add more calls to such function for cli usage

This commit is contained in:
chess.griffin 2008-08-27 01:41:15 +00:00
parent 713ebe612c
commit f97244d0cf

View file

@ -113,11 +113,18 @@ fi
check_if_repo_exists () { check_if_repo_exists () {
# Check to see if $LOCALREPO/$SLACKVER exists # Check to see if $LOCALREPO/$SLACKVER exists
if [ ! -d $LOCALREPO/$SLACKVER ]; then if [ ! -d $LOCALREPO/$SLACKVER ]; then
dialog --title "ERROR" --msgbox "The directory \ if [ "$DIAG" = 1 ]; then
dialog --title "ERROR" --msgbox "The directory \
$LOCALREPO/$SLACKVER was not found. Please make sure your \ $LOCALREPO/$SLACKVER was not found. Please make sure your \
repository directory is set correctly and that you have done an \ repository directory is set correctly and that you have done an \
rsync first." 12 30 rsync first." 12 30
continue continue
else
echo "The directory $LOCALREPO/$SLACKVER was not found."
echo "Please make sure your respository directory is set"
echo "correctly and that you have done an rsync first."
exit 0
fi
fi fi
} }
@ -1056,6 +1063,7 @@ $LOCALREPO/$SLACKVER."
fi fi
if [ -n "$SEARCH" ]; then if [ -n "$SEARCH" ]; then
check_if_repo_exists
for PKGSEARCH in $SEARCH; do for PKGSEARCH in $SEARCH; do
echo "Searching for $PKGSEARCH" echo "Searching for $PKGSEARCH"
search_package $PKGSEARCH search_package $PKGSEARCH
@ -1065,6 +1073,7 @@ if [ -n "$SEARCH" ]; then
fi fi
if [ -n "$GENSEARCH" ]; then if [ -n "$GENSEARCH" ]; then
check_if_repo_exists
for PKGSEARCH in $GENSEARCH; do for PKGSEARCH in $GENSEARCH; do
echo "Searching for $PKGSEARCH" echo "Searching for $PKGSEARCH"
gen_search_package $PKGSEARCH gen_search_package $PKGSEARCH