3 # Copyright (C) 2008 Ralf Treinen <treinen@debian.org>
4 # This program is free software: you can redistribute it and/or modify it under
5 # the terms of the GNU General Public License as published by the Free Software
6 # Foundation, version 2 of the License.
10 # the prefix used to encode source packages
11 $sourceprefix="source---";
15 $edosoptions = "-failures -explain -quiet";
16 while ( $arg = shift @ARGV ) {
17 if ( $arg eq '-a' || $arg eq '--architecture' ) {
19 die "-a option needs a value";
21 $architecture = shift @ARGV;
23 } elsif ( $arg =~ "--binexplain" || $arg =~ "-be" ) {
25 } elsif ( $arg =~ /^-.*/ ) {
26 die "unrecognized option: $arg";
33 die "Usage: edos-debbuildcheck [options] Packages Sources"
36 $sourcesfile = shift(@ARGV);
40 print "Arch: $architecture\n";
41 print "Packages: $packagefile\n";
42 print "Sources: $sourcesfile\n";
43 print "Edos options: $edosoptions\n";
46 # check that all stanzas in the binary package file have the same
51 next unless /^Architecture/;
52 next if /^Architecture:\s*all/;
53 /Architecture:\s*([^\s]*)/;
54 if ($packagearch eq "") {
56 } elsif ( $packagearch ne $1) {
57 die "Package file contains different architectures: $packagearch, $1";
62 if ( $architecture eq "" ) {
63 if ( $packagearch eq "" ) {
64 die "No architecture option given, " .
65 "and no non-all architecture found in the Packages file";
67 $architecture = $packagearch;
70 if ( $packagearch ne "" & $architecture ne $packagearch) {
71 die "Architecture option is $architecture ".
72 "but the package file contains architecture $packagearch";
76 open(RESULT,"python /org/wanna-build/bin/add-sources.py ".
77 "--prefix \"$sourceprefix\" < /dev/null $sourcesfile $architecture ".
78 "| edos-debcheck $edosoptions '-base FILE' $packagefile |");
87 s/^(\s*)$sourceprefix(.*)depends on/$1$2build-depends on/o;
88 s/^(\s*)$sourceprefix(.*) and (.*) conflict/$1$2 build-conflicts with $3/o;
90 if (/depends on ([^\s]*) .*\{.*\}/) {
101 if ($binpackage ne ""){
102 $binfailures{$binpackage} = $explanation;
105 if (/^$sourceprefix(.*) \(.*\): FAILED/o) {
106 print "Package: $1\n";
107 print "Failed-Why:\n";
109 } elsif (/^([^\s]*) .*: FAILED/) {
112 $explanation.=<RESULT>;
115 # we have someting strange here
127 next unless defined $v;
129 print "$v" if $v ne "";
130 if ($v=~/depends on ([^\s]*) .*\{.*\}/) {