From 0ffa5337c668d8b0ba91dc14d238dce2073e63af Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Fri, 14 Nov 2008 07:53:20 +0000 Subject: create update_those_media() out of update_media() (to be used in urpmi.update) --- urpm/media.pm | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'urpm') 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; -- cgit v1.2.1