From 2d1585cdc11aea1978b2d52ae1c822325bc5ec01 Mon Sep 17 00:00:00 2001 From: Harald Hope Date: Sat, 23 Jun 2018 12:30:48 -0700 Subject: [PATCH] a few bug fixes for distro base: detections --- inxi | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/inxi b/inxi index cd71ba3..d8be8c5 100755 --- a/inxi +++ b/inxi @@ -15447,7 +15447,7 @@ sub get_bsd_os { sub get_linux_distro { eval $start if $b_log; my ($distro,$distro_file,$system_base) = ('','',''); - my ($b_antergos,$b_armbian,$b_base_default,$b_mint,$b_osr,$b_raspbian,@working); + my ($b_antergos,$b_armbian,$b_mint,$b_osr,$b_raspbian,@working); my @derived = qw(antix-version aptosid-version kanotix-version knoppix-version mandrake-release manjaro-release mx-version pardus-release porteus-version sabayon-release siduction-version sidux-version slitaz-release solusos-release turbolinux-release @@ -15501,7 +15501,6 @@ sub get_linux_distro { # $system_base = 'Arch Linux'; } $b_armbian = 1 if grep {/armbian/} @distro_files; - $b_base_default = 1 if grep {/\/etc\/($base_default_s)/} @distro_files; my $distro_files_s = join "|", @distro_files; @working = (@derived,@primary); foreach my $file (@working){ @@ -15613,8 +15612,13 @@ sub get_linux_distro { $distro = $distro_file; } } - if ($extra > 2){ + if ($extra > 0){ if (@osr){ + my ($b_base_default); + # more tests added here for other ubuntu derived distros + if ( @distro_files && (grep {/\/etc\/($base_default_s)/} @distro_files) ){ + $b_base_default = 1; + } if ($b_base_default ){ $system_base = get_os_release('default'); } @@ -15669,7 +15673,7 @@ sub get_lsb_release { } else { $distro = "$id $release $codename"; - $distro =~ s/^\s+|\s\s+|\s+$//g; # get rid of double and trailling spaces + $distro =~ s/^\s+|\s\s+|\s+$//g; # get rid of double and trailing spaces } eval $end if $b_log; return $distro;