summaryrefslogtreecommitdiffstats
path: root/urpmi.addmedia
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2006-11-13 15:06:29 +0000
committerPascal Rigaux <pixel@mandriva.com>2006-11-13 15:06:29 +0000
commitd5094215082d96625977ca9d040596ac1d99b334 (patch)
tree35f6ac1141388c52f0860d813028ad0cf071a7b4 /urpmi.addmedia
parent2891a057f46c7cc0c0df58fa26c8a364f7b5bdeb (diff)
downloadurpmi-d5094215082d96625977ca9d040596ac1d99b334.tar
urpmi-d5094215082d96625977ca9d040596ac1d99b334.tar.gz
urpmi-d5094215082d96625977ca9d040596ac1d99b334.tar.bz2
urpmi-d5094215082d96625977ca9d040596ac1d99b334.tar.xz
urpmi-d5094215082d96625977ca9d040596ac1d99b334.zip
create name2medium() and use it
Diffstat (limited to 'urpmi.addmedia')
-rwxr-xr-xurpmi.addmedia6
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};
}
}