diff options
author | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2006-03-24 15:29:13 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2006-03-24 15:29:13 +0000 |
commit | 1a8328de3774038f86bae1bd310b007bbb1fe064 (patch) | |
tree | b26e28098309b41cde3d9c398730283c9f150904 | |
parent | 88fc24d3e4adca70ec0937c9264962dceaac93a4 (diff) | |
download | urpmi-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.
-rwxr-xr-x | urpmi.addmedia | 4 |
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}}; |