diff options
Diffstat (limited to 'urpmi.addmedia')
-rwxr-xr-x | urpmi.addmedia | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/urpmi.addmedia b/urpmi.addmedia index caca548b..20647d0e 100755 --- a/urpmi.addmedia +++ b/urpmi.addmedia @@ -183,13 +183,13 @@ if ($options{distrib}) { $urpm->write_config; } else { local $SIG{INT} = sub { - remove_failed($urpm, grep { $_->{name} eq $name && $_->{modified} } @{$urpm->{media}}); + my $medium = urpm::name2medium($urpm, $name); + remove_failed($urpm, $medium) if $medium && $medium->{modified}; exit(1); }; $urpm->update_media(%options, callback => $sync_logger); #- check creation of media - my ($medium) = grep { $_->{name} eq $name } @{$urpm->{media}}; - $medium or die N("unable to create medium \"%s\"\n", $name); + my $medium = urpm::name2medium($urpm, $name) or die N("unable to create medium \"%s\"\n", $name); remove_failed($urpm, $medium) if $medium->{modified}; } } |