summaryrefslogtreecommitdiffstats
path: root/urpm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2006-11-23 08:41:10 +0000
committerPascal Rigaux <pixel@mandriva.com>2006-11-23 08:41:10 +0000
commit20c991c7c9bb78508032791392df8c82ee13d111 (patch)
treef5fa5636bd515f80c303f85d2b03a815a436b426 /urpm
parent60d85b7e9fe14eeff84053cc1585ca45eaa3f1ab (diff)
downloadurpmi-20c991c7c9bb78508032791392df8c82ee13d111.tar
urpmi-20c991c7c9bb78508032791392df8c82ee13d111.tar.gz
urpmi-20c991c7c9bb78508032791392df8c82ee13d111.tar.bz2
urpmi-20c991c7c9bb78508032791392df8c82ee13d111.tar.xz
urpmi-20c991c7c9bb78508032791392df8c82ee13d111.zip
don't say "urpmi database locked" when it's the rpm database that is locked
Diffstat (limited to 'urpm')
-rw-r--r--urpm/sys.pm13
1 files changed, 7 insertions, 6 deletions
diff --git a/urpm/sys.pm b/urpm/sys.pm
index dd24b08e..a6fb4fa7 100644
--- a/urpm/sys.pm
+++ b/urpm/sys.pm
@@ -194,7 +194,8 @@ sub clean_dir {
# - lock rpm db in chroot
# - lock urpmi db in /
sub _lock {
- my ($urpm, $file, $b_exclusive) = @_;
+ my ($urpm, $file, $msg, $b_exclusive) = @_;
+# warn "locking $file $b_exclusive\n";
#- avoid putting a require on Fcntl ':flock' (which is perl and not perl-base).
my ($LOCK_SH, $LOCK_EX, $LOCK_NB) = (1, 2, 4);
if ($b_exclusive) {
@@ -207,19 +208,19 @@ sub _lock {
}
my ($sense, $mode) = $b_exclusive ? ('>', $LOCK_EX) : ('<', $LOCK_SH);
open(my $fh, $sense, $file) or return;
- flock $fh, $mode|$LOCK_NB or $urpm->{fatal}(7, N("urpmi database locked"));
-# warn "locking $file $b_exclusive ($fh)\n";
+ flock $fh, $mode|$LOCK_NB or $urpm->{fatal}(7, $msg);
+# warn "locked $file $b_exclusive ($fh)\n";
$fh;
}
-sub lock_rpm_db {
+sub lock_rpm_db {
my ($urpm, $b_exclusive) = @_;
- _lock($urpm, "$urpm->{root}/$urpm->{statedir}/.RPMLOCK", $b_exclusive);
+ _lock($urpm, "$urpm->{root}/$urpm->{statedir}/.RPMLOCK", N("rpm database locked"), $b_exclusive);
}
sub lock_urpmi_db {
my ($urpm, $b_exclusive) = @_;
- _lock($urpm, "$urpm->{statedir}/.LOCK", $b_exclusive);
+ _lock($urpm, "$urpm->{statedir}/.LOCK", N("urpmi database locked"), $b_exclusive);
}
sub unlock {