merge in four patches from Mauro Giachero that do the following (1) show SVN id (2) clean up use of cancel/back and ESC -- ESC should now take you back a step in most screens (3) replace most rm -rf with rm -f and (4) improve the options dialog; thanks to Mauro for these great patches; also, other minor cleanups and dialog tweaks

This commit is contained in:
chess.griffin 2009-01-12 00:54:39 +00:00
parent f274376554
commit aec8914cdb

View File

@ -46,7 +46,7 @@ INSTALLPKGS=""
BUILDOPTIONS="" BUILDOPTIONS=""
SBOPKG_CONF="${SBOPKG_CONF:-/etc/sbopkg/sbopkg.conf}" SBOPKG_CONF="${SBOPKG_CONF:-/etc/sbopkg/sbopkg.conf}"
CWD="$(pwd)" CWD="$(pwd)"
SBOVER=SVN SBOVER=svn_r$(grep -m1 \$Id$0 |cut -d" " -f4)
config_check () { config_check () {
# Check if config file is there and if so check that it has all # Check if config file is there and if so check that it has all
@ -88,7 +88,7 @@ directory_checks () {
# If not, create them. # If not, create them.
if [ ! -d "$LOCALREPO/$SLACKVER" ]; then if [ ! -d "$LOCALREPO/$SLACKVER" ]; then
echo echo
echo "Creating local repo directory $LOCALREPO/$SLACKVER" echo "Creating local repository directory $LOCALREPO/$SLACKVER"
echo "for the rsync mirror." echo "for the rsync mirror."
echo echo
read -s -n 1 -p "Press any key to continue or Ctrl-C to exit." read -s -n 1 -p "Press any key to continue or Ctrl-C to exit."
@ -214,7 +214,7 @@ fi
get_sbo_packages () { get_sbo_packages () {
# Get a list of SBo packages # Get a list of SBo packages
SBOPKGLIST=$TMP/sbopkg_pkglist SBOPKGLIST=$TMP/sbopkg_pkglist
rm -rf $SBOPKGLIST rm -f $SBOPKGLIST
cd /var/log/packages cd /var/log/packages
PKGS=$(ls *SBo*) PKGS=$(ls *SBo*)
for i in $PKGS; do for i in $PKGS; do
@ -235,7 +235,7 @@ check_for_updates () {
# this a continual work-in-progress. :-) # this a continual work-in-progress. :-)
check_if_repo_exists check_if_repo_exists
UPDATELIST=$TMP/sbopkg_updatelist UPDATELIST=$TMP/sbopkg_updatelist
rm -rf $UPDATELIST rm -f $UPDATELIST
if [ "$DIAG" = 1 ]; then if [ "$DIAG" = 1 ]; then
dialog --title "Check for updates?" --yesno "Would you like to \ dialog --title "Check for updates?" --yesno "Would you like to \
check for updates? This is an experimental feature and should not \ check for updates? This is an experimental feature and should not \
@ -415,7 +415,7 @@ potential updates..." >> $UPDATELIST
else else
if [ "$DEBUG" -ge "1" ]; then if [ "$DEBUG" -ge "1" ]; then
echo $NAME: >> $UPDATELIST echo $NAME: >> $UPDATELIST
echo " Not in the repo." >> $UPDATELIST echo " Not in the repository." >> $UPDATELIST
fi fi
fi fi
done done
@ -479,7 +479,7 @@ go back." 15 50 4 \
"12.1" "Slackware version 12.1" \ "12.1" "Slackware version 12.1" \
"12.0" "Slackware version 12.0" \ "12.0" "Slackware version 12.0" \
"11.0" "Slackware version 11.0" 2>$TMP/sbopkg_version_selection "11.0" "Slackware version 11.0" 2>$TMP/sbopkg_version_selection
if [ $? = 1 ]; then if [ $? != 0 ]; then
break break
fi fi
SLACKVER="$(cat $TMP/sbopkg_version_selection)" SLACKVER="$(cat $TMP/sbopkg_version_selection)"
@ -489,19 +489,18 @@ $HOME/.sbopkg.conf file? (One will be created if it is not \
found).\n\nPress <Yes> to save in the user's $HOME/.sbopkg.conf or \ found).\n\nPress <Yes> to save in the user's $HOME/.sbopkg.conf or \
press <No> to continue without saving, making this a temporary \ press <No> to continue without saving, making this a temporary \
change only." 12 60 change only." 12 60
if [ $? = 1 ]; then if [ $? != 0 ]; then
break break
fi
if [ -e $HOME/.sbopkg.conf ]; then
sed -i "s/^SLACKVER.*$/SLACKVER=$SLACKVER/" $HOME/.sbopkg.conf
else else
if [ -e $HOME/.sbopkg.conf ]; then echo "SLACKVER=$SLACKVER" > $HOME/.sbopkg.conf
sed -i "s/^SLACKVER.*$/SLACKVER=$SLACKVER/" $HOME/.sbopkg.conf
else
echo "SLACKVER=$SLACKVER" > $HOME/.sbopkg.conf
fi
fi fi
break break
done done
rm -rf $TMP/sbopkg_version_selection rm -f $TMP/sbopkg_version_selection
} }
info_item () { info_item () {
@ -568,14 +567,6 @@ $JPACKAGE 2>$TMP/sbopkg_info_selection
CHOICE=$? CHOICE=$?
if [ $CHOICE = 3 ]; then if [ $CHOICE = 3 ]; then
break break
# Not sure why the following isn't working. Pressing ESC in the info
# item menu should quit the application.
elif [ $CHOICE = -1 ]; then
cleanup
exit 0
elif [ $CHOICE = 1 ]; then
rm -rf $TMP/sbopkg_*
main_menu
elif [ $CHOICE = 0 ]; then elif [ $CHOICE = 0 ]; then
U="$(cat $TMP/sbopkg_info_selection)" U="$(cat $TMP/sbopkg_info_selection)"
CATEGORY="$(cat $TMP/sbopkg_category_selection)" CATEGORY="$(cat $TMP/sbopkg_category_selection)"
@ -626,8 +617,11 @@ build queue." 8 30
if [ "$KEEPLOG" = "YES" ]; then if [ "$KEEPLOG" = "YES" ]; then
cat $SBOPKGINSTALLOUTPUT >> $TMP/sbopkg-build-log cat $SBOPKGINSTALLOUTPUT >> $TMP/sbopkg-build-log
fi fi
rm -rf $SBOPKGINSTALLOUTPUT rm -f $SBOPKGINSTALLOUTPUT
fi fi
else # ESC or Cancel
rm -f $TMP/sbopkg_*
break
fi fi
done done
} }
@ -646,10 +640,7 @@ dialog --default-item "$V" --title "$APP Customization" \
"Delete Info" "Delete the local copy of the .info file" \ "Delete Info" "Delete the local copy of the .info file" \
2>$TMP/sbopkg_custom_selection 2>$TMP/sbopkg_custom_selection
CCHOICE=$? CCHOICE=$?
if [ $CCHOICE = 1 ]; then if [ $CCHOICE = 0 ]; then
rm -rf $TMP/sbopkg_custom_selection
break
elif [ $CCHOICE = 0 ]; then
V="$(cat $TMP/sbopkg_custom_selection)" V="$(cat $TMP/sbopkg_custom_selection)"
if [ "$V" = "Edit SlackBuild" ]; then if [ "$V" = "Edit SlackBuild" ]; then
edit_local_slackbuild $APP edit_local_slackbuild $APP
@ -663,6 +654,9 @@ elif [ $CCHOICE = 0 ]; then
if [ "$V" = "Delete Info" ]; then if [ "$V" = "Delete Info" ]; then
delete_local_info $APP delete_local_info $APP
fi fi
else # Cancel or ESC
rm -f $TMP/sbopkg_custom_selection
break
fi fi
done done
} }
@ -675,15 +669,15 @@ if [ -z "$T" ]; then T="aaa"; fi
while [ 0 ]; do while [ 0 ]; do
dialog --default-item "$T" --cancel-label "Back" --title \ dialog --default-item "$T" --cancel-label "Back" --title \
"Browsing the $CATEGORY category" --backtitle "Currently using the \ "Browsing the $CATEGORY category" --backtitle "Currently using the \
SlackBuilds.org $SLACKVER repo." --menu \ SlackBuilds.org $SLACKVER repository." --menu \
"Please select a software package or press <Back> to go back." \ "Please select a software package or press <Back> to go back." \
20 70 15 --file $TMP/sbopkg_category_items_list \ 20 70 15 --file $TMP/sbopkg_category_items_list \
2>$TMP/sbopkg_item_selection 2>$TMP/sbopkg_item_selection
if [ $? = 1 ]; then if [ $? != 0 ]; then
break break
fi fi
info_item info_item
T="$(cat $TMP/sbopkg_item_selection)" T="$(cat $TMP/sbopkg_item_selection)"
done done
} }
@ -695,14 +689,14 @@ if [ -z "$S" ]; then S="Academic"; fi
while [ 0 ]; do while [ 0 ]; do
dialog --default-item "$S" --cancel-label "Back" --title \ dialog --default-item "$S" --cancel-label "Back" --title \
"Choose a category" --backtitle "Currently using the SlackBuilds.org \ "Choose a category" --backtitle "Currently using the SlackBuilds.org \
$SLACKVER repo." --menu "Please select a category or press <Back> to \ $SLACKVER repository." --menu "Please select a category or press \
go back." 20 70 14 --file $TMP/sbopkg_category_list \ <Back> to go back." 20 70 14 --file $TMP/sbopkg_category_list \
2>$TMP/sbopkg_category_selection 2>$TMP/sbopkg_category_selection
if [ $? = 1 ]; then if [ $? != 0 ]; then
break break
fi fi
browse_items browse_items
S="$(cat $TMP/sbopkg_category_selection)" S="$(cat $TMP/sbopkg_category_selection)"
done done
} }
@ -721,7 +715,7 @@ if [ "$(ls -A $SRCDIR)" ]; then
user can clear the cache directory." 8 30 user can clear the cache directory." 8 30
continue continue
else else
rm -rf $SRCDIR/* rm -f $SRCDIR/*
dialog --title "Done" --msgbox "The cache directory has been \ dialog --title "Done" --msgbox "The cache directory has been \
cleared." 8 30 cleared." 8 30
continue continue
@ -755,7 +749,7 @@ else
user can delete the build log." 8 30 user can delete the build log." 8 30
continue continue
else else
rm -rf $TMP/sbopkg-build-log rm -f $TMP/sbopkg-build-log
dialog --title "Done" --msgbox "The build log has been \ dialog --title "Done" --msgbox "The build log has been \
deleted." 8 30 deleted." 8 30
continue continue
@ -782,8 +776,8 @@ while :; do
--cancel-label "OK" \ --cancel-label "OK" \
--help-button --help-label "Cancel" \ --help-button --help-label "Cancel" \
--default-item $DEFAULTITEM \ --default-item $DEFAULTITEM \
--menu "Use the Up/Down buttons to sort the queue items, \ --menu "Use the <Up/Down> buttons to sort the queue items, \
press <OK> when done, or press <Cancel> to abort changes." 30 50 15 \ press <OK> when done, or press <Cancel> to abort changes." 30 50 14 \
$(cat -n $TMPSORTQUEUE |rev |cut -d" " -f3 |rev) \ $(cat -n $TMPSORTQUEUE |rev |cut -d" " -f3 |rev) \
2>$TMP/sbopkg-ans-sort 2>$TMP/sbopkg-ans-sort
CHOICE=$? CHOICE=$?
@ -804,10 +798,6 @@ press <OK> when done, or press <Cancel> to abort changes." 30 50 15 \
mv $TMPSORTQUEUE $TMPQUEUE mv $TMPSORTQUEUE $TMPQUEUE
break break
;; ;;
2 ) # Cancel
rm -f $TMPSORTQUEUE
break
;;
3 ) # Down 3 ) # Down
if [ $SELECTED -eq $PKGSCOUNT ]; then continue; fi if [ $SELECTED -eq $PKGSCOUNT ]; then continue; fi
head -n $(($SELECTED-1)) $TMPSORTQUEUE >$PARTIALSORT head -n $(($SELECTED-1)) $TMPSORTQUEUE >$PARTIALSORT
@ -818,6 +808,10 @@ press <OK> when done, or press <Cancel> to abort changes." 30 50 15 \
DEFAULTITEM=$(($SELECTED+1)) DEFAULTITEM=$(($SELECTED+1))
continue continue
;; ;;
* ) # Cancel or ESC
rm -f $TMPSORTQUEUE
break
;;
esac esac
done done
rm -f $TMP/sbopkg-ans-sort rm -f $TMP/sbopkg-ans-sort
@ -845,22 +839,12 @@ those packages you wish to keep in the build queue and then press \
<Ok> to continue or press <Cancel> to exit." 30 50 8 \ <Ok> to continue or press <Cancel> to exit." 30 50 8 \
--file $TMPQUEUE 2>$TMP/sbopkg-ans-queue --file $TMPQUEUE 2>$TMP/sbopkg-ans-queue
CHOICE=$? # 0 = OK, 1 = Sort, 2 = Cancel, 3 = Reverse CHOICE=$? # 0 = OK, 1 = Sort, 2 = Cancel, 3 = Reverse
if [ $CHOICE = 2 ]; then if [ $CHOICE = 0 ]; then
rm -rf $TMP/sbopkg-ans-queue
break
elif [ $CHOICE = 3 ]; then
tac $TMPQUEUE >$TMP/sbopkg-reversed-queue
mv $TMP/sbopkg-reversed-queue $TMPQUEUE
continue
elif [ $CHOICE = 1 ]; then
sort_queue $TMPQUEUE
continue
else
if [ ! -s $TMP/sbopkg-ans-queue ]; then if [ ! -s $TMP/sbopkg-ans-queue ]; then
rm -rf $TMP/sbopkg-*-queue rm -f $TMP/sbopkg-*-queue
return 0 return 0
else else
rm -rf $WORKINGQUEUE rm -f $WORKINGQUEUE
for PICK in $(cat $TMP/sbopkg-ans-queue); do for PICK in $(cat $TMP/sbopkg-ans-queue); do
echo $(egrep -m1 "^$PICK " $TMPQUEUE) >> \ echo $(egrep -m1 "^$PICK " $TMPQUEUE) >> \
$WORKINGQUEUE $WORKINGQUEUE
@ -871,6 +855,16 @@ those packages you wish to keep in the build queue and then press \
fi fi
return 0 return 0
fi fi
elif [ $CHOICE = 1 ]; then
sort_queue $TMPQUEUE
continue
elif [ $CHOICE = 3 ]; then
tac $TMPQUEUE >$TMP/sbopkg-reversed-queue
mv $TMP/sbopkg-reversed-queue $TMPQUEUE
continue
else # Cancel or ESC
rm -f $TMP/sbopkg-ans-queue
break
fi fi
fi fi
done done
@ -884,7 +878,7 @@ rsync_command () {
/usr/bin/rsync --archive --delete --no-owner --exclude="*.sbopkg" \ /usr/bin/rsync --archive --delete --no-owner --exclude="*.sbopkg" \
$RSYNCFLAGS $RSYNCMIRROR/$SLACKVER/ $LOCALREPO/$SLACKVER/ $RSYNCFLAGS $RSYNCMIRROR/$SLACKVER/ $LOCALREPO/$SLACKVER/
RSYNC_RETVAL=$? RSYNC_RETVAL=$?
rm -rf $TMP/sbopkg_rsync.lck rm -f $TMP/sbopkg_rsync.lck
if [ ! $RSYNC_RETVAL = 0 ]; then if [ ! $RSYNC_RETVAL = 0 ]; then
case $RSYNC_RETVAL in case $RSYNC_RETVAL in
35) 35)
@ -926,6 +920,7 @@ fi
rsync_repo () { rsync_repo () {
# This function does the rsync with SBo. # This function does the rsync with SBo.
directory_checks
check_write $LOCALREPO/$SLACKVER/ check_write $LOCALREPO/$SLACKVER/
if [ "$WRITE" = "false" ]; then if [ "$WRITE" = "false" ]; then
if [ "$DIAG" = 1 ]; then if [ "$DIAG" = 1 ]; then
@ -939,7 +934,7 @@ permissions on the target directory." 8 30
fi fi
fi fi
if [ "$DIAG" = 1 ]; then if [ "$DIAG" = 1 ]; then
rm -rf $TMP/sbopkg_rsync.lck rm -f $TMP/sbopkg_rsync.lck
touch $TMP/sbopkg_rsync.lck touch $TMP/sbopkg_rsync.lck
SBOPKGOUTPUT=$TMP/sbopkg_output SBOPKGOUTPUT=$TMP/sbopkg_output
( rsync_command >> $SBOPKGOUTPUT & ) 2>>$SBOPKGOUTPUT ( rsync_command >> $SBOPKGOUTPUT & ) 2>>$SBOPKGOUTPUT
@ -1020,7 +1015,7 @@ item you wish to view or press <Cancel> to exit." 20 70 14 --file \
fi fi
continue continue
else else
rm -rf $TMP/sbopkg_search_results rm -f $TMP/sbopkg_search_results
fi fi
done done
continue continue
@ -1047,7 +1042,7 @@ show_readme () {
cd $LOCALREPO/$SLACKVER cd $LOCALREPO/$SLACKVER
${PAGER:-more} $PKGPATH/{README,$PKGNAME.SlackBuild,\ ${PAGER:-more} $PKGPATH/{README,$PKGNAME.SlackBuild,\
$PKGNAME.info.build,slack-desc} $PKGNAME.info.build,slack-desc}
rm -rf $PKGPATH/$PKGNAME.info.build rm -f $PKGPATH/$PKGNAME.info.build
return 0 return 0
} }
@ -1093,7 +1088,7 @@ to keep or NO to delete." 8 40
root user can delete the sources in the cache directory." 8 30 root user can delete the sources in the cache directory." 8 30
else else
for i in $(cat $TMP/sbopkg_app_sources); do for i in $(cat $TMP/sbopkg_app_sources); do
rm -rf $SRCDIR/$i rm -f $SRCDIR/$i
done done
dialog --title "Done" --msgbox "The $APP \ dialog --title "Done" --msgbox "The $APP \
sources have been cleared." 8 30 sources have been cleared." 8 30
@ -1112,25 +1107,24 @@ add_options () {
OPTIONPKG=$1 OPTIONPKG=$1
OPTIONFILE=$LOCALREPO/$SLACKVER/$CATEGORY/$APP/options.sbopkg OPTIONFILE=$LOCALREPO/$SLACKVER/$CATEGORY/$APP/options.sbopkg
if [ ! -e $OPTIONFILE ]; then if [ ! -e $OPTIONFILE ]; then
CUROPTIONS="None" CUROPTIONS=""
else else
CUROPTIONS=$(cat $OPTIONFILE) CUROPTIONS=$(cat $OPTIONFILE)
fi fi
dialog --cancel-label "Clear Options" --inputbox "Some SlackBuild \ dialog --cancel-label "Clear Options" --inputbox "Some SlackBuild \
scripts offer the ability to pass \ scripts offer the ability to pass \
variables, or options, or flavors to the SlackBuild scripts before \ variables, or options, or flavors to the SlackBuild scripts before \
they are run. This is often noted in the README and the SlackBuild \ they are run. This is often noted in the README or the SlackBuild \
script itself. Currently, the following options, if any, are set \ script itself.\n\nIf you would like to set \
for the $1 SlackBuild:\n\n$CUROPTIONS\n\nIf you would like to set \
or edit these variables for the $1 SlackBuild, please enter that \ or edit these variables for the $1 SlackBuild, please enter that \
information below, or press <Clear Options> to clear the options." \ information below, or press <Clear Options> to clear the options." \
0 0 2>/$TMP/sbopkg_add_options 0 0 $CUROPTIONS 2>/$TMP/sbopkg_add_options
if [ $? = 1 ]; then CHOICE=$?
rm -rf $OPTIONFILE
continue
fi
CUSTOMOPTS="$(cat $TMP/sbopkg_add_options)" CUSTOMOPTS="$(cat $TMP/sbopkg_add_options)"
if [ ! "$CUSTOMOPTS" = "" ]; then if [ $CHOICE = 1 ] || [ $CHOICE = 0 -a "$CUSTOMOPTS" = "" ]; then
rm -f $OPTIONFILE
continue
elif [ $CHOICE = 0 ]; then
cp $TMP/sbopkg_add_options $OPTIONFILE cp $TMP/sbopkg_add_options $OPTIONFILE
fi fi
} }
@ -1156,7 +1150,7 @@ echo
echo "Press (Y)es to delete or (N)o to continue." echo "Press (Y)es to delete or (N)o to continue."
read ANS read ANS
case $ANS in case $ANS in
y* | Y* ) rm -rf $SRCDIR/$RMSRC ; echo "Source deleted." y* | Y* ) rm -f $SRCDIR/$RMSRC ; echo "Source deleted."
;; ;;
n* | N* ) return n* | N* ) return
;; ;;
@ -1197,8 +1191,8 @@ else
echo >> $SUMMARYLOG echo >> $SUMMARYLOG
checksum_fail $SRCNAME checksum_fail $SRCNAME
rm $SRCNAME rm $SRCNAME
rm -rf $PKG.info.build rm -f $PKG.info.build
rm -rf $PKG.SlackBuild.build rm -f $PKG.SlackBuild.build
cd $LOCALREPO/$SLACKVER cd $LOCALREPO/$SLACKVER
if [ "$BUILDPKGS" = 1 ]; then if [ "$BUILDPKGS" = 1 ]; then
echo echo
@ -1212,7 +1206,7 @@ else
case $ANS in case $ANS in
y* | Y* ) continue y* | Y* ) continue
;; ;;
n* | N* ) rm -rf $TMP/sbopkg_build.lck && return n* | N* ) rm -f $TMP/sbopkg_build.lck && return
;; ;;
* ) echo "Unknown response." * ) echo "Unknown response."
;; ;;
@ -1241,7 +1235,7 @@ if [ ! -e *.tgz ]; then
case $ANS in case $ANS in
y* | Y* ) continue y* | Y* ) continue
;; ;;
n* | N* ) rm -rf $TMP/sbopkg_build.lck && return n* | N* ) rm -f $TMP/sbopkg_build.lck && return
;; ;;
* ) echo "Unknown response." * ) echo "Unknown response."
;; ;;
@ -1263,8 +1257,8 @@ else
fi fi
cd - cd -
rm $SRCNAME rm $SRCNAME
rm -rf $PKG.info.build rm -f $PKG.info.build
rm -rf $PKG.SlackBuild.build rm -f $PKG.SlackBuild.build
OUTPUT=$OLDOUTPUT OUTPUT=$OLDOUTPUT
cd $LOCALREPO/$SLACKVER cd $LOCALREPO/$SLACKVER
} }
@ -1467,10 +1461,10 @@ else
options for \ options for \
the $OPTAPP SlackBuild were found:\n\n$TMPOPTIONS\n\nWould you like to \ the $OPTAPP SlackBuild were found:\n\n$TMPOPTIONS\n\nWould you like to \
use these options for this build?" 12 50 use these options for this build?" 12 50
if [ $? = 1 ]; then if [ $? = 0 ]; then
BUILDOPTIONS=""
else
BUILDOPTIONS=$TMPOPTIONS BUILDOPTIONS=$TMPOPTIONS
else
BUILDOPTIONS=""
fi fi
else else
while true; do while true; do
@ -1507,13 +1501,13 @@ STARTQUEUE=$TMP/sbopkg-start-queue
FINALQUEUE=$TMP/sbopkg-final-queue FINALQUEUE=$TMP/sbopkg-final-queue
PRECHECKLOG=$TMP/sbopkg_precheck_log PRECHECKLOG=$TMP/sbopkg_precheck_log
SUMMARYLOG=$TMP/sbopkg_summary SUMMARYLOG=$TMP/sbopkg_summary
rm -rf $SBOPKGTMPOUTPUT $FINALQUEUE $PRECHECKLOG $SUMMARYLOG rm -f $SBOPKGTMPOUTPUT $FINALQUEUE $PRECHECKLOG $SUMMARYLOG
check_root check_root
if [ $ROOT = "false" ]; then if [ $ROOT = "false" ]; then
if [ "$DIAG" = 1 ]; then if [ "$DIAG" = 1 ]; then
dialog --title "ERROR" --msgbox "You must run this script \ dialog --title "ERROR" --msgbox "You must run this script \
as the root user in order to build packages." 8 30 as the root user in order to build packages." 8 30
rm -rf $STARTQUEUE $FINALQUEUE $PRECHECKLOG $SUMMARYLOG rm -f $STARTQUEUE $FINALQUEUE $PRECHECKLOG $SUMMARYLOG
continue continue
else else
echo "You must run this script as the root user in order \ echo "You must run this script as the root user in order \
@ -1577,8 +1571,8 @@ edits." 8 30
dialog --title "Begin?" --yes-label "Ok" --no-label "Cancel" \ dialog --title "Begin?" --yes-label "Ok" --no-label "Cancel" \
--yesno "The build queue is ready to process. Press <Ok> to \ --yesno "The build queue is ready to process. Press <Ok> to \
continue or <Cancel> to return to the main menu." 8 40 continue or <Cancel> to return to the main menu." 8 40
if [ $? = 1 ]; then if [ $? != 0 ]; then
rm -rf $STARTQUEUE $FINALQUEUE $PRECHECKLOG $SUMMARYLOG rm -f $STARTQUEUE $FINALQUEUE $PRECHECKLOG $SUMMARYLOG
continue continue
fi fi
else else
@ -1612,7 +1606,7 @@ else
echo $CHKBUILD >> $FINALQUEUE echo $CHKBUILD >> $FINALQUEUE
done done
fi fi
rm -rf $TMP/sbopkg_build.lck rm -f $TMP/sbopkg_build.lck
touch $TMP/sbopkg_build.lck touch $TMP/sbopkg_build.lck
for PKGBUILD in $(cat $FINALQUEUE); do for PKGBUILD in $(cat $FINALQUEUE); do
search_package $PKGBUILD search_package $PKGBUILD
@ -1625,7 +1619,7 @@ for PKGBUILD in $(cat $FINALQUEUE); do
echo >> $SUMMARYLOG echo >> $SUMMARYLOG
fi fi
done done
rm -rf $TMP/sbopkg_build.lck rm -f $TMP/sbopkg_build.lck
echo "******************************************" >> $SUMMARYLOG echo "******************************************" >> $SUMMARYLOG
cat $SUMMARYLOG cat $SUMMARYLOG
if [ "$DIAG" = 1 ]; then if [ "$DIAG" = 1 ]; then
@ -1636,7 +1630,7 @@ if [ -e $TMP/sbopkg-tmp-queue ]; then
"Delete" --yesno "Would you like to keep the build queue or \ "Delete" --yesno "Would you like to keep the build queue or \
would you like to delete it?" 8 35 would you like to delete it?" 8 35
if [ $? = 1 ]; then if [ $? = 1 ]; then
rm -rf $TMP/sbopkg-tmp-queue rm -f $TMP/sbopkg-tmp-queue
dialog --title "Done" --msgbox "The build queue has been \ dialog --title "Done" --msgbox "The build queue has been \
deleted." 8 35 deleted." 8 35
fi fi
@ -1647,7 +1641,7 @@ if [ "$KEEPLOG" = "YES" ]; then
fi fi
BUILDPKGS="" BUILDPKGS=""
INSTALLPKGS="" INSTALLPKGS=""
rm -rf $SBOPKGOUTPUT $STARTQUEUE $FINALQUEUE $PRECHECKLOG $SUMMARYLOG rm -f $SBOPKGOUTPUT $STARTQUEUE $FINALQUEUE $PRECHECKLOG $SUMMARYLOG
} }
check_for_latest () { check_for_latest () {
@ -1691,8 +1685,9 @@ utilities_menu () {
if [ -z "$G" ] ; then G="Cache" ; fi if [ -z "$G" ] ; then G="Cache" ; fi
while [ 0 ]; do while [ 0 ]; do
dialog --default-item "$G" --title "Utilities" --backtitle \ dialog --default-item "$G" --title "Utilities" --backtitle \
"Currently using the SlackBuilds.org $SLACKVER repo." --menu \ "Currently using the SlackBuilds.org $SLACKVER repository." \
"\nChoose one of the following or press <Cancel> to return.\n" \ --cancel-label "Back" --menu \
"\nChoose one of the following or press <Back> to go back.\n" \
18 69 5 \ 18 69 5 \
"Cache" "View the contents of the cache directory" \ "Cache" "View the contents of the cache directory" \
"Log" "View the permanent build log" \ "Log" "View the permanent build log" \
@ -1700,7 +1695,7 @@ dialog --default-item "$G" --title "Utilities" --backtitle \
"Latest" "Check for an update to sbopkg" \ "Latest" "Check for an update to sbopkg" \
2>$TMP/sbopkg_utilities_menu_answer 2>$TMP/sbopkg_utilities_menu_answer
if [ $? = 1 ]; then if [ $? != 0 ]; then
return return
fi fi
@ -1742,10 +1737,10 @@ if [ $WRITE = "false" ]; then
echo echo
exit 0 exit 0
else else
rm -rf $TMP/sbopkg_* rm -f $TMP/sbopkg_*
rm -rf $TMP/sbopkgpidlist rm -f $TMP/sbopkgpidlist
rm -rf $TMP/sbooutput rm -f $TMP/sbooutput
rm -rf $TMP/sbopkg-*-queue rm -f $TMP/sbopkg-*-queue
rm -f $PIDFILE rm -f $PIDFILE
fi fi
cd $CWD cd $CWD
@ -1762,7 +1757,7 @@ if [ -e $TMP/sbopkgpidlist ]; then
echo "killing $pid" echo "killing $pid"
kill -9 $pid; kill -9 $pid;
done; done;
rm -rf $TMP/sbopkgpidlist rm -f $TMP/sbopkgpidlist
fi fi
if [ "$DIAG" = 1 ]; then if [ "$DIAG" = 1 ]; then
#rm -rf $TMP/sbopkg_* #rm -rf $TMP/sbopkg_*
@ -1779,21 +1774,21 @@ if [ -z "$R" ] ; then R="Rsync" ; fi
while [ 0 ]; do while [ 0 ]; do
dialog --default-item "$R" --title "SlackBuilds.org Package Browser \ dialog --default-item "$R" --title "SlackBuilds.org Package Browser \
(sbopkg version $SBOVER)" --backtitle "Currently using the \ (sbopkg version $SBOVER)" --backtitle "Currently using the \
SlackBuilds.org $SLACKVER repo." --menu \ SlackBuilds.org $SLACKVER repository." --menu \
"\nChoose one of the following or press <Cancel> to exit.\n" \ "\nChoose one of the following or press <Cancel> to exit.\n" \
23 69 10 \ 23 69 10 \
"Rsync" "Rsync with SlackBuilds.org" \ "Rsync" "Rsync with SlackBuilds.org" \
"ChangeLog" "View the SlackBuilds.org ChangeLog" \ "ChangeLog" "View the SlackBuilds.org ChangeLog" \
"Packages" "List installed SBo packages" \ "Packages" "List installed SBo packages" \
"Updates" "List potential updates to installed SBo packages" \ "Updates" "List potential updates to installed SBo packages" \
"Browse" "Browse the local SlackBuilds.org repo" \ "Browse" "Browse the local SlackBuilds.org repository" \
"Search" "Search the local SlackBuilds.org repo" \ "Search" "Search the local SlackBuilds.org repository" \
"View" "View the build queue" \ "View" "View the build queue" \
"Queue" "Process the build queue" \ "Queue" "Process the build queue" \
"Utilities" "Go to the utilities menu" \ "Utilities" "Go to the utilities menu" \
"Exit" "Exit sbopkg" 2>$TMP/sbopkg_main_menu_answer "Exit" "Exit sbopkg" 2>$TMP/sbopkg_main_menu_answer
if [ $? = 1 ]; then if [ $? != 0 ]; then
clear clear
cleanup cleanup
exit 0 exit 0
@ -1814,7 +1809,7 @@ if [ "$R" = "Packages" ]; then
fi fi
if [ "$R" = "Updates" ]; then if [ "$R" = "Updates" ]; then
rm -rf $TMP/sbopkg-update-queue rm -f $TMP/sbopkg-update-queue
check_for_updates check_for_updates
if [ -e $TMP/sbopkg-update-queue ]; then if [ -e $TMP/sbopkg-update-queue ]; then
dialog --title "Add Updates to Queue?" --yesno \ dialog --title "Add Updates to Queue?" --yesno \
@ -1822,7 +1817,7 @@ if [ "$R" = "Updates" ]; then
8 35 8 35
if [ $? = 0 ]; then if [ $? = 0 ]; then
cat $TMP/sbopkg-update-queue >> $TMP/sbopkg-tmp-queue cat $TMP/sbopkg-update-queue >> $TMP/sbopkg-tmp-queue
rm -rf $TMP/sbopkg-update-queue rm -f $TMP/sbopkg-update-queue
dialog --title "Done" --msgbox "The flagged updates \ dialog --title "Done" --msgbox "The flagged updates \
have been added to the build queue." 8 30 have been added to the build queue." 8 30
fi fi
@ -1836,8 +1831,8 @@ fi
if [ "$R" = "Search" ]; then if [ "$R" = "Search" ]; then
check_if_repo_exists check_if_repo_exists
dialog --inputbox "Enter the name of a package you would like \ dialog --inputbox "Enter the name of a package you would like \
to search for" 0 0 2>/$TMP/sbopkg_search_request to search for:" 9 40 2>/$TMP/sbopkg_search_request
if [ $? = 1 ]; then if [ $? != 0 ]; then
continue continue
fi fi
SRCH="$(cat $TMP/sbopkg_search_request)" SRCH="$(cat $TMP/sbopkg_search_request)"