mirror of
https://github.com/sbopkg/sbopkg
synced 2024-12-31 10:23:25 +01:00
clean up queue and utilities menu functions so they are like the main menu function; there are still other menus that need to be cleaned up like this.
This commit is contained in:
parent
ac2acef76c
commit
dd1bcc81fe
1 changed files with 99 additions and 67 deletions
|
@ -2432,7 +2432,7 @@ queue_menu () {
|
||||||
if [ -z "$Q" ]; then
|
if [ -z "$Q" ]; then
|
||||||
Q="View"
|
Q="View"
|
||||||
fi
|
fi
|
||||||
while [ 0 ]; do
|
while :; do
|
||||||
dialog --default-item "$Q" --title "Build Queue Menu" --backtitle \
|
dialog --default-item "$Q" --title "Build Queue Menu" --backtitle \
|
||||||
"Currently using the SlackBuilds.org $SLACKVER repository." \
|
"Currently using the SlackBuilds.org $SLACKVER repository." \
|
||||||
--cancel-label "Back" --menu \
|
--cancel-label "Back" --menu \
|
||||||
|
@ -2445,42 +2445,60 @@ queue_menu () {
|
||||||
"Save" "Save a build queue" \
|
"Save" "Save a build queue" \
|
||||||
2>$TMP/sbopkg_queue_menu_answer
|
2>$TMP/sbopkg_queue_menu_answer
|
||||||
|
|
||||||
if [ $? != 0 ]; then
|
#FIXME: remove commented code below if all ok.
|
||||||
Q=""
|
#if [ $? != 0 ]; then
|
||||||
rm -f $TMP/sbopkg_queue_menu_answer
|
# Q=""
|
||||||
return
|
# rm -f $TMP/sbopkg_queue_menu_answer
|
||||||
fi
|
# return
|
||||||
|
#fi
|
||||||
|
|
||||||
Q="$(cat $TMP/sbopkg_queue_menu_answer)"
|
Q="$(cat $TMP/sbopkg_queue_menu_answer)"
|
||||||
|
|
||||||
if [ "$Q" = "View" ]; then
|
#if [ "$Q" = "View" ]; then
|
||||||
view_queue
|
# view_queue
|
||||||
fi
|
#fi
|
||||||
|
|
||||||
if [ "$Q" = "Process" ]; then
|
#if [ "$Q" = "Process" ]; then
|
||||||
BUILDPKGS=1
|
# BUILDPKGS=1
|
||||||
process_queue
|
# process_queue
|
||||||
fi
|
#fi
|
||||||
|
|
||||||
if [ "$Q" = "Delete" ]; then
|
#if [ "$Q" = "Delete" ]; then
|
||||||
delete_build_queue
|
# delete_build_queue
|
||||||
fi
|
#fi
|
||||||
|
|
||||||
if [ "$Q" = "Load" ]; then
|
#if [ "$Q" = "Load" ]; then
|
||||||
load_user_queue
|
# load_user_queue
|
||||||
fi
|
#fi
|
||||||
|
|
||||||
if [ "$Q" = "Save" ]; then
|
#if [ "$Q" = "Save" ]; then
|
||||||
save_user_queue
|
# save_user_queue
|
||||||
fi
|
#fi
|
||||||
|
|
||||||
|
case "$Q" in
|
||||||
|
"View") view_queue ;;
|
||||||
|
"Process") BUILDPKGS=1
|
||||||
|
process_queue ;;
|
||||||
|
"Delete") delete_build_queue ;;
|
||||||
|
"Load") load_user_queue ;;
|
||||||
|
"Save") save_user_queue ;;
|
||||||
|
*) # "Exit", or an empty string if Exit, instead of Ok,
|
||||||
|
# was pressed
|
||||||
|
Q=""
|
||||||
|
rm -f $TMP/sbopkg_queue_menu_answer
|
||||||
|
return
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
utilities_menu () {
|
utilities_menu () {
|
||||||
# Separate menu for various utilities.
|
# Separate menu for various utilities.
|
||||||
if [ -z "$G" ] ; then G="Cache" ; fi
|
if [ -z "$G" ];
|
||||||
while [ 0 ]; do
|
then G="Cache"
|
||||||
|
fi
|
||||||
|
while :; do
|
||||||
dialog --default-item "$G" --title "Utilities Menu" --backtitle \
|
dialog --default-item "$G" --title "Utilities Menu" --backtitle \
|
||||||
"Currently using the SlackBuilds.org $SLACKVER repository." \
|
"Currently using the SlackBuilds.org $SLACKVER repository." \
|
||||||
--cancel-label "Back" --menu \
|
--cancel-label "Back" --menu \
|
||||||
|
@ -2492,31 +2510,45 @@ utilities_menu () {
|
||||||
"Latest" "Check for an update to sbopkg" \
|
"Latest" "Check for an update to sbopkg" \
|
||||||
2>$TMP/sbopkg_utilities_menu_answer
|
2>$TMP/sbopkg_utilities_menu_answer
|
||||||
|
|
||||||
if [ $? != 0 ]; then
|
#FIXME: remove commented code below if all ok.
|
||||||
G=""
|
#if [ $? != 0 ]; then
|
||||||
rm -f $TMP/sbopkg_utilities_menu_answer
|
# G=""
|
||||||
return
|
# rm -f $TMP/sbopkg_utilities_menu_answer
|
||||||
fi
|
# return
|
||||||
|
#fi
|
||||||
|
|
||||||
G="$(cat $TMP/sbopkg_utilities_menu_answer)"
|
G="$(cat $TMP/sbopkg_utilities_menu_answer)"
|
||||||
|
|
||||||
if [ "$G" = "Cache" ]; then
|
#if [ "$G" = "Cache" ]; then
|
||||||
view_cache_dir
|
# view_cache_dir
|
||||||
fi
|
#fi
|
||||||
|
|
||||||
if [ "$G" = "Log" ]; then
|
#if [ "$G" = "Log" ]; then
|
||||||
view_perm_log
|
# view_perm_log
|
||||||
fi
|
#fi
|
||||||
|
|
||||||
if [ "$G" = "Version" ]; then
|
#if [ "$G" = "Version" ]; then
|
||||||
select_version
|
# select_version
|
||||||
fi
|
#fi
|
||||||
|
|
||||||
if [ "$G" = "Latest" ]; then
|
#if [ "$G" = "Latest" ]; then
|
||||||
check_for_latest
|
# check_for_latest
|
||||||
fi
|
#fi
|
||||||
|
|
||||||
|
case "$G" in
|
||||||
|
"Cache") view_cache_dir ;;
|
||||||
|
"Log") view_perm_log ;;
|
||||||
|
"Version") select_version ;;
|
||||||
|
"Latest") check_for_latest ;;
|
||||||
|
*) # "Exit", or an empty string if Exit, instead of Ok,
|
||||||
|
# was pressed
|
||||||
|
G=""
|
||||||
|
rm -f $TMP/sbopkg_utilities_menu_answer
|
||||||
|
return
|
||||||
|
;;
|
||||||
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanup () {
|
cleanup () {
|
||||||
|
|
Loading…
Reference in a new issue