aboutsummaryrefslogtreecommitdiffstats
path: root/rpmdrake.pm
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2007-10-23 01:10:24 +0000
committerThierry Vignaud <tv@mandriva.org>2007-10-23 01:10:24 +0000
commitc5b13377fad1b2bdac6f0ac39c41d3e46af30426 (patch)
treec202c8d4c7cef9feb2228d2c27c33525b9baaf0a /rpmdrake.pm
parent104d1e448c04aabf656cf499a2ca60558ce03b05 (diff)
downloadrpmdrake-c5b13377fad1b2bdac6f0ac39c41d3e46af30426.tar
rpmdrake-c5b13377fad1b2bdac6f0ac39c41d3e46af30426.tar.gz
rpmdrake-c5b13377fad1b2bdac6f0ac39c41d3e46af30426.tar.bz2
rpmdrake-c5b13377fad1b2bdac6f0ac39c41d3e46af30426.tar.xz
rpmdrake-c5b13377fad1b2bdac6f0ac39c41d3e46af30426.zip
(add_distrib_update_media) factorize computing unique media names
Diffstat (limited to 'rpmdrake.pm')
-rw-r--r--rpmdrake.pm7
1 files changed, 5 insertions, 2 deletions
diff --git a/rpmdrake.pm b/rpmdrake.pm
index 13274a2d..212b15a7 100644
--- a/rpmdrake.pm
+++ b/rpmdrake.pm
@@ -878,12 +878,15 @@ It will be disabled.",
}
sub add_distrib_update_media {
- my ($urpm, $medium_name, $mirror, %options) = @_;
+ my ($urpm, $mirror, %options) = @_;
my $is_update = $mirror->{type} eq 'updates';
+ #- ensure a unique medium name
+ my $medium_name = $rpmdrake::mandrake_release =~ /(\d+\.\d+) \((\w+)\)/ ? $2 . $1 . '-' : 'distrib';
+ 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, $mirror->{url}, probe_with => 'synthesis', %options,
+ $medium_name, $mirror->{url}, probe_with => 'synthesis', initial_number => $initial_number, %options,
usedistrib => 1,
if_($is_update, only_updates => 1),
);