From 6aed7e5429cab61514fe2eb3cacad3d11462cd5f Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Thu, 23 Nov 2006 10:49:51 +0000 Subject: - move lock functions to a full blown module - handle get_exclusive and release_exclusive on existing lock, *but* don't use it for now! (not useful) - remove urpmi_db locking from add_medium and update_media - move rpm_db locking into _read_cachedir_pubkey - update_media: restrict rpm_db exclusive locking to parse_pubkeys - urpmi: move locking rpm_db near its use - handle lock directly in urpmi.addmedia, urpmi.update, urpme, urpmf - log locking/unlocking --- urpmf | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'urpmf') diff --git a/urpmf b/urpmf index 7feb8b90..4605ca39 100755 --- a/urpmf +++ b/urpmf @@ -190,12 +190,7 @@ if ($env) { $urpm->{statedir} = $env; } -my $lock = do { - #- lock to avoid concurrent media updates, - #- but don't die if it doesn't work - local $urpm->{fatal} = sub { printf STDERR "%s\n", $_[1] }; - urpm::sys::lock_urpmi_db($urpm); -}; +my $lock = urpm::lock::urpmi_db($urpm, '', 'nofatal'); my $need_hdlist = grep { $usedtags{$_} } qw( buildhost buildtime @@ -219,7 +214,6 @@ urpm::media::configure($urpm, callback => $callback, need_hdlist => $need_hdlist, ); -urpm::sys::unlock($lock); if ($need_hdlist) { # @hdmedia is the list of all media searched that use hdlists -- cgit v1.2.1