diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2006-11-23 08:33:45 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2006-11-23 08:33:45 +0000 |
commit | 60d85b7e9fe14eeff84053cc1585ca45eaa3f1ab (patch) | |
tree | d20074bef1523c17e8b69e39099ad7c9e5f7e4ec /urpmq | |
parent | a331f6da8a7d9384093c1b3a95a682fd9a2e98be (diff) | |
download | urpmi-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-x | urpmq | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -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 { |