diff --git a/inxi b/inxi index 56cfb77..295eedd 100755 --- a/inxi +++ b/inxi @@ -1,7 +1,7 @@ #!/bin/bash ######################################################################## #### Script Name: inxi -#### version: 1.4.17 +#### version: 1.4.18 #### Date: September 29 2010 ######################################################################## #### SPECIAL THANKS @@ -2255,9 +2255,27 @@ get_distro_lsb_data() distroCodename = $NF " " } } + # sometimes some distros cannot do their lsb-release files correctly, so here is + # one last chance to get it right. + /^DISTRIB_DESCRIPTION/ { + gsub(/^ +| +$/, "", $0) + if ( $NF != "n/a" ) { + # slice out the part inside "", like: DISTRIB_DESCRIPTION="Arch Linux" + gsub(/DISTRIB_DESCRIPTION=|"/,"",$0) + distroDescription = $0 + } + } END { - print distroId distroRelease distroCodename - }' $FILE_LSB_RELEASE ) + fullString="" + if ( distroId == "" && distroRelease == "" && distroCodename == "" && distroDescription != "" ){ + fullString = distroDescription + } + else { + fullString = distroId distroRelease distroCodename + } + print fullString + } + ' $FILE_LSB_RELEASE ) log_function_data 'cat' "$FILE_LSB_RELEASE" fi # this is HORRIBLY slow, but I don't know why, it runs fast in shell