summaryrefslogtreecommitdiffstats
path: root/urpmq
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 /urpmq
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 'urpmq')
-rwxr-xr-xurpmq12
1 files changed, 6 insertions, 6 deletions
diff --git a/urpmq b/urpmq
index a5dee31d..f4b4c78d 100755
--- a/urpmq
+++ b/urpmq
@@ -138,9 +138,10 @@ if ($urpm::args::options{env}) {
#- should we ignore arch compatibility
if ($urpm::args::options{ignorearch}) { urpm::shunt_ignorearch() }
-$urpm::args::options{upgrade} && !$urpm::args::options{env} && !$urpm::args::options{nolock}
- and urpm::sys::lock_rpm_db($urpm);
-urpm::sys::lock_urpmi_db($urpm) if !$urpm::args::options{nolock};
+my $rpm_lock =
+ $urpm::args::options{upgrade} && !$urpm::args::options{env} && !$urpm::args::options{nolock}
+ && urpm::sys::lock_rpm_db($urpm);
+my $urpmi_lock = !$urpm::args::options{nolock} && urpm::sys::lock_urpmi_db($urpm);
urpm::media::configure($urpm,
nocheck_access => 1,
nodepslist => $urpm::args::options{nodepslist},
@@ -427,9 +428,8 @@ if ($urpm::args::options{list_aliases}) {
exit 0;
}
}
-$urpm::args::options{nolock} or urpm::sys::unlock_urpmi_db($urpm);
-$urpm::args::options{upgrade} && !$urpm::args::options{env} && !$urpm::args::options{nolock}
- and urpm::sys::unlock_rpm_db($urpm);
+$urpmi_lock and urpm::sys::unlock($urpmi_lock);
+$rpm_lock and urpm::sys::unlock($rpm_lock);
#- print sub for query.
my $query_sub = sub {