summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS1
-rw-r--r--urpm/get_pkgs.pm29
2 files changed, 18 insertions, 12 deletions
diff --git a/NEWS b/NEWS
index 64c81034..636a8379 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,4 @@
+- fix using already downloaded rpms (from /var/cache/urpmi/rpms) (#33655)
- improve retrieving update descriptions API
Version 4.10.9 - 13 September 2007, by Pascal "Pixel" Rigaux
diff --git a/urpm/get_pkgs.pm b/urpm/get_pkgs.pm
index e5a842ac..401faa30 100644
--- a/urpm/get_pkgs.pm
+++ b/urpm/get_pkgs.pm
@@ -24,7 +24,7 @@ sub clean_all_cache {
#- associated to a null list.
sub selected2list {
my ($urpm, $packages, %options) = @_;
- my (%protected_files, %local_sources, %fullname2id, %id_map);
+ my (%protected_files, %local_sources, %fullname2id);
#- build association hash to retrieve id and examine all list files.
foreach (keys %$packages) {
@@ -33,16 +33,7 @@ sub selected2list {
my $file = $local_sources{$id} = $urpm->{source}{$id};
$protected_files{$file} = undef;
} else {
- my $pkg = $urpm->{depslist}[$id];
- my $fullname = $pkg->fullname;
- my @pkgs = map { $_->id } grep { $fullname eq $_->fullname } $urpm->packages_by_name($pkg->name);
-
- # id_map is a remapping of id.
- # it is needed because @list must be [ { id => pkg } ] where id is one the selected id,
- # not really the real package id
- $id_map{$_} = $id foreach @pkgs;
-
- push @{$fullname2id{$fullname2id}}, @pkgs;
+ $fullname2id{$urpm->{depslist}[$id]->fullname} = $id;
}
}
}
@@ -64,7 +55,21 @@ sub selected2list {
}
}
- my @remaining_ids = sort { $a <=> $b } map { @$_ } values %fullname2id;
+ my (%id_map, @remaining_ids);
+ foreach my $id (values %fullname2id) {
+ my $pkg = $urpm->{depslist}[$id];
+ my $fullname = $pkg->fullname;
+ my @pkgs = map { $_->id } grep { $fullname eq $_->fullname } $urpm->packages_by_name($pkg->name);
+
+ # id_map is a remapping of id.
+ # it is needed because @list must be [ { id => pkg } ] where id is one the selected id,
+ # not really the real package id
+ $id_map{$_} = $id foreach @pkgs;
+
+ push @remaining_ids, @pkgs;
+ }
+
+ @remaining_ids = sort { $a <=> $b } @remaining_ids;
my @list = map {
my $medium = $_;