Changeset 2394 in ProjectBuilder for 0.15.1


Ignore:
Timestamp:
Mar 19, 2019, 4:22:56 PM (5 years ago)
Author:
Bruno Cornec
Message:

Do not consider os-release files when another was found earlier

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 0.15.1/pb-modules/lib/ProjectBuilder/Distribution.pm

    r2391 r2394  
    277277    }
    278278}
    279 #
    280 # Now look at the os-release file to see if we have a std distribution description
    281 #
    282 foreach my $r ("/usr/lib/os-release","/etc/os-release") {
    283     if (-r $r) {
    284         my $tmp = pb_get_content("$r");
    285         ($release) = $tmp =~ m/.*\nVERSION_ID=[\"\']*([0-9a-z\._-]+)[\"\']*\n/m;
    286         ($distro) = $tmp =~ m/.*\nID=[\"\']*([0-9A-z\._-]+)[\"\']*\n/m;
    287         # Remove the leap suffix if present (OpenSUSE)
    288         $distro =~ s/-leap//;
    289         if ((defined $release) && (defined $distro)) {
    290             $found = 1;
    291             last;
     279if ($found == 0) {
     280    #
     281    # Now look at the os-release file to see if we have a std distribution description
     282    #
     283    foreach my $r ("/usr/lib/os-release","/etc/os-release") {
     284        if (-r $r) {
     285            my $tmp = pb_get_content("$r");
     286            ($release) = $tmp =~ m/.*\nVERSION_ID=[\"\']*([0-9a-z\._-]+)[\"\']*\n/m;
     287            ($distro) = $tmp =~ m/.*\nID=[\"\']*([0-9A-z\._-]+)[\"\']*\n/m;
     288            # Remove the leap suffix if present (OpenSUSE)
     289            $distro =~ s/-leap//;
     290            if ((defined $release) && (defined $distro)) {
     291                $found = 1;
     292                last;
     293            }
    292294        }
    293295    }
Note: See TracChangeset for help on using the changeset viewer.