diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2008-11-14 07:53:20 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2008-11-14 07:53:20 +0000 |
commit | 0ffa5337c668d8b0ba91dc14d238dce2073e63af (patch) | |
tree | e961266500933760074cea879a61cc8d747aac1b | |
parent | dc335ec70cca81ade1a78bd5fe8aa23c0795010b (diff) | |
download | urpmi-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)
-rw-r--r-- | urpm/media.pm | 16 |
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; |