summaryrefslogtreecommitdiffstats
path: root/urpm/lock.pm
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2021-06-06 00:40:59 +0200
committerThierry Vignaud <thierry.vignaud@gmail.com>2021-10-31 05:38:17 +0100
commit64b20ffd4cf24ed769b9f3fd3683fe3f07426232 (patch)
tree99c094d661311424259f95f7c87adf83c5addceb /urpm/lock.pm
parent87b5ad27901b44b6846413398b5e175a7b00b3a7 (diff)
downloadurpmi-64b20ffd4cf24ed769b9f3fd3683fe3f07426232.tar
urpmi-64b20ffd4cf24ed769b9f3fd3683fe3f07426232.tar.gz
urpmi-64b20ffd4cf24ed769b9f3fd3683fe3f07426232.tar.bz2
urpmi-64b20ffd4cf24ed769b9f3fd3683fe3f07426232.tar.xz
urpmi-64b20ffd4cf24ed769b9f3fd3683fe3f07426232.zip
Podify more
Diffstat (limited to 'urpm/lock.pm')
-rw-r--r--urpm/lock.pm41
1 files changed, 31 insertions, 10 deletions
diff --git a/urpm/lock.pm b/urpm/lock.pm
index 2b7855a8..358b63a1 100644
--- a/urpm/lock.pm
+++ b/urpm/lock.pm
@@ -18,14 +18,9 @@ urpm::lock - urpm/rpm DB locking related routines for urpmi
=head1 DESCRIPTION
-=over
-
-=cut
-
-
-################################################################################
-#- class functions
+=head1 CLASS FUNCTIONS
+=over
=item rpm_db($urpm, $b_exclusive, %options)
@@ -58,11 +53,29 @@ sub urpmi_db {
urpm::lock->new($urpm, "$urpm->{statedir}/.LOCK", 'urpmi', $b_exclusive, %options);
}
+=back
+
+=head1 METHODS
+
+=over
+
+=item new($_class, $urpm, $file, $db_name, $b_exclusive, %options)
+
+Create a new lock.
+You don't want to use it directly. Either use urpmi_db() or rpm_db().
+
+Options:
-################################################################################
-#- methods
+=over 4
+
+=item * nofatal
+
+=item * wait
+
+=back
+
+=cut
-# (options: nofatal, wait)
sub new {
my ($_class, $urpm, $file, $db_name, $b_exclusive, %options) = @_;
@@ -121,6 +134,14 @@ sub _lock {
$lock->{exclusive} = $b_exclusive;
}
+
+=item unlock($lock)
+
+Free a lock.
+
+=cut
+
+
sub unlock {
my ($lock) = @_;
$lock->{fh} or warn "lock $lock->{db_name} already released\n", return;