summaryrefslogtreecommitdiffstats
path: root/mdkapplet-restricted-helper
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2009-05-12 17:58:39 +0000
committerThierry Vignaud <tv@mandriva.org>2009-05-12 17:58:39 +0000
commit11efedddc5d3869053633d321f4191d52e96ba1e (patch)
treeec9a8ce080905ad6ea01c07b3f6cc397d18a6e60 /mdkapplet-restricted-helper
parentbf297f60b4fccddd82f8550cfa086cbfe64d2930 (diff)
downloadmgaonline-11efedddc5d3869053633d321f4191d52e96ba1e.tar
mgaonline-11efedddc5d3869053633d321f4191d52e96ba1e.tar.gz
mgaonline-11efedddc5d3869053633d321f4191d52e96ba1e.tar.bz2
mgaonline-11efedddc5d3869053633d321f4191d52e96ba1e.tar.xz
mgaonline-11efedddc5d3869053633d321f4191d52e96ba1e.zip
(really_prepare_add_restricted,mdkapplet-restricted-helper) do not
hardcode '2009.0' version, thus fixing adding 2009.1 restricted media on 2009.1 (#50478)
Diffstat (limited to 'mdkapplet-restricted-helper')
-rwxr-xr-xmdkapplet-restricted-helper6
1 files changed, 5 insertions, 1 deletions
diff --git a/mdkapplet-restricted-helper b/mdkapplet-restricted-helper
index c1d8a43d..b98791b7 100755
--- a/mdkapplet-restricted-helper
+++ b/mdkapplet-restricted-helper
@@ -42,11 +42,15 @@ use LWP::UserAgent;
use HTTP::Request::Common;
use HTTP::Request;
+my $version;
foreach my $opt (@ARGV) {
if ($opt =~ /--(rpm-root|urpmi-root)=(.*)/) {
$::rpmdrake_options{$1}[0] = $2;
+ } else {
+ $version = $opt;
}
}
+$version or die "usage: mdkapplet-restricted-helper <distrib_version>\n";
get_restricted_authentication();
@@ -167,7 +171,7 @@ sub adding_media_failed {
sub actually_add_restricted_medium {
my ($ref, $password, $arch) = @_;
my @options = ({ sensitive_arguments => 1 }, 'urpmi.addmedia', '--xml-info', 'always');
- my $uri = "https://" . uri_escape($ref->{data}{email}) . ":$password\@dl.mandriva.com/rpm/comm/2009.0/";
+ my $uri = "https://" . uri_escape($ref->{data}{email}) . ":$password\@dl.mandriva.com/rpm/comm/$version/";
run_program::raw(@options, "Restricted $arch " . int(rand(100000)), "$uri$arch") or return 0;
run_program::raw(@options, '--update', "Restricted Updates $arch " . int(rand(100000)), "${uri}updates/$arch");
}