Bug#400112: [PROPOSAL] forbid source/binary package name conflicts
clone 400112 -1
reassign -1 sbuild
retitle -1 sbuild cannot find source in some cases
severity -1 important
thanks
On 19/01/07 at 12:47 +0100, Goswin von Brederlow wrote:
> Kurt Roeckx <kurt@roeckx.be> writes:
>
> > On Thu, Jan 18, 2007 at 03:12:12PM +0100, Goswin von Brederlow wrote:
> >>
> >> In the initial report you mentioned that sbuild has a problem with
> >> confusing names like this. Afaik sbuild solely works on source package
> >> name and version and that is always unique. Where do you get a
> >> conflict?
> >
> > It uses apt-cache to check for available versions, which as you show
> > gives both results. And sbuild's behaviour depends on the order
> > apt-cache returns those.
> >
> >
> > Kurt
>
> Reading the source sbuild is prepared to parse multiple returns from
> apt-cache just fine. But it ignores the package name and only uses the
> version to keep them apart.
>
> So a case that would screw up sbuild would have to look something like
> this:
>
> Package: foo
> Binary: bar, foo
> Version: 1.2-3
>
> Package: bar
> Binary: bar
> Version: 1.2-3
>
> Too bad apt-cache doesn't have a --only-source option. Sbuild has to
> use package name and version.
>
> Something like this (untested):
>
> Line 424...
>
> while( <PIPE> ) {
> + $package = $1 if /^Package:\s+(\S+)\s*$/mi;
> $ver = $1 if /^Version:\s+(\S+)\s*$/mi;
> $tfile = $1 if /^Files:\s*\n((\s+.*\s*\n)+)/mi;
> }
> - if (defined $ver && defined $tfile) {
> + if (defined $package && defined $ver && defined $tfile) {
> - @{$entries{$ver}} = map { (split( /\s+/, $_ ))[3] }
> + @{$entries{"$package $ver"}} = map { (split( /\s+/, $_ ))[3] }
> split( "\n", $tfile );
> } else {
> print PLOG "apt-cache returned no information about $pkg source\n";
> print PLOG "Are there any deb-src lines in your /etc/apt/sources.list?\n";
> return ("ERROR");
> }
> }
> close( PIPE );
> if ($?) {
> print PLOG "$conf::apt_cache failed\n";
> return ("ERROR");
> }
>
> - if (!defined($entries{$version})) {
> + if (!defined($entries{"$pkg $version"})) {
>
>
>
> But I don't yet see a problem here. The apt-cache check is purely
> informational. As long as it finds an entry with the right version it
> is happy and the "apt-get --only-source source" below that will always
> do the right thing. So the worst you get is that the "Can't find
> source" message is skipped and apt-get fails.
>
> Or not?
No, the problem is that sbuild only keeps the *last* version it sees
(see the while (<PIPE>) loop above). Anyway, that part is clearly an sbuild
problem. See that log, after asking sbuild to build qd 2.1.200-1:
Build started at 20070103-0339
******************************************************************************
Checking available source versions...
Checking available source versions...
Can't find source for qd_2.1.200-1
(only different version(s) 1.0.0-rc2-5 found)
--
| Lucas Nussbaum
| lucas@lucas-nussbaum.net http://www.lucas-nussbaum.net/ |
| jabber: lucas@nussbaum.fr GPG: 1024D/023B3F4F |
Reply to: