add two calls to the new add_item_to_queue function, one in the info_item menu (where users add individual items) and in the search results dialog; also add in the code to add_item_to_queue that replaces APP if the user so chooses.

This commit is contained in:
chess.griffin 2009-01-20 04:03:06 +00:00
parent a2654dd298
commit 736b669f67

View file

@ -636,14 +636,15 @@ info_item () {
add_options $APP add_options $APP
fi fi
if [ "$U" = "Queue" ]; then if [ "$U" = "Queue" ]; then
if $(cat $TMP/sbopkg-tmp-queue | grep -q "^$APP "); then add_item_to_queue $APP $RVERSION $RBUILD
dialog --title "ERROR" --msgbox \ #if $(cat $TMP/sbopkg-tmp-queue | grep -q "^$APP "); then
"$APP is already in the queue." 8 30 # dialog --title "ERROR" --msgbox \
else # "$APP is already in the queue." 8 30
echo "$APP $RVERSION-$RBUILD ON" >> $TMP/sbopkg-tmp-queue #else
dialog --title "Done" --msgbox \ # echo "$APP $RVERSION-$RBUILD ON" >> $TMP/sbopkg-tmp-queue
"$APP has been added to the build queue." 8 30 # dialog --title "Done" --msgbox \
fi # "$APP has been added to the build queue." 8 30
#fi
fi fi
if [ "$U" = "Build" ]; then if [ "$U" = "Build" ]; then
echo "$APP" > $TMP/sbopkg-start-queue echo "$APP" > $TMP/sbopkg-start-queue
@ -1034,18 +1035,23 @@ add_item_to_queue () {
VERSION=$2 VERSION=$2
BUILD=$3 BUILD=$3
TMPQUEUE=$TMP/sbopkg-tmp-queue TMPQUEUE=$TMP/sbopkg-tmp-queue
if $(cat $TMP/sbopkg-tmp-queue | grep -q "^$APP "); then if $(cat $TMPQUEUE | grep -q "^$APP "); then
dialog --title "ERROR" --yesno "$(crunch "$APP is already in the \ dialog --title "ERROR" --yesno "$(crunch "$APP is already in the \
queue. Do you want to replace it? Press <Yes> to replace or \ queue. Do you want to replace it? Press <Yes> to replace or \
press <No> to skip.")" 10 30 press <No> to skip.")" 10 30
if [ $? = 0 ]; then if [ $? = 0 ]; then
continue # need to add the replace code here sed -i "s/^$APP .*$/$APP $VERSION-$BUILD ON/" $TMPQUEUE
else else
dialog --title "Skipped" --msgbox "$(crunch "$APP was \
skipped.")" 8 30
return return
fi fi
else else
echo "$APP $VERSION-$BUILD ON" >> $TMP/sbopkg-tmp-queue echo "$APP $VERSION-$BUILD ON" >> $TMP/sbopkg-tmp-queue
fi fi
# We need to add a test if this is being done via an update so the user
# does not get the following message after each individual app has been
# added but only at the end.
dialog --title "Done" --msgbox "$APP has been added to the build queue." 8 30 dialog --title "Done" --msgbox "$APP has been added to the build queue." 8 30
} }
@ -1239,19 +1245,20 @@ gen_search_package () {
cd $LOCALREPO/$SLACKVER cd $LOCALREPO/$SLACKVER
info_item info_item
elif [ $CHOICE = 3 ]; then elif [ $CHOICE = 3 ]; then
if [ ! -e $TMP/sbopkg-tmp-queue ]; then add_item_to_queue $SRCHPKG $RVERSION $RBUILD
touch $TMP/sbopkg-tmp-queue #if [ ! -e $TMP/sbopkg-tmp-queue ]; then
fi # touch $TMP/sbopkg-tmp-queue
if $(cat $TMP/sbopkg-tmp-queue | \ #fi
grep -q "^$SRCHPKG "); then #if $(cat $TMP/sbopkg-tmp-queue | \
dialog --title "ERROR" --msgbox \ #grep -q "^$SRCHPKG "); then
"$SRCHPKG is already in the queue." 8 30 # dialog --title "ERROR" --msgbox \
else # "$SRCHPKG is already in the queue." 8 30
echo "$SRCHPKG $RVERSION-$RBUILD ON" >> \ #else
$TMP/sbopkg-tmp-queue # echo "$SRCHPKG $RVERSION-$RBUILD ON" >> \
dialog --title "Done" --msgbox \ # $TMP/sbopkg-tmp-queue
"$SRCHPKG has been added to the build queue." 8 30 # dialog --title "Done" --msgbox \
fi # "$SRCHPKG has been added to the build queue." 8 30
#fi
continue continue
else else
rm -f $TMP/sbopkg_search_results rm -f $TMP/sbopkg_search_results