From ce39d68a7ad33067af32afb07330d103dfffe460 Mon Sep 17 00:00:00 2001 From: "trash80.v2.0" Date: Sat, 20 Dec 2008 18:35:55 +0000 Subject: [PATCH] Hopefully this fix won't break others, fixed lsb issues --- inxi | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/inxi b/inxi index 69d0157..57fb289 100644 --- a/inxi +++ b/inxi @@ -1,7 +1,7 @@ #!/bin/bash ######################################################################## #### Script Name: inxi -#### version: 0.8.11.b2.5 +#### version: 0.8.11.b2.7 #### Date: December 16 2008 ######################################################################## #### inxi is a fork of infobash 3.02, the original bash sys info script by locsmif @@ -227,10 +227,11 @@ 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 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. 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 # 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 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 shopt -s nullglob @@ -1317,6 +1318,17 @@ get_distro_data() break fi 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 # first test for the legacy antiX distro id file @@ -1325,15 +1337,8 @@ get_distro_data() # 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 - if [[ ($distro_file == 'lsb-release') || -f /etc/lsb-release ]];then - for j in $DISTROS_LSB_GOOD - do - if [[ " ${distro_file} " == *" $j "* ]];then - distro=$( get_distro_lsb_data ) - fi - done - fi + elif [[ $distro_file == 'lsb-release' ]];then + distro=$( get_distro_lsb_data ) # then if the distro id file was found and it's not in the exluded primary distro file list, read it elif [[ -n $distro_file && -s /etc/$distro_file && " $DISTROS_EXCLUDE_LIST " != *" $distro_file "* ]];then distro=$( remove_erroneous_chars "/etc/$distro_file" )