From 1a8328de3774038f86bae1bd310b007bbb1fe064 Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Fri, 24 Mar 2006 15:29:13 +0000 Subject: Add a SIGINT handler to avoid adding media when interrupting hdlist download. --- urpmi.addmedia | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'urpmi.addmedia') 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}}; -- cgit v1.2.1