Fixed bugs in debugger logic, it simply wasn't working at all, things were out of place, fails to run when needed.

This commit is contained in:
inxi-svn 2008-12-13 21:15:51 +00:00
parent 3bb0d7d087
commit a2a6dc0aeb

25
inxi
View file

@ -1,8 +1,8 @@
#!/bin/bash
########################################################################
#### Script Name: inxi
#### version: 0.8.5
#### Date: December 4 2008
#### version: 0.8.6
#### Date: December 13 2008
########################################################################
#### inxi is a fork of infobash 3.02, the original bash sys info script by locsmif
#### As time permits functionality improvements and recoding will occur.
@ -110,9 +110,6 @@ A_PARTITION_DATA=''
A_X_DATA=''
### Boolean true/false globals
# check to make sure initial steps run without error for debugging
# inxi hasn't been 'booted' yet.
B_ALL_UP='false'
# flag to allow distro maintainers to turn off update features. If false, turns off
# -U and -! testing/advanced update options, as well as removing the -U help menu item
B_ALLOW_UPDATE='true'
@ -306,18 +303,19 @@ error_handler()
exit $1
}
# args: $1 - $@ debugging string text; $2 - type: missing-app/all-up
script_debugger()
{
local a_debug_buffer=''
if [[ $B_ALL_UP == 'true' ]];then
if [[ $DEBUG -eq 0 ]];then
if [[ $2 == 'all-up' || $2 == 'missing-app' ]];then
# only return if not app missing or no debugger
if [[ $DEBUG -eq 0 && $2 != 'missing-app' ]];then
return
fi
if [[ $DEBUG_BUFFER_INDEX -gt 0 ]];then
elif [[ $DEBUG_BUFFER_INDEX -gt 0 ]];then
for (( DEBUG_BUFFER_INDEX=0; DEBUG_BUFFER_INDEX < ${#a_debug_buffer[@]}; DEBUG_BUFFER_INDEX++ ))
do
print_screen_output "${a_debug_buffer[DEBUG_BUFFER_INDEX]}"
print_screen_output "${a_debug_buffer[$DEBUG_BUFFER_INDEX]}"
done
DEBUG_BUFFER_INDEX=0
fi
@ -421,13 +419,12 @@ check_script_depends()
if [[ ! -d /proc/ ]];then
error_handler 6
fi
if [[ $B_X_RUNNING == 'true' ]];then
for app_name in xrandr xdpyinfo glxinfo
do
app_data=$( type -p $app_name )
if [[ -z $app_data ]];then
script_debugger "Resuming in non X mode: $app_name not found in path"
script_debugger "Resuming in non X mode: $app_name not found in path" 'missing-app'
B_X_RUNNING='false'
break
fi
@ -2734,8 +2731,8 @@ if [[ $COLOR_SCHEME_SET != 'true' ]];then
set_color_scheme "$DEFAULT_SCHEME"
fi
B_ALL_UP='true'
script_debugger "B_ALL_UP=true : inxi up and running.."
# all the pre-start stuff is in place now
script_debugger "Debugger: inxi is up and running..." 'all-up'
# then create the output
print_it_out