tags 622832 + fixed-upstream pending
thanks

On Fri, Apr 15, 2011 at 10:16:02AM +0100, Roger Leigh wrote:
> On Fri, Apr 15, 2011 at 10:56:38AM +0200, Philipp Kern wrote:
> > am Fri, Apr 15, 2011 at 09:03:28AM +0100 hast du folgendes geschrieben:
> > > This is a case where we tightened up the resolver behaviour in the
> > > apt and aptitude resolvers.
> > 
> > I wonder if that shouldn't be the case for such dependencies as outlined 
> > here,
> > i.e. the same package being involved just excluding a few versions in 
> > between.
> > It feels legit, at least for binNMUs.
> 
> I would tend to agree--it's not like it's a different package.
> It could be considered a single dependency, but which is required
> to be in several parts.
> 
> We could alter the code that strips out the alternatives to allow
> any alternative with the same package name as the first.  Does
> this sound acceptable?

This was fixed on the master branch in commit d4ff9f8.

I've tested this for sawfish, and it's correctly processing the
alternative texinfo dependency:

Merged Build-Depends: base-files, base-passwd, bash, coreutils, dash, 
debianutils, diffutils, dpkg, e2fsprogs, findutils, grep, gzip, hostname, 
ncurses-base, ncurses-bin, perl-base, sed, login, sysvinit-utils, sysvinit, 
tar, bsdutils, mount, util-linux, libc6-dev | libc-dev, gcc (>= 4:4.4.3), g++ 
(>= 4:4.4.3), make, dpkg-dev (>= 1.13.5), gettext (>= 0.10.37), debhelper (>= 
7.0.0), libxinerama-dev, libesd0-dev, rep-gtk (>= 1:0.90.0), libgmp3-dev (>= 
4.1.4-8), texinfo (<< 4.11) | texinfo (>= 4.11.dfsg.1-3), libgtk2.0-dev (>= 
2.6), libxrender-dev, libxext-dev, libxt-dev, autotools-dev, automake1.10, 
quilt (>= 0.40), librep-dev (>= 0.90.0), rep, libtool
Merged Build-Conflicts: autoconf2.13, automake1.4
Filtered Build-Depends: base-files, base-passwd, bash, coreutils, dash, 
debianutils, diffutils, dpkg, e2fsprogs, findutils, grep, gzip, hostname, 
ncurses-base, ncurses-bin, perl-base, sed, login, sysvinit-utils, sysvinit, 
tar, bsdutils, mount, util-linux, libc6-dev, gcc (>= 4:4.4.3), g++ (>= 
4:4.4.3), make, dpkg-dev (>= 1.13.5), gettext (>= 0.10.37), debhelper (>= 
7.0.0), libxinerama-dev, libesd0-dev, rep-gtk (>= 1:0.90.0), libgmp3-dev (>= 
4.1.4-8), texinfo (<< 4.11) | texinfo (>= 4.11.dfsg.1-3), libgtk2.0-dev (>= 
2.6), libxrender-dev, libxext-dev, libxt-dev, autotools-dev, automake1.10, 
quilt (>= 0.40), librep-dev (>= 0.90.0), rep, libtool
Filtered Build-Conflicts: autoconf2.13, automake1.4

As you can see, the alternative
  libc6-dev | libc-dev
is treated as first only (package names don't match), whilst the
alternative
  texinfo (<< 4.11) | texinfo (>= 4.11.dfsg.1-3)
is retained because this is for the same package, and so treated as
a single logical dependency.


This is safe to pick onto the buildd-0.61.0 branch should you wish.

This was, TTMOBK, the one remaining issue blocking the switch from the
internal to apt resolver on the buildds.  Is this the case?  If so,
I believe that with this change in place the buildds can be switched
over to use "apt" by default.


Regards,
Roger


commit d4ff9f89a8d86a5350aa9f1dafdc6d1add9f2234
Author: Roger Leigh <rle...@debian.org>
Date:   Tue Apr 19 11:25:54 2011 +0100

    Sbuild::ResolverBase: Allow alternative dependencies for same package
    
    Currently, when alternative dependencies are not allowed, only the
    first alternative is used.  Here, this rule is relaxed when the
    alternative dependency or dependencies are for the same package name,
    i.e. foo (rel x) | foo (rel y) [ ... foo (rel z) ]
    since while these are separate dependencies, they are in reality a
    single logical dependency.

diff --git a/lib/Sbuild/ResolverBase.pm b/lib/Sbuild/ResolverBase.pm
index 01a0969..a6b150f 100644
--- a/lib/Sbuild/ResolverBase.pm
+++ b/lib/Sbuild/ResolverBase.pm
@@ -631,12 +631,27 @@ EOF
     $self->log("Merged Build-Depends: $positive\n") if $positive;
     $self->log("Merged Build-Conflicts: $negative\n") if $negative;
 
-    # Filter out all but the first alternative.
+    # Filter out all but the first alternative except in special
+    # cases.
     if (!$self->get_conf('RESOLVE_ALTERNATIVES')) {
        my $positive_filtered = Dpkg::Deps::AND->new();
        foreach my $item ($positive->get_deps()) {
-           my ($first) = $item->get_deps();
-           $positive_filtered->add($first) if defined $first;
+           my $alt_filtered = Dpkg::Deps::OR->new();
+           my @alternatives = $item->get_deps();
+           my $first = shift @alternatives;
+           $alt_filtered->add($first) if defined $first;
+           # Allow foo (rel x) | foo (rel y) as the only acceptable
+           # form of alternative.  i.e. where the package is the
+           # same, but different relations are needed, since these
+           # are effectively a single logical dependency.
+           foreach my $alt (@alternatives) {
+               if ($first->{'package'} eq $alt->{'package'}) {
+                   $alt_filtered->add($alt);
+               } else {
+                   last;
+               }
+           }
+           $positive_filtered->add($alt_filtered);
        }
        $positive = $positive_filtered;
     }

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux             http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?       http://gutenprint.sourceforge.net/
   `-    GPG Public Key: 0x25BFB848   Please GPG sign your mail.

Attachment: signature.asc
Description: Digital signature

Reply via email to