Acquire/release a POSIX file lock on repository archives.

- xbps_repo_open() accepts a third argument (bool) to acquire a POSIX file
lock on the repository archive.
- xbps_repo_close() accepts a second argument (bool) to release a POSIX file
lock on the repository archive.

This avoids the issue of multiple xbps-rindex(8) processes being blocked
even for different repositories on the same architecture, resulting in
unnecessary contention.
This commit is contained in:
Juan RP
2014-09-05 12:26:42 +02:00
parent 551555690d
commit 013731c502
13 changed files with 70 additions and 174 deletions

6
NEWS
View File

@@ -1,5 +1,11 @@
xbps-0.38 (???):
* libxbps: xbps_repo_{open,close}() gained an additional argument to acquire/release
a POSIX file lock (see lockf(3)) to serialize write access to the repository
archive. This obsoletes the POSIX named semaphores that were used in xbps-rindex(8),
which only allowed to add/clean a repository per architecture, even if it
wasn't the same local repository!
* libxbps: the fetch code now is able to connect to HTTPS without the need of
/etc/services being available; We don't expect those ports to change anytime!