mirror of
https://github.com/sbopkg/sbopkg
synced 2024-09-19 22:40:19 +03:00
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:
parent
c3eb9de996
commit
2adf86f041
@ -450,30 +450,36 @@ list_packages() {
|
|||||||
-printf "%P\n" 2> /dev/null | sort > $PKG_LIST
|
-printf "%P\n" 2> /dev/null | sort > $PKG_LIST
|
||||||
if [[ -s $PKG_LIST ]]; then
|
if [[ -s $PKG_LIST ]]; then
|
||||||
if [[ $DIAG ]]; then
|
if [[ $DIAG ]]; then
|
||||||
sed 's/$/ "" OFF/' $PKG_LIST > $PKG_CHECKLIST
|
while :; do
|
||||||
dialog --separate-output --title "Installed $REPO_NAME Packages" \
|
sed 's/$/ "" OFF/' $PKG_LIST > $PKG_CHECKLIST
|
||||||
--extra-button --extra-label "View READMEs" \
|
dialog --separate-output --title "Installed $REPO_NAME Packages" \
|
||||||
--checklist "Check any packages you wish to uninstall" \
|
--extra-button --extra-label "View READMEs" \
|
||||||
20 65 13 --file $PKG_CHECKLIST 2> $REMOVE_LIST
|
--checklist "Check any packages you wish to remove." \
|
||||||
case $? in
|
20 65 13 --file $PKG_CHECKLIST 2> $REMOVE_LIST
|
||||||
0)
|
case $? in
|
||||||
if [[ -s $REMOVE_LIST ]]; then
|
0)
|
||||||
sed 's/$/ "" ON/' $REMOVE_LIST > $CONFIRM_LIST
|
if [[ -s $REMOVE_LIST ]]; then
|
||||||
dialog --separate-output --defaultno \
|
sed 's/$/ "" ON/' $REMOVE_LIST > $CONFIRM_LIST
|
||||||
--title "Removepkg confirmation" \
|
dialog --separate-output --defaultno \
|
||||||
--checklist "Remove the following packages?" 20 65 13 \
|
--title "Removepkg confirmation" \
|
||||||
--file $CONFIRM_LIST 2> $REMOVE_LIST
|
--checklist "Remove the following packages?" 20 65 13 \
|
||||||
if [[ $? == 0 ]]; then
|
--file $CONFIRM_LIST 2> $REMOVE_LIST
|
||||||
removepkg $(cat $REMOVE_LIST)
|
if [[ $? == 0 ]]; then
|
||||||
read -n1 -ep "Press any key to continue: "
|
removepkg $(cat $REMOVE_LIST)
|
||||||
|
read -n1 -ep "Press any key to continue: "
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
break
|
||||||
fi
|
fi
|
||||||
fi
|
;;
|
||||||
;;
|
3)
|
||||||
3)
|
nvabt2n $PKG_LIST $README_LIST
|
||||||
nvabt2n $PKG_LIST $README_LIST
|
view_readmes "Installed packages:" $README_LIST
|
||||||
view_readmes "Installed packages:" $README_LIST
|
;;
|
||||||
;;
|
*) break ;;
|
||||||
esac
|
esac
|
||||||
|
done
|
||||||
else
|
else
|
||||||
$PAGER $PKG_LIST
|
$PAGER $PKG_LIST
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user