summaryrefslogtreecommitdiffstats
path: root/urpm/media.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-08-11 11:40:43 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-08-11 11:40:43 +0000
commit58c4003c40a63ce57cc587b4651926c3a34c3632 (patch)
tree7d24d46e6c85915e0a88acc07c3b13defea9aead /urpm/media.pm
parentf71c4570e3918f9fb10e633cce55a214f476d828 (diff)
downloadurpmi-58c4003c40a63ce57cc587b4651926c3a34c3632.tar
urpmi-58c4003c40a63ce57cc587b4651926c3a34c3632.tar.gz
urpmi-58c4003c40a63ce57cc587b4651926c3a34c3632.tar.bz2
urpmi-58c4003c40a63ce57cc587b4651926c3a34c3632.tar.xz
urpmi-58c4003c40a63ce57cc587b4651926c3a34c3632.zip
- all tools
o new option --wait-lock (#13025)
Diffstat (limited to 'urpm/media.pm')
-rw-r--r--urpm/media.pm9
1 files changed, 5 insertions, 4 deletions
diff --git a/urpm/media.pm b/urpm/media.pm
index 16384249..883e5dce 100644
--- a/urpm/media.pm
+++ b/urpm/media.pm
@@ -1539,12 +1539,12 @@ sub _get_pubkey_and_descriptions {
}
sub _read_cachedir_pubkey {
- my ($urpm, $medium) = @_;
+ my ($urpm, $medium, $b_wait_lock) = @_;
-s "$urpm->{cachedir}/partial/pubkey" or return;
$urpm->{log}(N("examining pubkey file of \"%s\"...", $medium->{name}));
- my $_rpm_lock = urpm::lock::rpm_db($urpm, 'exclusive');
+ my $_rpm_lock = urpm::lock::rpm_db($urpm, 'exclusive', wait => $b_wait_lock);
my %key_ids;
$urpm->import_needed_pubkeys(
@@ -1779,6 +1779,7 @@ sub _update_media__handle_some_flags {
#- nopubkey : don't use rpm pubkeys
#- probe_with : probe synthesis or hdlist (or none)
#- quiet : download hdlists quietly
+#- wait_lock : block until lock can be acquired
sub update_media {
my ($urpm, %options) = @_;
@@ -1787,7 +1788,7 @@ sub update_media {
$options{nopubkey} ||= $urpm->{options}{nopubkey};
if (!$options{nopubkey} && !$urpm->{keys}) {
#- get gpg-pubkey signature.
- my $_rpm_lock = urpm::lock::rpm_db($urpm);
+ my $_rpm_lock = urpm::lock::rpm_db($urpm, '', wait => $options{wait_lock});
$urpm->{log}(qq(getting "gpg-pubkey"s from rpmdb));
$urpm->parse_pubkeys(root => $urpm->{root});
}
@@ -1827,7 +1828,7 @@ sub update_media {
if ($medium->{really_modified}) {
_get_pubkey_and_descriptions($urpm, $medium, $options{nopubkey});
- _read_cachedir_pubkey($urpm, $medium);
+ _read_cachedir_pubkey($urpm, $medium, $options{wait_lock});
generate_medium_names($urpm, $medium);
}
}