Summary: | Enhancement: Make emerge --sync respect a "lockfile concept" so a --sync won't run during an active merge | ||
---|---|---|---|
Product: | Portage Development | Reporter: | Jeremy Olexa (darkside) (RETIRED) <darkside> |
Component: | Enhancement/Feature Requests | Assignee: | Portage team <dev-portage> |
Status: | CONFIRMED --- | ||
Severity: | enhancement | CC: | sam |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: | https://bugs.gentoo.org/show_bug.cgi?id=722868 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Jeremy Olexa (darkside) (RETIRED)
![]() ![]() ![]() Maybe we can modify the portage.locks module to optionally use fcntl.LOCK_SH instead of LOCK_EX, or add a new function to do that if it doesn't fit the existing functions well. via flock, a LOCK_SH for readonly access, LOCK_EX for write access (sync'ing) applied to the repository directory (PORTDIR=/usr/portage, thus /usr/portage) would work for me in terms of pkgcore/portage interop. Work for you? If you have a lot of repos configured, and you have a build plan that uses lots of them, then you're going to have to hold individual shared locks for each repo that you're using until you're finished with it. Alternatively we could go with a single global lock, like /var/lock/portage_repos or something like that, but maybe that's not granular enough for some use cases? If using a global lock, might also want to consider permissions issues. For example, with prefix-portage, the user may not have write access to the global /var/lock directory, but they still may want use this locking feature. In that case maybe it would make sense for them to use $EPREFIX/var/lock for such locks. (In reply to comment #3) > If you have a lot of repos configured, and you have a build plan that uses lots > of them, then you're going to have to hold individual shared locks for each > repo that you're using until you're finished with it. > > Alternatively we could go with a single global lock, like > /var/lock/portage_repos or something like that, but maybe that's not granular > enough for some use cases? If using a global lock, might also want to consider > permissions issues. For example, with prefix-portage, the user may not have > write access to the global /var/lock directory, but they still may want use > this locking feature. In that case maybe it would make sense for them to use > $EPREFIX/var/lock for such locks. locking per repo suffices, although keep in mind that overlay repo's would need to lock what their 'overlaying' since eclasses and other bits can come from there. While this can result in long held locks... that's valid. You don't want a sync leveled during a 100 pkg build after all. |