summaryrefslogtreecommitdiffstats
path: root/urpm/media.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-11-14 07:53:20 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-11-14 07:53:20 +0000
commit0ffa5337c668d8b0ba91dc14d238dce2073e63af (patch)
treee961266500933760074cea879a61cc8d747aac1b /urpm/media.pm
parentdc335ec70cca81ade1a78bd5fe8aa23c0795010b (diff)
downloadurpmi-0ffa5337c668d8b0ba91dc14d238dce2073e63af.tar
urpmi-0ffa5337c668d8b0ba91dc14d238dce2073e63af.tar.gz
urpmi-0ffa5337c668d8b0ba91dc14d238dce2073e63af.tar.bz2
urpmi-0ffa5337c668d8b0ba91dc14d238dce2073e63af.tar.xz
urpmi-0ffa5337c668d8b0ba91dc14d238dce2073e63af.zip
create update_those_media() out of update_media()
(to be used in urpmi.update)
Diffstat (limited to 'urpm/media.pm')
-rw-r--r--urpm/media.pm16
1 files changed, 11 insertions, 5 deletions
diff --git a/urpm/media.pm b/urpm/media.pm
index 812ae7d3..33323780 100644
--- a/urpm/media.pm
+++ b/urpm/media.pm
@@ -1672,6 +1672,16 @@ sub update_media {
$urpm->{media} or return; # verify that configuration has been read
+ if ($options{all}) {
+ $_->{modified} ||= 1 foreach all_media_to_update($urpm);
+ }
+
+ update_those_media($urpm, [ grep { $_->{modified} } non_ignored_media($urpm) ], %options);
+}
+
+sub update_those_media {
+ my ($urpm, $media, %options) = @_;
+
$options{nopubkey} ||= $urpm->{options}{nopubkey};
#- examine each medium to see if one of them needs to be updated.
@@ -1679,12 +1689,8 @@ sub update_media {
#- synthesis file, else build it from rpm files.
clean($urpm);
- if ($options{all}) {
- $_->{modified} ||= 1 foreach all_media_to_update($urpm);
- }
-
my %updates_result;
- foreach my $medium (grep { $_->{modified} } non_ignored_media($urpm)) {
+ foreach my $medium (@$media) {
#- don't ever update static media
$medium->{static} and next;