mirror of
https://github.com/sbopkg/sbopkg
synced 2024-12-29 10:24:11 +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,78 +2445,110 @@ 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"
|
||||||
dialog --default-item "$G" --title "Utilities Menu" --backtitle \
|
|
||||||
"Currently using the SlackBuilds.org $SLACKVER repository." \
|
|
||||||
--cancel-label "Back" --menu \
|
|
||||||
"\nChoose one of the following or press <Back> to go back.\n" \
|
|
||||||
15 69 5 \
|
|
||||||
"Cache" "View the contents of the cache directory" \
|
|
||||||
"Log" "View the permanent build log" \
|
|
||||||
"Version" "Select Slackware version (currently: $SLACKVER)" \
|
|
||||||
"Latest" "Check for an update to sbopkg" \
|
|
||||||
2>$TMP/sbopkg_utilities_menu_answer
|
|
||||||
|
|
||||||
if [ $? != 0 ]; then
|
|
||||||
G=""
|
|
||||||
rm -f $TMP/sbopkg_utilities_menu_answer
|
|
||||||
return
|
|
||||||
fi
|
fi
|
||||||
|
while :; do
|
||||||
|
dialog --default-item "$G" --title "Utilities Menu" --backtitle \
|
||||||
|
"Currently using the SlackBuilds.org $SLACKVER repository." \
|
||||||
|
--cancel-label "Back" --menu \
|
||||||
|
"\nChoose one of the following or press <Back> to go back.\n" \
|
||||||
|
15 69 5 \
|
||||||
|
"Cache" "View the contents of the cache directory" \
|
||||||
|
"Log" "View the permanent build log" \
|
||||||
|
"Version" "Select Slackware version (currently: $SLACKVER)" \
|
||||||
|
"Latest" "Check for an update to sbopkg" \
|
||||||
|
2>$TMP/sbopkg_utilities_menu_answer
|
||||||
|
|
||||||
G="$(cat $TMP/sbopkg_utilities_menu_answer)"
|
#FIXME: remove commented code below if all ok.
|
||||||
|
#if [ $? != 0 ]; then
|
||||||
|
# G=""
|
||||||
|
# rm -f $TMP/sbopkg_utilities_menu_answer
|
||||||
|
# return
|
||||||
|
#fi
|
||||||
|
|
||||||
if [ "$G" = "Cache" ]; then
|
G="$(cat $TMP/sbopkg_utilities_menu_answer)"
|
||||||
view_cache_dir
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$G" = "Log" ]; then
|
#if [ "$G" = "Cache" ]; then
|
||||||
view_perm_log
|
# view_cache_dir
|
||||||
fi
|
#fi
|
||||||
|
|
||||||
if [ "$G" = "Version" ]; then
|
#if [ "$G" = "Log" ]; then
|
||||||
select_version
|
# view_perm_log
|
||||||
fi
|
#fi
|
||||||
|
|
||||||
if [ "$G" = "Latest" ]; then
|
#if [ "$G" = "Version" ]; then
|
||||||
check_for_latest
|
# select_version
|
||||||
fi
|
#fi
|
||||||
|
|
||||||
|
#if [ "$G" = "Latest" ]; then
|
||||||
|
# check_for_latest
|
||||||
|
#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 () {
|
||||||
|
@ -2633,21 +2665,21 @@ main_menu () {
|
||||||
R="$(cat $TMP/sbopkg_main_menu_answer)"
|
R="$(cat $TMP/sbopkg_main_menu_answer)"
|
||||||
|
|
||||||
case "$R" in
|
case "$R" in
|
||||||
"Rsync") rsync_repo ;;
|
"Rsync") rsync_repo ;;
|
||||||
"ChangeLog") show_changelog ;;
|
"ChangeLog") show_changelog ;;
|
||||||
"Packages") get_sbo_packages ;;
|
"Packages") get_sbo_packages ;;
|
||||||
"Updates") main_updates ;;
|
"Updates") main_updates ;;
|
||||||
"Browse") browse_categories ;;
|
"Browse") browse_categories ;;
|
||||||
"Search") main_search ;;
|
"Search") main_search ;;
|
||||||
"Utilities") utilities_menu ;;
|
"Utilities") utilities_menu ;;
|
||||||
"Queue") queue_menu ;;
|
"Queue") queue_menu ;;
|
||||||
*) # "Exit", or an empty string if Exit, instead of Ok,
|
*) # "Exit", or an empty string if Exit, instead of Ok,
|
||||||
# was pressed
|
# was pressed
|
||||||
save_backup_queue
|
save_backup_queue
|
||||||
clear
|
clear
|
||||||
cleanup
|
cleanup
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue