summaryrefslogtreecommitdiffstats
path: root/urpmi.addmedia
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2006-03-24 15:29:13 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2006-03-24 15:29:13 +0000
commit1a8328de3774038f86bae1bd310b007bbb1fe064 (patch)
treeb26e28098309b41cde3d9c398730283c9f150904 /urpmi.addmedia
parent88fc24d3e4adca70ec0937c9264962dceaac93a4 (diff)
downloadurpmi-1a8328de3774038f86bae1bd310b007bbb1fe064.tar
urpmi-1a8328de3774038f86bae1bd310b007bbb1fe064.tar.gz
urpmi-1a8328de3774038f86bae1bd310b007bbb1fe064.tar.bz2
urpmi-1a8328de3774038f86bae1bd310b007bbb1fe064.tar.xz
urpmi-1a8328de3774038f86bae1bd310b007bbb1fe064.zip
Add a SIGINT handler to avoid adding media when interrupting hdlist download.
Diffstat (limited to 'urpmi.addmedia')
-rwxr-xr-xurpmi.addmedia4
1 files changed, 4 insertions, 0 deletions
diff --git a/urpmi.addmedia b/urpmi.addmedia
index 4d46da86..95969848 100755
--- a/urpmi.addmedia
+++ b/urpmi.addmedia
@@ -155,6 +155,10 @@ if ($options{distrib}) {
if ($options{raw}) {
$urpm->write_config;
} else {
+ local $SIG{INT} = sub {
+ remove_failed($urpm, grep { $_->{name} eq $name && $_->{modified} } @{$urpm->{media}});
+ exit(1);
+ };
$urpm->update_media(%options, callback => \&urpm::download::sync_logger);
#- check creation of media
my ($medium) = grep { $_->{name} eq $name } @{$urpm->{media}};