Changeset 1969


Ignore:
Timestamp:
Jun 13, 2015, 1:11:26 AM (4 years ago)
Author:
bruno
Message:

When searching for amiguous distro files, do not issue error messages if
there are still other amibiguity possible but do that at the end of the
loop just once.

File:
1 edited

Legend:

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

    r1958 r1969  
    213213# Ubuntu before 10.04 includes a /etc/debian_version file that creates an ambiguity with debian
    214214# So we need to look at distros in reverse alphabetic order to treat ubuntu always first via lsb
     215my $found = 0;
    215216foreach $d (reverse keys %$ambiguous_rel_files) {
    216217    $r = $ambiguous_rel_files->{$d};
     
    219220        # Get all distros concerned by that file
    220221        my $tmp=pb_get_content("$r");
    221         my $found = 0;
    222222        my $ptr = $distro_similar->{$d};
    223223        pb_log(2,"amb: ".Dumper($ptr)."\n");
     
    236236            }
    237237        }
    238         if ($found == 0) {
    239             print STDERR "Unable to find $d version in $r (ambiguous)\n";
    240             print STDERR "Please report to the maintainer bruno_at_project-builder.org\n";
    241             $release = "unknown";
    242         } else {
    243             return($distro,$release);
    244         }
    245     }
    246 }
    247 return("unknown","unknown");
     238        last if ($found == 1);
     239    }
     240}
     241if ($found == 0) {
     242    print STDERR "Unable to find a version in ".join(' ',keys %$ambiguous_rel_files)." (ambiguous)\n";
     243    print STDERR "Please report to the maintainer bruno_at_project-builder.org\n";
     244    return("unknown","unknown");
     245} else {
     246    return($distro,$release);
     247}
    248248}
    249249
Note: See TracChangeset for help on using the changeset viewer.