Change version:

Bug fix, added in globals B_DCOP / B_QDBUS for pretests of dcop/qdbus. Need to set both because some systems have both.

Bug fix, added squashfs and unionfs to excluded fs types to clean up -p output for partition data
This commit is contained in:
inxi-svn 2010-06-11 03:44:19 +00:00
parent d35ed8b8e2
commit f4d3d7a4e9

25
inxi
View file

@ -1,8 +1,8 @@
#!/bin/bash #!/bin/bash
######################################################################## ########################################################################
#### Script Name: inxi #### Script Name: inxi
#### version: 1.4.9 #### version: 1.4.10
#### Date: April 9 2010 #### Date: June 10 2010
######################################################################## ########################################################################
#### SPECIAL THANKS #### SPECIAL THANKS
######################################################################## ########################################################################
@ -203,6 +203,8 @@ B_ALLOW_UPDATE='true'
B_CPU_FLAGS_FULL='false' B_CPU_FLAGS_FULL='false'
# test for dbus irc client # test for dbus irc client
B_DBUS_CLIENT='false' B_DBUS_CLIENT='false'
# kde dcop
B_DCOP='false'
# Debug flood override: make 'true' to allow long debug output # Debug flood override: make 'true' to allow long debug output
B_DEBUG_FLOOD='false' B_DEBUG_FLOOD='false'
# show extra output data # show extra output data
@ -211,6 +213,8 @@ B_EXTRA_DATA='false'
B_HANDLE_CORRUPT_DATA='false' B_HANDLE_CORRUPT_DATA='false'
B_LOG_COLORS='false' B_LOG_COLORS='false'
B_LOG_FULL_DATA='false' B_LOG_FULL_DATA='false'
# kde qdbus
B_QDBUS='false'
B_ROOT='false' B_ROOT='false'
# Running in a shell? Defaults to false, and is determined later. # Running in a shell? Defaults to false, and is determined later.
B_RUNNING_IN_SHELL='false' B_RUNNING_IN_SHELL='false'
@ -619,6 +623,13 @@ check_script_suggested_apps()
else else
script_debugger "Suggestion: update to Bash v3.1 for optimal inxi output" script_debugger "Suggestion: update to Bash v3.1 for optimal inxi output"
fi fi
# now setting qdbus/dcop for first run, some systems can have both by the way
if [[ -n $( type -p qdbus ) ]];then
B_QDBUS='true'
fi
if [[ -n $( type -p dcop ) ]];then
B_DCOP='true'
fi
eval $LOGFE eval $LOGFE
} }
@ -969,12 +980,12 @@ print_screen_output()
fi fi
fi fi
if [[ $KONVI -eq 1 ]]; then ## dcop Konversation (<= 1.1 (qt3)) if [[ $KONVI -eq 1 && $B_DCOP == 'true' ]]; then ## dcop Konversation (<= 1.1 (qt3))
# konvi doesn't seem to like \n characters, it just prints them literally # konvi doesn't seem to like \n characters, it just prints them literally
$print_data="$( tr '\n' ' ' <<< "$print_data" )" $print_data="$( tr '\n' ' ' <<< "$print_data" )"
dcop "$DCPORT" "$DCOPOBJ" say "$DCSERVER" "$DCTARGET" "$print_data" dcop "$DCPORT" "$DCOPOBJ" say "$DCSERVER" "$DCTARGET" "$print_data"
elif [[ $KONVI -eq 3 ]]; then ## dbus Konversation (> 1.2 (qt4)) elif [[ $KONVI -eq 3 && $B_QDBUS == 'true' ]]; then ## dbus Konversation (> 1.2 (qt4))
qdbus org.kde.konversation /irc say "$DCSERVER" "$DCTARGET" "$print_data" qdbus org.kde.konversation /irc say "$DCSERVER" "$DCTARGET" "$print_data"
# elif [[ $IRC_CLIENT == 'X-Chat' ]]; then # elif [[ $IRC_CLIENT == 'X-Chat' ]]; then
@ -1626,8 +1637,10 @@ is_this_qt4_konvi()
local konvi_qt4_client='' konvi_dbus_exist='' konvi_pid='' konvi_home_dir='' local konvi_qt4_client='' konvi_dbus_exist='' konvi_pid='' konvi_home_dir=''
local konvi='' konvi_qt4_ver='' b_is_qt4='' local konvi='' konvi_qt4_ver='' b_is_qt4=''
# fringe cases can throw error, always if untested app, use 2>/dev/null # fringe cases can throw error, always if untested app, use 2>/dev/null after testing if present
if [[ $B_QDBUS == 'true' ]];then
konvi_dbus_exist=$( qdbus 2>/dev/null | grep "org.kde.konversation" ) konvi_dbus_exist=$( qdbus 2>/dev/null | grep "org.kde.konversation" )
fi
if [[ -n $konvi_dbus_exist && -e /usr/share/kde4/apps/konversation ]]; then if [[ -n $konvi_dbus_exist && -e /usr/share/kde4/apps/konversation ]]; then
konvi_pid=$( ps -A | grep -i 'konversation' ) konvi_pid=$( ps -A | grep -i 'konversation' )
@ -3006,7 +3019,7 @@ get_partition_data()
eval $LOGFS eval $LOGFS
#local excluded_file_types='--exclude-type=aufs --exclude-type=tmpfs --exclude-type=iso9660' #local excluded_file_types='--exclude-type=aufs --exclude-type=tmpfs --exclude-type=iso9660'
# df doesn't seem to work in script with variables like at the command line # df doesn't seem to work in script with variables like at the command line
local main_partition_data="$( df -h -T --exclude-type=aufs --exclude-type=tmpfs --exclude-type=iso9660 )" local main_partition_data="$( df -h -T --exclude-type=aufs --exclude-type=squashfs --exclude-type=unionfs --exclude-type=tmpfs --exclude-type=iso9660 )"
local swap_data="$( swapon -s )" local swap_data="$( swapon -s )"
log_function_data 'raw' "main_partition_data:\n$main_partition_data\n\nswap_data:\n$swap_data" log_function_data 'raw' "main_partition_data:\n$main_partition_data\n\nswap_data:\n$swap_data"