From 548fc5c71ca11330998e4261f55e4bd6ba31ce0e Mon Sep 17 00:00:00 2001 From: inxi-svn Date: Thu, 28 Jul 2011 00:02:05 +0000 Subject: [PATCH] added some comments to explain --- inxi | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/inxi b/inxi index 3ecb3a7..7462ac6 100755 --- a/inxi +++ b/inxi @@ -3405,11 +3405,14 @@ get_distro_data() if [[ -z $distro ]] && [[ $B_LSB_FILE == 'true' ]];then distro=$( get_distro_lsb_data ) fi - ## finally, if all else has failed, give up + # now some final null tries if [[ -z $distro ]];then + # if the file was null but present, which can happen in some cases, then use the file name itself to + # set the distro value. Why say unknown if we have a pretty good idea, after all? if [[ -n $distro_file ]] && [[ " $DISTROS_DERIVED $DISTROS_PRIMARY " == *" $distro_file "* ]];then distro=$( sed -E -e 's/[-_]//' -e 's/(release|version)//' <<< $distro_file | sed -E 's/^([a-z])/\u\1/' ) fi + ## finally, if all else has failed, give up if [[ -z $distro ]];then distro='Unknown distro o_O' fi