diff options
author | Francois Pons <fpons@mandriva.com> | 2003-08-01 13:51:07 +0000 |
---|---|---|
committer | Francois Pons <fpons@mandriva.com> | 2003-08-01 13:51:07 +0000 |
commit | 51bbb7d10d9a55f33b499d57dd7914f29f67c8eb (patch) | |
tree | f80a7ec4cf90ce35c46cdf25c0b69313f16c87fc | |
parent | a991a189bb53745d1aec29b4dcf38c810441441e (diff) | |
download | urpmi-51bbb7d10d9a55f33b499d57dd7914f29f67c8eb.tar urpmi-51bbb7d10d9a55f33b499d57dd7914f29f67c8eb.tar.gz urpmi-51bbb7d10d9a55f33b499d57dd7914f29f67c8eb.tar.bz2 urpmi-51bbb7d10d9a55f33b499d57dd7914f29f67c8eb.tar.xz urpmi-51bbb7d10d9a55f33b499d57dd7914f29f67c8eb.zip |
fixed lock as simple user, no more remove of .LOCK file.
-rw-r--r-- | urpm.pm | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -2484,13 +2484,13 @@ sub shlock_urpmi_db { #- avoid putting a require on Fcntl ':flock' (which is perl and not perl-base). my ($LOCK_SH, $LOCK_NB) = (1, 4); - #- create the .LOCK file if needed. + #- create the .LOCK file if needed (and if possible) unless (-e "$urpm->{statedir}/.LOCK") { open LOCK_FILE, ">$urpm->{statedir}/.LOCK"; close LOCK_FILE; } - #- lock urpmi database, but keep lock to wait for an urpmi.update to finish. - open LOCK_FILE, "$urpm->{statedir}/.LOCK"; + #- lock urpmi database, if the LOCK file doesn't exists no share lock. + open LOCK_FILE, "$urpm->{statedir}/.LOCK" or return; flock LOCK_FILE, $LOCK_SH|$LOCK_NB or $urpm->{fatal}(7, N("urpmi database locked")); } sub unlock_urpmi_db { @@ -2505,8 +2505,6 @@ sub unlock_urpmi_db { #- release lock on database. flock LOCK_FILE, $LOCK_UN; close LOCK_FILE; - - unlink "$urpm->{statedir}/.LOCK"; } sub copy_packages_of_removable_media { |