summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--urpm.pm2
-rwxr-xr-xurpmi.addmedia10
2 files changed, 11 insertions, 1 deletions
diff --git a/urpm.pm b/urpm.pm
index e394e265..328ac985 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -686,6 +686,7 @@ sub add_medium {
#- make sure configuration has been read.
$urpm->{media} or $urpm->read_config;
+ $options{nolock} or $urpm->exlock_urpmi_db;
#- if a medium with that name has already been found, we have to exit now
my $medium;
@@ -755,6 +756,7 @@ sub add_medium {
}
}
+ $options{nolock} or $urpm->unlock_urpmi_db;
$name;
}
diff --git a/urpmi.addmedia b/urpmi.addmedia
index 0bf45383..0b77c1d3 100755
--- a/urpmi.addmedia
+++ b/urpmi.addmedia
@@ -123,7 +123,14 @@ if ($options{distrib}) {
$with || $relative_hdlist
and usage N("no need to give <relative path of hdlist> with --distrib");
- $urpm->add_distrib_media($name, $url, virtual => $options{virtual}, update => $options{update}, probe_with => $options{probe_with});
+ $urpm->add_distrib_media(
+ $name,
+ $url,
+ virtual => $options{virtual},
+ update => $options{update},
+ probe_with => $options{probe_with},
+ nolock => $options{nolock},
+ );
$urpm->update_media(%options, callback => \&urpm::download::sync_logger);
remove_failed($urpm, grep { $_->{modified} } @{$urpm->{media}});
@@ -142,6 +149,7 @@ if ($options{distrib}) {
update => $options{update},
no_reload_config => $options{raw},
ignore => $options{raw},
+ nolock => $options{nolock},
);
urpm::download::copy_cmd_line_proxy($name);
if ($options{raw}) {