Changeset 1514


Ignore:
Timestamp:
May 10, 2012, 12:47:48 PM (7 years ago)
Author:
bruno
Message:

r4759@localhost: bruno | 2012-05-10 11:12:46 +0200
Distribution.pm: Handle multi-line entries in debian control files. Tolerate errors from listing dependencies since we handle them in pb_distro_only_deps_needed. If the two files differ, generate more error output. (Eric Anderson as the previous patch)

File:
1 edited

Legend:

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

    r1507 r1514  
    358358    next if (! /$regexp/);
    359359    chomp();
     360
     361    my $nextline;
     362    # Support multi-lines deps for .deb
     363    if ($pbos->{type} eq 'deb') {
     364        while ($nextline = <DESC>) {
     365            last unless $nextline =~ /^\s+(.+)$/o;
     366            $_ .= $1;
     367        }
     368    }
     369
    360370    # What we found with the regexp is the list of deps.
    361371    pb_log(2,"found deps: $_\n");
     
    373383    s/\s+/ /g;
    374384    $deps .= " ".$_;
     385
     386    # Support multi-lines deps for .deb (fwup)
     387    if (defined $nextline) {
     388        $_ = $nextline;
     389        redo;
     390    }
    375391}
    376392close(DESC);
     
    399415    next if $p =~ /^\s*$/o;
    400416    if ($pbos->{'type'} eq  "rpm") {
    401         my $res = pb_system("rpm -q --whatprovides --quiet $p","","quiet");
     417        my $res = pb_system("rpm -q --whatprovides --quiet $p","","quiet", 1);
    402418        next if ($res eq 0);
    403419    } elsif ($pbos->{'type'} eq "deb") {
    404         my $res = pb_system("dpkg -L $p","","quiet");
     420        my $res = pb_system("dpkg -L $p","","quiet", 1);
    405421        next if ($res eq 0);
    406422    } elsif ($pbos->{'type'} eq "ebuild") {
     
    449465my $dest = shift;
    450466
    451 if (-f $dest && -s $dest == 0) {
     467if (not -f $dest) {
     468    pb_log(1, "Creating new file $dest");
     469} elsif (-f $dest && -s $dest == 0) {
    452470    pb_log(1, "Overwriting empty file $dest");
    453471} elsif (-f $dest && compare("$src", $dest) == 0) {
    454472    pb_log(1, "Overwriting identical file $dest");
    455 } elsif (not -f $dest) {
    456     pb_log(1, "Creating new $dest");
    457473} else {
    458474    pb_log(0, "ERROR: destination file $dest exists and is different than source $src\n");
     475    pb_system("cat $dest","Dest...");
     476    pb_system("cat $ENV{PBTMP}/$bn","New...");
     477    pb_log("Returning...\n");
    459478    return(0);
    460479}
Note: See TracChangeset for help on using the changeset viewer.