From 790593746543b563000d6ab38fdd53779cd9c9b9 Mon Sep 17 00:00:00 2001 From: slakmagik Date: Thu, 10 Mar 2011 04:17:22 +0000 Subject: [PATCH] add SBOPKG_DEBUG Set this to anything and avoid the stupid sucking side effects of redirecting stderr. Also abbreviated a comment right above what I added - it's not first run but every run and the end of functions pretty much implies the start of main. --- src/usr/sbin/sbopkg | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/usr/sbin/sbopkg b/src/usr/sbin/sbopkg index 04b0f97..9a0abef 100755 --- a/src/usr/sbin/sbopkg +++ b/src/usr/sbin/sbopkg @@ -4389,8 +4389,13 @@ main_menu() { done } -# END OF FUNCTIONS. What comes below is the actual start of the -# script when it is first run. +# END OF FUNCTIONS + +if [[ $SBOPKG_DEBUG ]]; then + exec 3>~/debug.out + BASH_XTRACEFD=3 + set -x +fi trap 'control_c; trap INT; kill -2 $$' INT trap 'exit 2' HUP QUIT PIPE TERM