mirror of
https://github.com/smxi/inxi.git
synced 2024-11-16 16:21:39 +00:00
first patch attempt for inxi suse id, that uses os-release by default now
This commit is contained in:
parent
dc812f80a3
commit
2c5b161c2f
20
inxi
20
inxi
|
@ -2,8 +2,8 @@
|
|||
########################################################################
|
||||
#### Script Name: inxi
|
||||
#### version: 1.8.21
|
||||
#### Date: November 14 2012
|
||||
#### Patch Number: 00
|
||||
#### Date: November 17 2012
|
||||
#### Patch Number: 01
|
||||
########################################################################
|
||||
#### SPECIAL THANKS
|
||||
########################################################################
|
||||
|
@ -511,7 +511,7 @@ DISTROS_EXCLUDE_LIST="debian_version ubuntu_version"
|
|||
DISTROS_PRIMARY="arch-release gentoo-release redhat-release slackware-version SuSE-release"
|
||||
DISTROS_LSB_GOOD="mandrake-release mandriva-release mandrakelinux-release"
|
||||
# almost no distros are using this normally, and derived distros are not using it at all as far as I can see so far
|
||||
DISTROS_OS_RELEASE_GOOD="arch-release"
|
||||
DISTROS_OS_RELEASE_GOOD="arch-release SuSE-release"
|
||||
## Distros with known problems
|
||||
# DSL (Bash 2.05b: grep -m doesn't work; arrays won't work) --> unusable output
|
||||
# Puppy Linux 4.1.2 (Bash 3.0: arrays won't work) --> works partially
|
||||
|
@ -3642,11 +3642,11 @@ get_distro_data()
|
|||
# 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 [[ -n $distro_file && $B_LSB_FILE == 'true' && " $DISTROS_LSB_GOOD" == *" $distro_file "* ]];then
|
||||
distro=$( get_distro_lsb_osrelease_data 'lsb-file' )
|
||||
distro=$( get_lsb_os_release_data 'lsb-file' )
|
||||
elif [[ $distro_file == 'lsb-release' ]];then
|
||||
distro=$( get_distro_lsb_osrelease_data 'lsb-file' )
|
||||
distro=$( get_lsb_os_release_data 'lsb-file' )
|
||||
elif [[ $distro_file == 'os-release' ]];then
|
||||
distro=$( get_distro_lsb_osrelease_data 'os-release-file' )
|
||||
distro=$( get_lsb_os_release_data 'os-release-file' )
|
||||
# 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" )
|
||||
|
@ -3655,7 +3655,7 @@ get_distro_data()
|
|||
# lsb gives more manageable and accurate output than issue, but mint should use issue for now
|
||||
# some bashism, boolean must be in parenthesis to work correctly, ie [[ $(boolean) ]] not [[ $boolean ]]
|
||||
if [[ $B_LSB_FILE == 'true' ]] && [[ -z $( grep -i 'mint' /etc/issue ) ]];then
|
||||
distro=$( get_distro_lsb_osrelease_data 'lsb-file' )
|
||||
distro=$( get_lsb_os_release_data 'lsb-file' )
|
||||
else
|
||||
distro=$( gawk '
|
||||
BEGIN {
|
||||
|
@ -3686,10 +3686,10 @@ get_distro_data()
|
|||
## 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 ]] && [[ $B_LSB_FILE == 'true' ]];then
|
||||
distro=$( get_distro_lsb_osrelease_data 'lsb-file' )
|
||||
distro=$( get_lsb_os_release_data 'lsb-file' )
|
||||
fi
|
||||
if [[ -z $distro ]] && [[ $B_OS_RELEASE_FILE == 'true' ]];then
|
||||
distro=$( get_distro_lsb_osrelease_data 'os-release-file' )
|
||||
distro=$( get_lsb_os_release_data 'os-release-file' )
|
||||
fi
|
||||
# now some final null tries
|
||||
if [[ -z $distro ]];then
|
||||
|
@ -3710,7 +3710,7 @@ get_distro_data()
|
|||
}
|
||||
|
||||
# args: $1 - lsb-file/lsb-app/os-release-file
|
||||
get_distro_lsb_osrelease_data()
|
||||
get_lsb_os_release_data()
|
||||
{
|
||||
eval $LOGFS
|
||||
local distro=''
|
||||
|
|
Loading…
Reference in a new issue