Ignore:
Timestamp:
May 3, 2008, 1:03:24 AM (16 years ago)
Author:
Bruno Cornec
Message:
  • Improved pbdistrocheck to support -v flags
  • Fix Ubuntu issue on distribution detection
  • some more pb_log added
File:
1 edited

Legend:

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

    r402 r423  
    99
    1010use strict;
     11use Data::Dumper;
    1112use ProjectBuilder::Base;
    1213
     
    221222    'suse'              => ['suse', 'sles', 'opensuse'],
    222223    'redhat'            => ['redhat', 'rhel', 'centos', 'mandrake', 'vmware'],
    223     'lsb'               => ['ubuntu', 'debian', 'lsb'],
     224    'lsb'               => ['ubuntu', 'lsb'],
    224225    );
    225226
     
    241242    'opensuse'              => 'openSUSE (\d.+) \(',
    242243    'lsb'                   => '.*[^Ubunt].*\nDISTRIB_RELEASE=(.+)',
    243 # Ubuntu 6.06 includes a /etc/debian_version file that needs to be
    244 # renamed to /etc/debian_version.sav as there is no way to distinguish
    245 # Ubuntu 6.06 from debian testing otherwise
    246 # Same is true for Ubuntu 7.10 :-(
     244# Ubuntu includes a /etc/debian_version file that cretaes an ambiguity with debian
     245# So we need to look at distros in reverse alphabetic order to treat ubuntu always first
    247246    'ubuntu'                => '.*Ubuntu.*\nDISTRIB_RELEASE=(.+)',
    248247    'debian'                => '(.+)',
     
    274273}
    275274
    276 while (($d,$r) = each %ambiguous_rel_files) {
    277     if (-f "$base/$r" && !-l "$base/$r"){
     275# Now look at ambiguous files
     276# Ubuntu includes a /etc/debian_version file that creates an ambiguity with debian
     277# So we need to look at distros in reverse alphabetic order to treat ubuntu always first via lsb
     278foreach $d (reverse keys %ambiguous_rel_files) {
     279    $r = $ambiguous_rel_files{$d};
     280    if (-f "$base/$r" && !-l "$base/$r") {
    278281        # Found one possibility.
    279282        # Get all distros concerned by that file
     
    281284        my $found = 0;
    282285        my $ptr = $distro_similar{$d};
    283         #pb_log(2,$LOG "amb: ".Dumper($ptr)."\n" if ($debug >= 1);
     286        pb_log(2,"amb: ".Dumper($ptr)."\n");
    284287        $release = "unknown";
    285288        foreach my $dd (@$ptr) {
    286             #pb_log(2,$LOG "check $dd\n" if ($debug >= 1);
     289            pb_log(2,"check $dd\n");
    287290            # Try to check pattern
    288291            if (defined $distro_match{$dd}) {
    289                 #pb_log(2,$LOG "cmp: $distro_match{$dd} - vs - $tmp\n" if ($debug >= 1);
     292                pb_log(2,"cmp: $distro_match{$dd} - vs - $tmp\n");
    290293                ($release) = $tmp =~ m/$distro_match{$dd}/m;
    291294                if ((defined $release) && ($release ne "unknown")) {
Note: See TracChangeset for help on using the changeset viewer.