mirror of
https://github.com/smxi/inxi.git
synced 2024-11-17 00:31:19 +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
|
#### Script Name: inxi
|
||||||
#### version: 1.8.21
|
#### version: 1.8.21
|
||||||
#### Date: November 14 2012
|
#### Date: November 17 2012
|
||||||
#### Patch Number: 00
|
#### Patch Number: 01
|
||||||
########################################################################
|
########################################################################
|
||||||
#### SPECIAL THANKS
|
#### 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_PRIMARY="arch-release gentoo-release redhat-release slackware-version SuSE-release"
|
||||||
DISTROS_LSB_GOOD="mandrake-release mandriva-release mandrakelinux-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
|
# 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
|
## Distros with known problems
|
||||||
# DSL (Bash 2.05b: grep -m doesn't work; arrays won't work) --> unusable output
|
# 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
|
# 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
|
# 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.
|
# 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
|
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
|
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
|
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
|
# 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
|
elif [[ -n $distro_file && -s /etc/$distro_file && " $DISTROS_EXCLUDE_LIST " != *" $distro_file "* ]];then
|
||||||
distro=$( remove_erroneous_chars "/etc/$distro_file" )
|
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
|
# 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 ]]
|
# 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
|
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
|
else
|
||||||
distro=$( gawk '
|
distro=$( gawk '
|
||||||
BEGIN {
|
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
|
## 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
|
## were found but the above resulted in null distro value
|
||||||
if [[ -z $distro ]] && [[ $B_LSB_FILE == 'true' ]];then
|
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
|
fi
|
||||||
if [[ -z $distro ]] && [[ $B_OS_RELEASE_FILE == 'true' ]];then
|
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
|
fi
|
||||||
# now some final null tries
|
# now some final null tries
|
||||||
if [[ -z $distro ]];then
|
if [[ -z $distro ]];then
|
||||||
|
@ -3710,7 +3710,7 @@ get_distro_data()
|
||||||
}
|
}
|
||||||
|
|
||||||
# args: $1 - lsb-file/lsb-app/os-release-file
|
# args: $1 - lsb-file/lsb-app/os-release-file
|
||||||
get_distro_lsb_osrelease_data()
|
get_lsb_os_release_data()
|
||||||
{
|
{
|
||||||
eval $LOGFS
|
eval $LOGFS
|
||||||
local distro=''
|
local distro=''
|
||||||
|
|
Loading…
Reference in a new issue