diff options
author | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2004-04-19 17:10:12 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2004-04-19 17:10:12 +0000 |
commit | 22d3107b3224f91c04e8825ba8bc812dba63a7ef (patch) | |
tree | ee8f28bf683e7634a039909a7503cd3e7e53967f /urpmi.addmedia | |
parent | 7f79f78d1a0af648a116cd1e39a073e051502b9c (diff) | |
download | urpmi-22d3107b3224f91c04e8825ba8bc812dba63a7ef.tar urpmi-22d3107b3224f91c04e8825ba8bc812dba63a7ef.tar.gz urpmi-22d3107b3224f91c04e8825ba8bc812dba63a7ef.tar.bz2 urpmi-22d3107b3224f91c04e8825ba8bc812dba63a7ef.tar.xz urpmi-22d3107b3224f91c04e8825ba8bc812dba63a7ef.zip |
Some more cleanup and refactorization.
Diffstat (limited to 'urpmi.addmedia')
-rwxr-xr-x | urpmi.addmedia | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/urpmi.addmedia b/urpmi.addmedia index 8157db01..1dde2551 100755 --- a/urpmi.addmedia +++ b/urpmi.addmedia @@ -24,6 +24,7 @@ use strict; use urpm; use urpm::args 'options'; use urpm::msg; +use urpm::download (); # Default mirror list our $mirrors = 'http://www.linux-mandrake.com/mirrorsfull.list'; @@ -82,7 +83,7 @@ sub main { #- parse /etc/urpmi/mirror.config if present, or use default mandrake mirror. # the --from option overrides this setting. if ($options{mirrors_url}) { - $mirrors = $options{$mirrors_url}; + $mirrors = $options{mirrors_url}; } elsif (-e "/etc/urpmi/mirror.config") { local $_; @@ -172,7 +173,7 @@ sub main { $urpm->add_distrib_media($name, $url, virtual => $options{virtual}, update => $options{update}); } - $urpm->update_media(%options, callback => \&urpm::sync_logger); + $urpm->update_media(%options, callback => \&urpm::download::sync_logger); if (my @unsynced_media = grep { $_->{modified} } @{$urpm->{media}}) { print STDERR join("\n", map { N("unable to update medium \"%s\"\n", $_->{name}) } @unsynced_media); @@ -180,7 +181,7 @@ sub main { #- remove quietly the failing media. $urpm->{log} = sub {}; $urpm->remove_selected_media; - $urpm->update_media(%options, callback => \&urpm::sync_logger); + $urpm->update_media(%options, callback => \&urpm::download::sync_logger); } } else { $name or usage; @@ -192,7 +193,7 @@ sub main { } $urpm->add_medium($name, $url, $relative_hdlist, virtual => $options{virtual}, update => $options{update}); - $urpm->update_media(%options, callback => \&urpm::sync_logger); + $urpm->update_media(%options, callback => \&urpm::download::sync_logger); #- check creation of media (during update has been successfull) my ($medium) = grep { $_->{name} eq $name } @{$urpm->{media}}; @@ -202,7 +203,7 @@ sub main { #- remove quietly the failing media. $urpm->{log} = sub {}; $urpm->remove_selected_media; - $urpm->update_media(%options, callback => \&urpm::sync_logger); + $urpm->update_media(%options, callback => \&urpm::download::sync_logger); } } |