summaryrefslogtreecommitdiffstats
path: root/urpmi
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 /urpmi
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 'urpmi')
-rwxr-xr-xurpmi9
1 files changed, 5 insertions, 4 deletions
diff --git a/urpmi b/urpmi
index 40916d4e..767de487 100755
--- a/urpmi
+++ b/urpmi
@@ -334,9 +334,10 @@ if (exists $urpm->{options}{'priority-upgrade'} && $urpm->{options}{'priority-up
unlink glob('/var/lib/rpm/__db.*') unless $root;
}
+my ($rpm_lock, $urpmi_lock);
unless ($env || $nolock) {
- urpm::sys::lock_rpm_db($urpm, 'exclusive');
- urpm::sys::lock_urpmi_db($urpm);
+ $rpm_lock = urpm::sys::lock_rpm_db($urpm, 'exclusive');
+ $urpmi_lock = urpm::sys::lock_urpmi_db($urpm);
}
#- should we ignore arch compatibility
@@ -825,8 +826,8 @@ if ($nok) {
}
unless ($env || $nolock) {
- urpm::sys::unlock_urpmi_db($urpm);
- urpm::sys::unlock_rpm_db($urpm);
+ urpm::sys::unlock($urpmi_lock);
+ urpm::sys::unlock($rpm_lock);
#- try to umount removable device which may have been mounted.
urpm::removable::try_umounting_removables($urpm);