Your message dated Tue, 7 Dec 2010 21:18:24 +0000
with message-id <[email protected]>
and subject line Re: [buildd-tools-devel] Bug#570465: Sort apt policy versions 
by priority, then by version
has caused the Debian Bug report #570465,
regarding Sort apt policy versions by priority, then by version
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
570465: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=570465
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: libsbuild-perl
Version: 0.59.0-1
Severity: wishlist
File: /usr/share/perl5/Sbuild/BuildDepSatisfierBase.pm
Tags: patch

Hello,

(this bug is actually against not-yet-released version 0.59.1-1).

The patch and commit log are below. It applies on the top of the current
buildd/master branch.

Author: Modestas Vainius <[email protected]>
Date:   Fri Feb 19 02:07:11 2010 +0200

    Sort apt policy versions by priority, then by version.
    
    In my opinion, it makes sense to sort package versions by priority first
    (versions with greater priority will be prefered over versions with lower
    priority if they both satify the dependency). If priority is the same, then
    higher versions will be prefered over lower ones (i.e. like previous 
behaviour
    for all versions).
    
    This change allows buildd administrators to configure preferences for 
multiple
    repositories via standard apt_preferences(5) file in the chroot. What is 
more,
    this is similar to how aptitude 0.6 orders solutions in the same tier.
    
    Signed-off-by: Modestas Vainius <[email protected]>

diff --git a/lib/Sbuild/BuildDepSatisfierBase.pm 
b/lib/Sbuild/BuildDepSatisfierBase.pm
index cc170cd..7d6c08d 100644
--- a/lib/Sbuild/BuildDepSatisfierBase.pm
+++ b/lib/Sbuild/BuildDepSatisfierBase.pm
@@ -359,6 +359,7 @@ sub get_apt_policy {
     my $builder = $self->get('Builder');
     my @interest = @_;
     my $package;
+    my $ver;
     my %packages;
 
     my $pipe =
@@ -373,9 +374,30 @@ sub get_apt_policy {
        $package=$1 if /^([0-9a-z+.-]+):$/;
        $packages{$package}->{curversion}=$1 if /^ {2}Installed: 
([0-9a-zA-Z-.:~+]*)$/;
        $packages{$package}->{defversion}=$1 if /^ {2}Candidate: 
([0-9a-zA-Z-.:~+]*)$/;
-       push @{$packages{$package}->{versions}}, "$2" if /^ (\*{3}| {3}) 
([0-9a-zA-Z-.:~+]*) 0$/;
+       if (/^ (\*{3}| {3}) ([0-9a-zA-Z-.:~+]*) 0$/) {
+           $ver = "$2";
+           push @{$packages{$package}->{versions}}, $ver;
+       }
+       if (/^ {5} *(-?\d+) /) {
+           my $prio = $1;
+           if (!defined $packages{$package}->{priority}{$ver} ||
+               $packages{$package}->{priority}{$ver} < $prio) {
+               $packages{$package}->{priority}{$ver} = $prio;
+           }
+       }
     }
     close($pipe);
+    # Resort by priority keeping current version order if priority is the same
+    use sort "stable";
+    foreach my $package (keys %packages) {
+       my $p = $packages{$package};
+       if (exists $p->{priority}) {
+           $p->{versions} = [ sort(
+               { -($p->{priority}{$a} <=> $p->{priority}{$b}) } 
@{$p->{versions}}
+           ) ];
+       }
+    }
+    no sort "stable";
     die $self->get_conf('APT_CACHE') . " exit status $?\n" if $?;
 
     return \%packages;

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (101, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-2-amd64 (SMP w/1 CPU core)
Locale: LANG=lt_LT.UTF-8, LC_CTYPE=lt_LT.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages libsbuild-perl depends on:
ii  adduser                       3.112      add and remove users and groups
ii  apt                           0.7.25.3   Advanced front-end for dpkg
ii  dctrl-tools                   2.14       Command-line tools to process Debi
ii  devscripts                    2.10.61    scripts to make the life of a Debi
ii  dpkg-dev                      1.15.5.6   Debian package development tools
ii  exim4                         4.71-3     metapackage to ease Exim MTA (v4) 
ii  exim4-daemon-light [mail-tran 4.71-3     lightweight Exim MTA (v4) daemon
ii  libfilesys-df-perl            0.92-3+b1  Module to obtain filesystem disk s
ii  perl                          5.10.1-11  Larry Wall's Practical Extraction 
ii  perl-modules                  5.10.1-11  Core Perl modules
ii  schroot                       1.4.0-1    Execute commands in a chroot envir

libsbuild-perl recommends no packages.

libsbuild-perl suggests no packages.

-- no debconf information



--- End Message ---
--- Begin Message ---
Version: 0.60.0-1

On Fri, Feb 19, 2010 at 02:43:34AM +0200, Modestas Vainius wrote:
> Package: libsbuild-perl
> Version: 0.59.0-1
> Severity: wishlist
> File: /usr/share/perl5/Sbuild/BuildDepSatisfierBase.pm
> Tags: patch
> 
> Hello,
> 
> (this bug is actually against not-yet-released version 0.59.1-1).
> 
> The patch and commit log are below. It applies on the top of the current
> buildd/master branch.

Many thanks for the patch.

This was applied the same day, but I forgot to close the bug.  Closing
it now.


Thanks,
Roger

-- 
  .''`.  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


--- End Message ---

Reply via email to