]> git.donarmstrong.com Git - wannabuild.git/blobdiff - bin/wanna-build
Do not Build-Conflict on the Build-Depends
[wannabuild.git] / bin / wanna-build
index 4b497de8061536f3c648b40448b33cc8cdd2413e..178688bec819aba3b8a619872cf101b4a72936bf 100755 (executable)
@@ -138,7 +138,7 @@ my %options =
                           if !isin( $list_state, qw(needs-build building uploaded
                                                 built build-attempted failed installed dep-wait
                                                 not-for-us all failed-removed
-                                                install-wait reupload-wait));} },
+                                                install-wait reupload-wait bd-uninstallable));} },
         # options with args
         dist           =>
         { short => "d", arg => \$distribution,
@@ -1219,16 +1219,7 @@ sub parse_sources {
 
                next if (defined $srcver{$name} and version_less( $version, $srcver{$name} ));
                $srcver{$name} = $version;
-               if ($buildconf) {
-                   $buildconf = join( ", ", map { "!$_" } split( /\s*,\s*/, $buildconf ));
-                   if ($builddep) {
-                       $builddep .= "," . $buildconf;
-                   } else {
-                       $builddep = $buildconf;
-                   }
-               }
 
-               $pkgs{$name}{'dep'} = defined $builddep ? $builddep : "";
                $pkgs{$name}{'ver'} = $version;
                $pkgs{$name}{'bin'} = $binaries;
                my $pkg = $db{$name};
@@ -1258,6 +1249,13 @@ sub parse_sources {
 
                        $pkg->{'Section'} = $section, $change++
                                if defined $section and (not defined($pkg->{'Section'}) or $pkg->{'Section'} ne $section);
+
+                       # Store Build-Deps and Build-Conflicts for edos-debcheck later
+                       $pkg->{'Build-Depends'} = $builddep, $change++
+                               if ($pkg->{'Build-Depends'} ne $builddep);
+                       $pkg->{'Build-Conflicts'} = $buildconf, $change++
+                               if ($pkg->{'Build-Conflicts'} ne $buildconf);
+
                        $db{$name} = $pkg if $change;
                }
        }
@@ -2583,7 +2581,27 @@ sub call_edos_depcheck {
     #print "I would look at these sources with edos-depcheck:\n";
     #print join " ", keys %interesting_packages,"\n";
 
-    if (open(EDOS,"-|","wb-edos-builddebcheck", "-a", $arch, $packagesfile, $sourcesfile)) {
+    my $tmpfile_pattern = "/tmp/wanna-build-interesting-sources-$distribution.$$-";
+    my ($tmpfile, $i);
+    for( $i = 0;; ++$i ) {
+           $tmpfile = $tmpfile_pattern . $i;
+           last if ! -e $tmpfile;
+    }
+
+    open SOURCES, '>', $tmpfile or die "Could not open temporary file $tmpfile\n";
+    for my $key (keys %interesting_packages) {
+       my $pkg = $db{$key};
+       print SOURCES "Package: $key\n";
+       print SOURCES "Version: $pkg->{'Version'}\n";
+       print SOURCES "Build-Depends: $pkg->{'Build-Depends'}\n" if $pkg->{'Build-Depends'};
+       print SOURCES "Build-Conflicts: $pkg->{'Build-Conflicts'}\n" if $pkg->{'Build-Conflicts'};
+       print SOURCES "Architecture: all\n";
+       print SOURCES "\n";
+    }
+    close SOURCES;
+
+    if (open(EDOS,"-|","wb-edos-builddebcheck", "-a", $arch, $packagesfile, $tmpfile))
+    {
        local($/) = ""; # read in paragraph mode
        while( <EDOS> ) {
                my( $key, $reason ) ;
@@ -2596,7 +2614,7 @@ sub call_edos_depcheck {
                if (exists $interesting_packages{$key}) {
                    $interesting_packages{$key} = $reason;
                } else {
-                   print "TODO: edos reported a package we do not care about now" if $verbose;
+                   #print "TODO: edos reported a package we do not care about now\n" if $verbose;
                }
        }
        close EDOS;
@@ -2604,6 +2622,8 @@ sub call_edos_depcheck {
        print "ERROR: Could not run wb-edos-builddebcheck. I am continuing, assuming\n" .
              "all packages have installable build-dependencies."
     }
+    
+    unlink( $tmpfile );
 
     for my $key (keys %interesting_packages) {
        my $pkg = $db{$key};