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";
49 next unless /^Architecture/;
50 next if /^Architecture:\s*all/;
51 /Architecture:\s*([^\s]*)/;
52 if ($packagearch eq "") {
54 } elsif ( $packagearch ne $1) {
55 die "Package file contains different architectures: $packagearch, $1";
60 if ( $architecture eq "" ) {
61 if ( $packagearch eq "" ) {
62 die "No architecture option given, " .
63 "and no non-all architecture found in the Packages file";
65 $architecture = $packagearch;
68 if ( $packagearch ne "" & $architecture ne $packagearch) {
69 die "Architecture option is $architecture ".
70 "but the package file contains architecture $packagearch";
74 open(RESULT,"add-sources.py ".
75 "--prefix \"$sourceprefix\" < $packagefile $sourcesfile $architecture ".
76 "| edos-debcheck $edosoptions|");
85 s/^(\s*)$sourceprefix(.*)(depends on|conflicts with)/$1$2build-$3/o;
89 if (/depends on ([^\s]*) .*\{.*\}/) {
100 if ($binpackage ne ""){
101 $binfailures{$binpackage} = $explanation;
104 if (/^$sourceprefix(.*) \(.*\): FAILED/o) {
105 print "Package: $1\n";
106 print "Failed-Why:\n";
108 } elsif (/^([^\s]*) .*: FAILED/) {
111 $explanation.=<RESULT>;
114 # we have someting strange here
126 next unless defined $v;
128 print "$v" if $v ne "";
129 if ($v=~/depends on ([^\s]*) .*\{.*\}/) {