remove the 'read sbopkg README' from main menu -- it was sort of pointless; add ability to add any of the individual search results to build queue from the search results screen; remove a bit of cruft.

This commit is contained in:
chess.griffin 2009-01-09 17:49:10 +00:00
parent 76ec9804f5
commit 35f812a928

View File

@ -504,23 +504,6 @@ done
rm -rf $TMP/sbopkg_version_selection
}
sbopkg_readme () {
# Show the sbopkg README
cd /usr/share/doc/sbopkg-$SBOVER
if [ "$DIAG" = 1 ]; then
if [ ! -e ./README ]; then
dialog --title "ERROR" --msgbox "It appears the sbopkg \
documents have not been installed as the README cannot be found." 10 30
continue
else
dialog --title "sbopkg README" --textbox ./README 0 0
fi
else
${PAGER:-more} ./README
fi
cd -
}
info_item () {
# This function shows the menu for each package where the user can see
# certain information or build the package if he is root.
@ -1003,17 +986,36 @@ if [ -n "$RESULTS" ]; then
echo "\"$i\" \"$DESC\"" >> $TMP/sbopkg_search_results
done
while [ -f $TMP/sbopkg_search_results ]; do
dialog --title "Matches for $PKG" --menu "Please select an \
dialog --title "Matches for $PKG" --extra-button \
--extra-label "Add to Queue" --menu "Please select an \
item you wish to view or press <Cancel> to exit." 20 70 14 --file \
$TMP/sbopkg_search_results 2>$TMP/sbopkg_search_choice
if [ ! $? = 1 ]; then
SRCHPICK="$(cat $TMP/sbopkg_search_choice)"
SRCHCAT=$(echo $SRCHPICK | sed -e 's/\/.*$//')
SRCHPKG=$(echo $SRCHPICK | sed -e 's/^.*\///')
CHOICE=$?
SRCHPICK="$(cat $TMP/sbopkg_search_choice)"
SRCHCAT=$(echo $SRCHPICK | sed -e 's/\/.*$//')
SRCHPKG=$(echo $SRCHPICK | sed -e 's/^.*\///')
RVERSION=$(grep VERSION $LOCALREPO/$SLACKVER/$SRCHCAT/$SRCHPKG/$SRCHPKG.info | cut -d= -f2 | sed s/\"//g)
RBUILD=$(egrep -m1 "^BUILD" $LOCALREPO/$SLACKVER/$SRCHCAT/$SRCHPKG/$SRCHPKG.SlackBuild | sed -e 's/^.*[=-]//;s/\"//;s/[ #}\t].*$//g;s/\"//g')
if [ $CHOICE = 0 ]; then
echo $SRCHCAT > $TMP/sbopkg_category_selection
echo $SRCHPKG > $TMP/sbopkg_item_selection
cd $LOCALREPO/$SLACKVER
info_item
elif [ $CHOICE = 3 ]; then
if [ ! -e $TMP/sbopkg-tmp-queue ]; then
touch $TMP/sbopkg-tmp-queue
fi
if $(cat $TMP/sbopkg-tmp-queue | \
grep -q "^$SRCHPKG "); then
dialog --title "ERROR" --msgbox \
"$SRCHPKG is already in the queue." 8 30
else
echo "$SRCHPKG $RVERSION-$RBUILD ON" >> \
$TMP/sbopkg-tmp-queue
dialog --title "Done" --msgbox \
"$SRCHPKG has been added to the build queue." 8 30
fi
continue
else
rm -rf $TMP/sbopkg_search_results
fi
@ -1749,7 +1751,6 @@ dialog --default-item "$R" --title "SlackBuilds.org Package Browser \
"Log" "View the permanent build log" \
"Version" "Select Slackware version (currently: $SLACKVER)" \
"Latest" "Check for an update to sbopkg" \
"Readme" "View the sbopkg README" \
"Exit" "Exit sbopkg" 2>$TMP/sbopkg_main_menu_answer
if [ $? = 1 ]; then
@ -1779,9 +1780,6 @@ if [ "$R" = "Updates" ]; then
dialog --title "Add Updates to Queue?" --yesno \
"Would you like to add the flagged updates to the build queue?" \
8 35
#if [ $? = 1 ]; then
# continue
#fi
if [ $? = 0 ]; then
cat $TMP/sbopkg-update-queue >> $TMP/sbopkg-tmp-queue
rm -rf $TMP/sbopkg-update-queue
@ -1833,10 +1831,6 @@ if [ "$R" = "Latest" ]; then
check_for_latest
fi
if [ "$R" = "Readme" ]; then
sbopkg_readme
fi
if [ "$R" = "Exit" ]; then
clear
cleanup