From 029ef0429341f704b28dce92c5365a5b4c0968f9 Mon Sep 17 00:00:00 2001 From: "chess.griffin" Date: Sat, 29 Mar 2008 14:45:22 +0000 Subject: [PATCH] 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 --- src/usr/bin/sbopkg | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/src/usr/bin/sbopkg b/src/usr/bin/sbopkg index dfdd7c2..2ccb75a 100755 --- a/src/usr/bin/sbopkg +++ b/src/usr/bin/sbopkg @@ -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 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