On Sat, Jul 24, 2004 at 08:00:23PM +0200, Ralf S. Engelschall wrote:

> Oh, now I understand the problem! Unfortunately the Provides for the
> CURRENT version is very important for mixing RELEASE and CURRENT and
> hence cannot be removed. So, we should tell "openpkg build" about this
> special case, I think. Do you have a quick patch at hand, Michael?

One could special case the openpkg package, but I'd like to avoid this
if possible.

The following patch therefore will simply select the database entry with
the smallest version number, i.e. OpenPKG-2.1.0-2.1.0 when deciding on
wether it needs an update.

--- build.pl.dist       Sat Jul 24 21:21:50 2004
+++ build.pl    Sat Jul 24 21:49:56 2004
@@ -1318,15 +1318,15 @@
 #
 # find target in map
 #
-sub find_target ($$) {
-    my($name, $map) = @_;
+sub find_target ($$$) {
+    my($name, $map, $pos) = @_;
     my($vmap) = $map->{$name};
     my(@vs);
 
     return unless $vmap;
 
     @vs = sort { vcmp($b,$a) } keys %$vmap;
-    return $vmap->{$vs[0]}->[-1];
+    return $vmap->{$vs[$pos]}->[-1];
 }
 
 #
@@ -1413,7 +1413,7 @@
 
     $conflicts = target_conflicts($target, $env);
     foreach (@$conflicts) {
-        my($t) = find_target($_, $map);
+        my($t) = find_target($_, $map, 0);
         return $t if $t;
     }
     return;
@@ -1741,7 +1741,7 @@
     #
     # see if a target is already installed and requires a rebuild
     #
-    if ($t = find_target($target->{name}, $env->{installed})) {
+    if ($t = find_target($target->{name}, $env->{installed}, -1)) {
         if (exists $env->{exclude}->{$target->{name}}) {
             print "# excluding $target->{name} (no upgrade allowed)\n";
             return;
@@ -2312,7 +2312,7 @@
         next if $n =~ /::/;
         next if exists $map{$n};
         next unless grep { $_ ne '' } keys %{$repository->{$n}};
-        $t = find_target($n, $repository);
+        $t = find_target($n, $repository, 0);
         $map{$n}->{'status'} = 'NEW';
         $map{$n}->{'rel'}    = vs($t);
         push @names,$n;


Greetings,
-- 
                                Michael van Elst
Internet: [EMAIL PROTECTED]
                                "A potential Snark may lurk in every tree."
______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
User Communication List                      [EMAIL PROTECTED]

Reply via email to