summaryrefslogtreecommitdiffstats
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
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)
-rw-r--r--NEWS3
-rwxr-xr-xmdkapplet2
-rwxr-xr-xmdkapplet-restricted-helper6
3 files changed, 9 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index ffffd6c0..5a85c598 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,6 @@
+- mdkapplet
+ o add 2009.1 restricted media on 2009.1 (#50478)
+
Version 2.77 - 17 April 2009, Thierry Vignaud
- mdkapplet
diff --git a/mdkapplet b/mdkapplet
index d32baa0b..ef58567e 100755
--- a/mdkapplet
+++ b/mdkapplet
@@ -724,7 +724,7 @@ sub is_restricted_media_configured {
}
sub really_prepare_add_restricted() {
- $mdv_update_pid = run_program::raw({ detach => 1 }, 'mdkapplet-restricted-helper');
+ $mdv_update_pid = run_program::raw({ detach => 1 }, 'mdkapplet-restricted-helper', $product_id->{version});
}
sub prepare_add_restricted() {
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");
}