lsb fix for distros with known good lsb files

This commit is contained in:
trash80.v2.0 2008-12-20 18:52:54 +00:00
parent aef42dccf7
commit 3d875c7f5e

20
inxi
View file

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
######################################################################## ########################################################################
#### Script Name: inxi #### Script Name: inxi
#### version: 0.8.11 #### version: 0.8.11.b2.7
#### Date: December 16 2008 #### Date: December 16 2008
######################################################################## ########################################################################
#### inxi is a fork of infobash 3.02, the original bash sys info script by locsmif #### inxi is a fork of infobash 3.02, the original bash sys info script by locsmif
@ -227,10 +227,11 @@ CN=''
### Distro Data ### Distro Data
# In cases of derived distros where the version file of the base distro can also be found under /etc, # 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) # the derived distro's version file should go first. (Such as with Sabayon / Gentoo)
DISTROS_DERIVED="antix-version kanotix-version knoppix-version redhat-release sabayon-release sidux-version turbolinux-release zenwalk-version" DISTROS_DERIVED="antix-version kanotix-version knoppix-version mandrake-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. # 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_EXCLUDE_LIST="debian_version ubuntu_version"
DISTROS_PRIMARY="gentoo-release mandrake-release redhat-release slackware-version SuSE-release" DISTROS_PRIMARY="gentoo-release redhat-release slackware-version SuSE-release"
DISTROS_LSB_GOOD="mandrake-release mandriva-release mandrakelinux-release"
### Bans Data ### Bans Data
# Precede a banword with $'\2' to prevent it from being subject to automated escaping by the make_ban_lists routine # Precede a banword with $'\2' to prevent it from being subject to automated escaping by the make_ban_lists routine
@ -1294,7 +1295,7 @@ get_cpu_data()
## return distro name/id if found ## return distro name/id if found
get_distro_data() get_distro_data()
{ {
local i='' distro='' distro_file='' a_distro_glob='' local i='' j='' distro='' distro_file='' a_distro_glob=''
# get the wild carded array of release/version /etc files if present # get the wild carded array of release/version /etc files if present
shopt -s nullglob shopt -s nullglob
@ -1317,6 +1318,17 @@ get_distro_data()
break break
fi fi
done done
# Now lets see if the distro file is in the known-good working-lsb-list
# if so, use lsb-release
# this is for only those distro's with self named release/version files
# because Mint does not use such, it must be done as below
for j in $DISTROS_LSB_GOOD
do
if [[ " ${distro_file} " == *" $j "* ]];then
distro_file='lsb-release'
break
fi
done
fi fi
# first test for the legacy antiX distro id file # first test for the legacy antiX distro id file