/usr/bin/edos-builddebcheck is in edos-distcheck 1.4.2-13build2.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | #!/usr/bin/perl -w
# Copyright (C) 2008 Ralf Treinen <treinen@debian.org>
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation, version 2 of the License.
$debug=0;
# the prefix used to encode source packages
$sourceprefix="source---";
$architecture="";
$binexplain=0;
$edosoptions = "-failures -explain";
while ( $arg = shift @ARGV ) {
if ( $arg eq '-a' || $arg eq '--architecture' ) {
if ($#ARGV == -1) {
die "-a option needs a value";
} else {
$architecture = shift @ARGV;
}
} elsif ( $arg =~ "--binexplain" || $arg =~ "-be" ) {
$binexplain = 1;
} elsif ( $arg =~ /^-.*/ ) {
die "unrecognized option: $arg";
} else {
last;
}
}
if ($#ARGV != 0) {
die "Usage: edos-debbuildcheck [options] Packages Sources"
} else {
$packagefile = $arg;
$sourcesfile = shift(@ARGV);
}
if ($debug) {
print "Arch: $architecture\n";
print "Packages: $packagefile\n";
print "Sources: $sourcesfile\n";
print "Edos options: $edosoptions\n";
}
# check that all stanzas in the binary package file have the same
# architecture.
$packagearch="";
open(P,$packagefile);
while (<P>) {
next unless /^Architecture/;
next if /^Architecture:\s*all/;
/Architecture:\s*([^\s]*)/;
if ($packagearch eq "") {
$packagearch = $1;
} elsif ( $packagearch ne $1) {
die "Package file contains different architectures: $packagearch, $1";
}
}
close P;
if ( $architecture eq "" ) {
if ( $packagearch eq "" ) {
die "No architecture option given, " .
"and no non-all architecture found in the Packages file";
} else {
$architecture = $packagearch;
}
} else {
if ( $packagearch ne "" & $architecture ne $packagearch) {
die "Architecture option is $architecture ".
"but the package file contains architecture $packagearch";
}
}
open(RESULT,"python /usr/share/edos-distcheck/add-sources.py ".
"--prefix \"$sourceprefix\" $sourcesfile $architecture ".
"| edos-debcheck -I $packagefile $edosoptions|");
$sourcestanza=0;
$explanation="";
$binpackage="";
while (<RESULT>) {
if (/^\s+/) {
if ($sourcestanza) {
s/^(\s*)$sourceprefix(.*)depends on/$1$2build-depends on/o;
s/^(\s*)$sourceprefix(.*) and (.*) conflict/$1$2 build-conflicts with $3/o;
print;
if (/depends on ([^\s]*) .*\{.*\}/) {
push(@binqueue,$1);
}
} else {
$explanation .= $_;
}
} else {
if ($binpackage ne ""){
$binfailures{$binpackage} = $explanation;
$binpackage="";
}
if (/^$sourceprefix.*: FAILED/o) {
s/^$sourceprefix//o;
print;
$sourcestanza=1;
} elsif (/^([^\s]*) .*: FAILED/) {
$binpackage=$1;
$explanation=$_;
$explanation.=<RESULT>;
$sourcestanza=0;
} else {
# we have someting strange here
$sourcestanza=0;
}
}
}
close RESULT;
if ($binexplain) {
while (@binqueue) {
$p=pop(@binqueue);
$v=$binfailures{$p};
next unless defined $v;
$binfailures{$p}="";
print "$v" if $v ne "";
if ($v=~/depends on ([^\s]*) .*\{.*\}/) {
push(@binqueue,$1);
}
}
}
|