summaryrefslogtreecommitdiffstats
path: root/mdkapplet-restricted-helper
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2008-12-03 15:31:06 +0000
committerThierry Vignaud <tv@mandriva.org>2008-12-03 15:31:06 +0000
commitea373d691c3cdad102a1702021d785e6086da515 (patch)
treea0a2dd3243d446d9700d994309d05b7fda432b56 /mdkapplet-restricted-helper
parentb6621b99d318653f04ee07f2e3c57ce2f8ff536b (diff)
downloadmgaonline-ea373d691c3cdad102a1702021d785e6086da515.tar
mgaonline-ea373d691c3cdad102a1702021d785e6086da515.tar.gz
mgaonline-ea373d691c3cdad102a1702021d785e6086da515.tar.bz2
mgaonline-ea373d691c3cdad102a1702021d785e6086da515.tar.xz
mgaonline-ea373d691c3cdad102a1702021d785e6086da515.zip
(actually_add_restricted_medium,add_restricted_medium,adding_media_failed) report urpmi.addmedia errors
Diffstat (limited to 'mdkapplet-restricted-helper')
-rwxr-xr-xmdkapplet-restricted-helper15
1 files changed, 12 insertions, 3 deletions
diff --git a/mdkapplet-restricted-helper b/mdkapplet-restricted-helper
index 7ae481d0..9e039d15 100755
--- a/mdkapplet-restricted-helper
+++ b/mdkapplet-restricted-helper
@@ -120,16 +120,25 @@ sub add_restricted_medium {
goto &get_restricted_authentication;
} else {
my $arch = urpm::cfg::get_arch();
- actually_add_restricted_medium($ref, $password, $arch);
+ actually_add_restricted_medium($ref, $password, $arch)
+ or adding_media_failed();
# FIXME: is not enough if we ever support sparc64, ppc64 and the like:
- actually_add_restricted_medium($ref, $password, 'i586') if $arch eq 'x86_64';
+ if ($arch eq 'x86_64') {
+ actually_add_restricted_medium($ref, $password, 'i586')
+ or adding_media_failed();
+ }
}
}
+sub adding_media_failed {
+ interactive->vnew->ask_warn(N("Error"), N("An error occurred while adding medium"));
+ goto &get_restricted_authentication;
+}
+
sub actually_add_restricted_medium {
my ($ref, $password, $arch) = @_;
my @options = ({ sensitive_arguments => 1 }, 'urpmi.addmedia');
my $uri = "https://" . uri_escape($ref->{data}{email}) . ":$password\@dl.mandriva.com/rpm/comm/2009.0/";
- run_program::raw(@options, 'Restricted ' . int(rand(100000)), "$uri$arch");
+ run_program::raw(@options, 'Restricted ' . int(rand(100000)), "$uri$arch") or return 0;
run_program::raw(@options, '--update', 'Restricted Updates ' . int(rand(100000)), "${uri}updates/$arch");
}