Ignore:
Timestamp:
Feb 25, 2019, 12:20:25 PM (6 months ago)
Author:
bruno
Message:

More opensuse support

  • remove os-release management from conf file and do it in code as this

is a generic last resort file we want to look at if nothing else was
found. This is the case for newest opensuse distros

  • supports latest opensuse distros
File:
1 edited

Legend:

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

    r2350 r2360  
    257257        # Found one possibility.
    258258        # Get all distros concerned by that file
    259         my $tmp=pb_get_content("$r");
     259        my $tmp = pb_get_content("$r");
    260260        my $ptr = $distro_similar->{$d};
    261261        pb_log(2,"amb: ".Dumper($ptr)."\n");
     
    277277    }
    278278}
     279#
     280# Now look at the os-release file to see if we have a std distribution description
     281#
     282$r = "/usr/lib/os-release";
     283if (-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));
     290}
    279291if ($found == 0) {
    280292    print STDERR "Unable to find a version in ".join(' ',keys %$ambiguous_rel_files)." (ambiguous)\n";
    281293    print STDERR "Please report to the maintainer bruno_at_project-builder.org\n";
    282     return("unknown","unknown");
     294    confess "Please report to the maintainer bruno_at_project-builder.org\n";
    283295} else {
    284296    return($distro,$release);
Note: See TracChangeset for help on using the changeset viewer.