fixing breakage, again

This commit is contained in:
trash80.v2.0 2008-12-20 07:06:08 +00:00
parent 3c0a999b13
commit 32df5a597f

23
inxi
View file

@ -1,7 +1,7 @@
#!/bin/bash
########################################################################
#### Script Name: inxi
#### version: 0.8.11.b2.4
#### version: 0.8.11.b2.5
#### Date: December 16 2008
########################################################################
#### inxi is a fork of infobash 3.02, the original bash sys info script by locsmif
@ -227,11 +227,10 @@ CN=''
### Distro Data
# In cases of derived distros where the version file of the base distro can also be found under /etc,
# the derived distro's version file should go first. (Such as with Sabayon / Gentoo)
DISTROS_DERIVED="antix-version kanotix-version knoppix-version sabayon-release sidux-version turbolinux-release zenwalk-version"
DISTROS_DERIVED="antix-version kanotix-version knoppix-version redhat-release sabayon-release sidux-version turbolinux-release zenwalk-version"
# debian_version excluded from DISTROS_PRIMARY so Debian can fall through to /etc/issue detection. Same goes for Ubuntu.
DISTROS_EXCLUDE_LIST="debian_version ubuntu_version"
DISTROS_PRIMARY="gentoo-release redhat-release slackware-version SuSE-release mandrake-release mandriva-release"
DISTROS_LSB_GOOD="mandriva-release mandrake-release mandrakelinux-release"
DISTROS_PRIMARY="gentoo-release mandrake-release redhat-release slackware-version SuSE-release"
### Bans Data
# Precede a banword with $'\2' to prevent it from being subject to automated escaping by the make_ban_lists routine
@ -1292,12 +1291,10 @@ get_cpu_data()
}
# for more on distro id, please reference this python thread: http://bugs.python.org/issue1322
## hopefully a lsb compliant list will fix this
## lsb-release usage isn't reliable at this time
## return distro name/id if found
get_distro_data()
{
local i='' j='' distro='' distro_file='' a_distro_glob=''
local i='' distro='' distro_file='' a_distro_glob=''
# get the wild carded array of release/version /etc files if present
shopt -s nullglob
@ -1319,16 +1316,16 @@ get_distro_data()
distro_file="${i}"
break
fi
done
fi
#########################################################################################################################################
done
fi
# first test for the legacy antiX distro id file
if [[ -e /etc/antiX ]];then
distro="$( egrep -oi 'antix.*\.iso' <<< $( remove_erroneous_chars '/etc/antiX' ) | sed 's/\.iso//' )"
# this handles case where only one release/version file was found, and it's lsb-release. This would
# never apply for ubuntu or debian, which will filter down to the following conditions. In general
# if there's a specific distro release file available, that's to be preferred, but this is a good backup.
elif [[ $distro = '' ]];then ## now check for the known good lsb-release distro's
elif elif [[ $distro = '' ]];then
if [[ ($distro_file == 'lsb-release') || -f /etc/lsb-release ]];then
for j in $DISTROS_LSB_GOOD
do
@ -1360,6 +1357,8 @@ get_distro_data()
if [[ ${#distro} -gt 80 && $B_HANDLE_CORRUPT_DATA != 'true' ]];then
distro="${RED}/etc/${distro_file} corrupted, use -% to override${NORMAL}"
fi
## note: would like to actually understand the method even if it's not used
# : ${distro:=Unknown distro o_O}
## test for /etc/lsb-release as a backup in case of failure, in cases where > one version/release file
## were found but the above resulted in null distro value
if [[ -z $distro && -f /etc/lsb-release ]];then
@ -2245,7 +2244,7 @@ print_audio_data()
if [[ -n ${a_audio_working[0]} ]];then
audio_data="${C1}Card-$(( $i + 1 )) ${C2}${a_audio_working[0]}$alsa_driver$port_data"
fi
if [[ -n $audio_data ]];then ## now check for the known good lsb-release distro's
if [[ -n $audio_data ]];then
audio_data=$( create_print_line " " "$audio_data" )
print_screen_output "$audio_data"
fi