Bug#568019: edos-distcheck: Better output for build-conflicts
Hi Kurt,
On Mon, Feb 01, 2010 at 10:51:59PM +0100, Kurt Roeckx wrote:
> Package: edos-distcheck
> Version: 1.4.2-8
> We currently see this as result of edos-builddebcheck for plplot
> on ia64 and mipsel:
> BD-Problem : plplot (= 5.9.2-3) build-depends on one of:
> - itcl3-dev (= 3.4~b1-2)
> source---plplot (= 5.9.2-3) and tcl8.5-dev (= 8.5.8-2) conflict
> itcl3-dev (= 3.4~b1-2) depends on one of:
> - tcl8.5-dev (= 8.5.8-2)
>
> Notice the "source---plplot" part.
This is very strange. I do not understand how this can happen. Do
you, by any chance, use a non-standard edos-builddebcheck script ?
I attach the script from the 1.4.2-8 package so that you can compare.
If you are indeed using the script from the package then I'll need
your input data (packages and source file). I just crafted by hand
a test case from the description in your bug report but couldn't
reproduce the bug with that.
-Ralf.
#!/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\" < $packagefile $sourcesfile $architecture ".
"| edos-debcheck $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);
}
}
}
Reply to: