make list_packages() loop

Wrap list_packages()'s main dialog widget in a while loop so the user
can return to deletion selection after reading readmes. Also correct the
text in the widget (s/uninstall/remove./).
This commit is contained in:
slakmagik 2011-03-07 01:26:32 +00:00
parent c3eb9de996
commit 2adf86f041

View File

@ -450,10 +450,11 @@ list_packages() {
-printf "%P\n" 2> /dev/null | sort > $PKG_LIST
if [[ -s $PKG_LIST ]]; then
if [[ $DIAG ]]; then
while :; do
sed 's/$/ "" OFF/' $PKG_LIST > $PKG_CHECKLIST
dialog --separate-output --title "Installed $REPO_NAME Packages" \
--extra-button --extra-label "View READMEs" \
--checklist "Check any packages you wish to uninstall" \
--checklist "Check any packages you wish to remove." \
20 65 13 --file $PKG_CHECKLIST 2> $REMOVE_LIST
case $? in
0)
@ -466,14 +467,19 @@ list_packages() {
if [[ $? == 0 ]]; then
removepkg $(cat $REMOVE_LIST)
read -n1 -ep "Press any key to continue: "
break
fi
else
break
fi
;;
3)
nvabt2n $PKG_LIST $README_LIST
view_readmes "Installed packages:" $README_LIST
;;
*) break ;;
esac
done
else
$PAGER $PKG_LIST
fi