add ability to view the sbopkg-build-log from the main menu; add error check to warn user if log is not found; add ability for user to keep or delete the sbopkg-build-log after viewing it

This commit is contained in:
chess.griffin 2008-03-29 14:45:22 +00:00
parent 1f626db742
commit 029ef04293

View File

@ -259,6 +259,30 @@ dialog --title "Displaying $SRCDIR" \
--textbox $TMP/sbopkg_cache_dir 0 0
}
view_perm_log () {
# This function displays the contents of the permanent build log,
# which is kept if KEEPLOG is set to YES in the config file
if [ ! -e $TMP/sbopkg-build-log ]; then
dialog --title "ERROR" --msgbox "No permanent log \
sbopkg-build-log found. Please make sure KEEPLOG is set to YES \
in the configuration file." 0 0
continue
else
dialog --title "Displaying $TMP/sbopkg-build-log" \
--textbox $TMP/sbopkg-build-log 0 0
dialog --title "Keep Log?" --yesno "Would you like to keep the \
permanent build log $TMP/sbopkg-build-log? Select YES to keep or NO
to delete." 0 0
#2>$TMP/sbopkg_keep_log
if [ $? = 1 ]; then
rm -rf $TMP/sbopkg-build-log
continue
else
continue
fi
fi
}
rsync_command () {
# This function holds the rsync command
/usr/bin/rsync -avz --delete --timeout=5 --exclude="*.sbopkg" \
@ -423,11 +447,12 @@ while [ 0 ]; do
dialog --title "SlackBuilds.org Package Browser \
(sbopkg version $VER)" --menu \
"\nChoose one of the following or press <Cancel> to exit\n" \
15 60 5 \
15 60 6 \
"Rsync" "Rsync with SlackBuilds.org" \
"ChangeLog" "View the SlackBuilds.org ChangeLog" \
"Browse" "Browse the local SlackBuilds.org repo" \
"Cache" "View the contents of the cache directory" \
"Log" "View the permanent build log" \
"Exit" "Exit sbopkg" 2>$TMP/sbopkg_main_menu_answer
if [ $? = 1 ]; then
@ -454,6 +479,10 @@ if [ "$R" = "Cache" ]; then
view_cache_dir
fi
if [ "$R" = "Log" ]; then
view_perm_log
fi
if [ "$R" = "Exit" ]; then
clear
cleanup