summaryrefslogtreecommitdiffstats
path: root/urpmf
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2006-11-23 08:33:45 +0000
committerPascal Rigaux <pixel@mandriva.com>2006-11-23 08:33:45 +0000
commit60d85b7e9fe14eeff84053cc1585ca45eaa3f1ab (patch)
treed20074bef1523c17e8b69e39099ad7c9e5f7e4ec /urpmf
parenta331f6da8a7d9384093c1b3a95a682fd9a2e98be (diff)
downloadurpmi-60d85b7e9fe14eeff84053cc1585ca45eaa3f1ab.tar
urpmi-60d85b7e9fe14eeff84053cc1585ca45eaa3f1ab.tar.gz
urpmi-60d85b7e9fe14eeff84053cc1585ca45eaa3f1ab.tar.bz2
urpmi-60d85b7e9fe14eeff84053cc1585ca45eaa3f1ab.tar.xz
urpmi-60d85b7e9fe14eeff84053cc1585ca45eaa3f1ab.zip
don't have a global variable to hold locks, otherwise code can't lock twice
non-exclusive
Diffstat (limited to 'urpmf')
-rwxr-xr-xurpmf6
1 files changed, 3 insertions, 3 deletions
diff --git a/urpmf b/urpmf
index 2ca63804..7feb8b90 100755
--- a/urpmf
+++ b/urpmf
@@ -190,12 +190,12 @@ if ($env) {
$urpm->{statedir} = $env;
}
-{
+my $lock = do {
#- lock to avoid concurrent media updates,
#- but don't die if it doesn't work
local $urpm->{fatal} = sub { printf STDERR "%s\n", $_[1] };
urpm::sys::lock_urpmi_db($urpm);
-}
+};
my $need_hdlist = grep { $usedtags{$_} } qw(
buildhost
buildtime
@@ -219,7 +219,7 @@ urpm::media::configure($urpm,
callback => $callback,
need_hdlist => $need_hdlist,
);
-urpm::sys::unlock_urpmi_db($urpm);
+urpm::sys::unlock($lock);
if ($need_hdlist) {
# @hdmedia is the list of all media searched that use hdlists