From 3d875c7f5e2be1829fdcf437a573e1996a702039 Mon Sep 17 00:00:00 2001 From: "trash80.v2.0" Date: Sat, 20 Dec 2008 18:52:54 +0000 Subject: [PATCH] lsb fix for distros with known good lsb files --- inxi | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/inxi b/inxi index bad8664..57fb289 100755 --- a/inxi +++ b/inxi @@ -1,7 +1,7 @@ #!/bin/bash ######################################################################## #### Script Name: inxi -#### version: 0.8.11 +#### 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