From: Joachim Breitner Date: Wed, 29 Jul 2009 17:58:07 +0000 (+0200) Subject: Create a fake Sources file X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=61d541aceb85df01eeab1e55d1d6613c195e3e83;p=wannabuild.git Create a fake Sources file Because passing the whole Sources file to edos-debbuildcheck (add_source.py to be exact) is too slow, we create a fake one here. --- diff --git a/bin/wanna-build b/bin/wanna-build index 693528e..5fb90f0 100755 --- a/bin/wanna-build +++ b/bin/wanna-build @@ -2581,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( ) { my( $key, $reason ) ; @@ -2602,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};