Changeset 2390


Ignore:
Timestamp:
Mar 19, 2019, 1:37:47 AM (3 months ago)
Author:
bruno
Message:

Add support for SLES 15 by using /etc/os-release as well

File:
1 edited

Legend:

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

    r2362 r2390  
    280280# Now look at the os-release file to see if we have a std distribution description
    281281#
    282 $r = "/usr/lib/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     $found = 1 if ((defined $release) && (defined $distro));
     282foreach 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;
     292        }
     293    }
    290294}
    291295if ($found == 0) {
Note: See TracChangeset for help on using the changeset viewer.