summaryrefslogtreecommitdiffstats
path: root/urpm.pm
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 /urpm.pm
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 'urpm.pm')
-rw-r--r--urpm.pm12
1 files changed, 3 insertions, 9 deletions
diff --git a/urpm.pm b/urpm.pm
index d1c1d649..4f43f45c 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -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 {