small looping if/elsif optimization for deb822

This commit is contained in:
Harald Hope 2018-09-28 18:38:30 -07:00
parent 380e8e956c
commit 05f2065bb8

12
inxi
View file

@ -13159,26 +13159,26 @@ sub get_repos_linux {
$b_apt_enabled = 1;
}
#print "row:$row\n";
if ($row =~ /^Types:\s*(.*)/){
elsif ($row =~ /^Types:\s*(.*)/){
#print "ath:$type_holder\n";
$apt_types = $1;
}
if ($row =~ /^Enabled:\s*(.*)/){
elsif ($row =~ /^Enabled:\s*(.*)/){
my $status = $1;
$b_apt_enabled = ($status =~ /\b(disable|false|off|no|without)\b/i) ? 0: 1;
}
if ($row =~ /^[^#]+:\//){
elsif ($row =~ /^[^#]+:\//){
my $url = $row;
$url =~ s/^URIs:\s*//;
push @apt_working, $url if $url;
}
if ($row =~ /^Suites:\s*(.*)/){
elsif ($row =~ /^Suites:\s*(.*)/){
$apt_suites = $1;
}
if ($row =~ /^Components:\s*(.*)/){
elsif ($row =~ /^Components:\s*(.*)/){
$apt_comp = $1;
}
if ($row =~ /^Architectures:\s*(.*)/){
elsif ($row =~ /^Architectures:\s*(.*)/){
$apt_arch = $1;
}
}