From a6c58f454d4bcb5d38706022374ade803dbd79b2 Mon Sep 17 00:00:00 2001 From: nemetho Date: Fri, 5 Jan 2018 05:24:27 +0100 Subject: [PATCH] fix-update: pacman- (package manager) -two-group install/remove utility - while loop doesn't break from function --- scripts/manage/installpkg | 86 ++++++++++++++++++++++------------------------- 1 file changed, 40 insertions(+), 46 deletions(-) diff --git a/scripts/manage/installpkg b/scripts/manage/installpkg index b55d8dc..395ffb5 100755 --- a/scripts/manage/installpkg +++ b/scripts/manage/installpkg @@ -75,50 +75,6 @@ else fi } -noinfodialog() -{ - choice=`$DIALOG --backtitle "Install packages" --stdout \ - --title "" --ok-label "Add" --cancel-label "Back" \ - --checklist "Select packages" 20 61 15 \ - $(pkgmenu) 2> /dev/null` - retval=$? - case $retval in - 0) - if [ ! -z "$choice" ]; then - echo -n "$choice " >> $tempfile - break - fi - ;; - *) break;; - esac -} - -infodialog() -{ - choice=`$DIALOG --backtitle "Install packages" --stdout \ - --title "" --default-item "${choice//\"/}" --ok-label "Add" \ - --extra-button --extra-label "Info" --cancel-label "Back" \ - --checklist "Select packages" 20 61 15 \ - $(pkgmenu) 2> /dev/null` - retval=$? - case $retval in - 0) - if [ ! -z "$choice" ]; then - echo -n "$choice " >> $tempfile - break - fi - ;; - 3) - if [ ! -z "$choice" ]; then - for i in $choice; do - $DIALOG --title "${i//\"/}" --msgbox "Description:\n\n$(grep "^${GRPPAIR/,/ } ${i//\"/} " $DATABASE | cut -d " " -f 6-)" 10 61 2> /dev/null - done - fi - ;; - *) break;; - esac -} - setupdialog() { choice=`$DIALOG --backtitle "instpkg settings" --stdout \ @@ -155,9 +111,47 @@ case $retval in if [ ! -z "$GRPPAIR" ]; then while true; do if [ $infobutton ]; then - infodialog + #if ... not in function - break doesn't work from function + choice=`$DIALOG --backtitle "Install packages" --stdout \ + --title "" --default-item "${choice//\"/}" --ok-label "Add" \ + --extra-button --extra-label "Info" --cancel-label "Back" \ + --checklist "Select packages" 20 61 15 \ + $(pkgmenu) 2> /dev/null` + retval=$? + case $retval in + 0) + if [ ! -z "$choice" ]; then + echo -n "$choice " >> $tempfile + break + fi + ;; + 3) + if [ ! -z "$choice" ]; then + for i in $choice; do + $DIALOG --title "${i//\"/}" --msgbox "Description:\n\n$(grep "^${GRPPAIR/,/ } ${i//\"/} " $DATABASE | cut -d " " -f 6-)" 10 61 2> /dev/null + done + fi + ;; + *) break;; + esac + #if else - noinfodialog + #if ... not in function - break doesn't work from function + choice=`$DIALOG --backtitle "Install packages" --stdout \ + --title "" --ok-label "Add" --cancel-label "Back" \ + --checklist "Select packages" 20 61 15 \ + $(pkgmenu) 2> /dev/null` + retval=$? + case $retval in + 0) + if [ ! -z "$choice" ]; then + echo -n "$choice " >> $tempfile + break + fi + ;; + *) break;; + esac + #if fi done fi -- 2.11.4.GIT