summaryrefslogtreecommitdiffstats
path: root/urpm/lock.pm
diff options
context:
space:
mode:
Diffstat (limited to 'urpm/lock.pm')
-rw-r--r--urpm/lock.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/urpm/lock.pm b/urpm/lock.pm
index 6c1560ca..0b9cf7f7 100644
--- a/urpm/lock.pm
+++ b/urpm/lock.pm
@@ -17,7 +17,8 @@ my ($LOCK_SH, $LOCK_EX, $LOCK_NB, $LOCK_UN) = (1, 2, 4, 8);
# - lock urpmi db in /
sub rpm_db {
my ($urpm, $b_exclusive) = @_;
- urpm::lock->new($urpm, "$urpm->{root}/$urpm->{statedir}/.RPMLOCK", 'rpm', $b_exclusive);
+ my $f = ($urpm->{root} && !$urpm->{urpmi_root} ? "$urpm->{root}/" : '') . "$urpm->{statedir}/.RPMLOCK";
+ urpm::lock->new($urpm, $f, 'rpm', $b_exclusive);
}
sub urpmi_db {
my ($urpm, $b_exclusive, $b_nofatal) = @_;