diff options
author | Thierry Vignaud <tv@mandriva.org> | 2007-10-08 19:30:58 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2007-10-08 19:30:58 +0000 |
commit | f51f032827f0cba351e949c870469e8901ea5a23 (patch) | |
tree | cf5692d6db7e3631bf4929e4afd0427509ddc830 /Rpmdrake | |
parent | cfe178df6a04c99a53ff5a81769734bd85c24183 (diff) | |
download | rpmdrake-f51f032827f0cba351e949c870469e8901ea5a23.tar rpmdrake-f51f032827f0cba351e949c870469e8901ea5a23.tar.gz rpmdrake-f51f032827f0cba351e949c870469e8901ea5a23.tar.bz2 rpmdrake-f51f032827f0cba351e949c870469e8901ea5a23.tar.xz rpmdrake-f51f032827f0cba351e949c870469e8901ea5a23.zip |
(add_distrib_update_media) factorize code
Diffstat (limited to 'Rpmdrake')
-rw-r--r-- | Rpmdrake/edit_urpm_sources.pm | 10 | ||||
-rw-r--r-- | Rpmdrake/pkg.pm | 9 |
2 files changed, 2 insertions, 17 deletions
diff --git a/Rpmdrake/edit_urpm_sources.pm b/Rpmdrake/edit_urpm_sources.pm index 07ae7c5f..8c4f7728 100644 --- a/Rpmdrake/edit_urpm_sources.pm +++ b/Rpmdrake/edit_urpm_sources.pm @@ -136,8 +136,6 @@ Is it ok to continue?", $distro), arch => $arch, ) or return 0; ref $mirror or return; - my $url = $mirror->{url}; - my $is_update = $mirror->{type} eq 'updates'; my $wait = wait_msg(N("Please wait, adding media...")); my $medium_name; if ($rpmdrake::mandrake_release =~ /(\d+\.\d+) \((\w+)\)/) { @@ -147,13 +145,7 @@ Is it ok to continue?", $distro), } #- ensure a unique medium name my $initial_number = 1 + max map { $_->{name} =~ /\(\Q$medium_name\E(\d+)\b/ ? $1 : 0 } @{$urpm->{media}}; - add_medium_and_check( - $urpm, - { nolock => 1, distrib => 1 }, - $medium_name, $url, probe_with => 'synthesis', initial_number => $initial_number, - usedistrib => 1, - if_($is_update, only_updates => 1), - ); + add_distrib_update_media($urpm, $medium_name, $mirror, initial_number => $initial_number); remove_wait_msg($wait); return 1; } diff --git a/Rpmdrake/pkg.pm b/Rpmdrake/pkg.pm index dcd90762..bbd8d001 100644 --- a/Rpmdrake/pkg.pm +++ b/Rpmdrake/pkg.pm @@ -212,14 +212,7 @@ launch the Software Media Manager, and then add a `Security updates' medium. Then, restart %s.", $rpmdrake::myname_update)), myexit(-1); - my $is_update = $mirror->{type} eq 'updates'; - add_medium_and_check( - $urpm, - { nolock => 1, distrib => 1 }, - $update_name, $m, probe_with => 'synthesis', update => 1, - usedistrib => 1, - if_($is_update, only_updates => 1), - ); + add_distrib_update_media($urpm, $update_name, $mirror); @update_medias = { name => $update_name }; #- hack to simulate a medium for parsing of descriptions } } |