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 /urpm.pm | |
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 'urpm.pm')
-rw-r--r-- | urpm.pm | 12 |
1 files changed, 3 insertions, 9 deletions
@@ -13,7 +13,7 @@ use urpm::cfg; use urpm::md5sum; use MDV::Distribconf; -our $VERSION = '4.8.29'; +our $VERSION = '4.9.0'; our @ISA = qw(URPM Exporter); our @EXPORT_OK = 'file_from_local_url'; @@ -175,20 +175,14 @@ sub download_source_packages { my %error_sources; require urpm::get_pkgs; - urpm::sys::lock_urpmi_db($urpm, 'exclusive') if !$options{nolock}; + my $lock = !$options{nolock} && urpm::sys::lock_urpmi_db($urpm, 'exclusive'); urpm::removable::copy_packages_of_removable_media($urpm, $list, \%sources, $options{ask_for_medium}) or return; urpm::get_pkgs::download_packages_of_distant_media($urpm, $list, \%sources, \%error_sources, %options); - urpm::sys::unlock_urpmi_db($urpm) unless $options{nolock}; + $lock and urpm::sys::unlock($lock); %sources, %error_sources; } -#- deprecated -sub exlock_urpmi_db { - my ($urpm) = @_; - urpm::sys::lock_urpmi_db($urpm, 'exclusive'); -} - #- extract package that should be installed instead of upgraded, #- sources is a hash of id -> source rpm filename. sub extract_packages_to_install { |