From 105e182449d2a29f008d82e490d2764c7b1997f6 Mon Sep 17 00:00:00 2001 From: slakmagik Date: Mon, 7 Mar 2011 01:26:56 +0000 Subject: [PATCH] modify view_queue() to use selection_state() Traded a block of code for the function call and removed references to the now unused WORKINGQUEUE. --- src/usr/sbin/sbopkg | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/usr/sbin/sbopkg b/src/usr/sbin/sbopkg index 003bcb4..fa8fb43 100755 --- a/src/usr/sbin/sbopkg +++ b/src/usr/sbin/sbopkg @@ -2107,7 +2107,6 @@ view_queue() { # Returns 0 if the user choose OK, nonzero otherwise local ANSQUEUE=$SBOPKGTMP/sbopkg-ans-queue - local WORKINGQUEUE=$SBOPKGTMP/sbopkg-working-queue local ORIGINALQUEUE=$SBOPKGTMP/sbopkg-original-queue local CHOICE @@ -2131,17 +2130,7 @@ view_queue() { # Strip that damn "HELP " text when choosing the HELP dialog button [[ $CHOICE -eq 2 ]] && sed -i 's:^HELP ::g' $ANSQUEUE - rm -f $WORKINGQUEUE - # Reading from $TMPQUEUE... - while read PICK; do - TESTAPP="${PICK// */}" - if grep -qx "$TESTAPP" $ANSQUEUE; then - sed 's/OFF$/ON/' <<< "$PICK" >> $WORKINGQUEUE - else - sed 's/ON$/OFF/' <<< "$PICK" >> $WORKINGQUEUE - fi - done < $TMPQUEUE - mv $WORKINGQUEUE $TMPQUEUE + selection_state preserve $TMPQUEUE $ANSQUEUE case $CHOICE in 0) # OK @@ -2155,7 +2144,7 @@ view_queue() { ;; *) # Cancel or ESC mv $ORIGINALQUEUE $TMPQUEUE - rm -f $WORKINGQUEUE $ANSQUEUE + rm -f $ANSQUEUE return 1 ;; esac