[Yum-devel] [PATCH] reposync should lock. BZ 880722
James Antill
james at fedoraproject.org
Thu Dec 6 15:08:07 UTC 2012
On Wed, 2012-12-05 at 17:10 +0100, Zdeněk Pavlas wrote:
> reposync => lock /var/tmp/yum-*/yum.pid
> sudo reposync => lock /var/run/yum.pid
> sudo reposync -t => lock /var/tmp/yum-*/yum.pid
> reposync -e dir => no locking
> ---
> reposync.py | 14 ++++++++++----
> 1 files changed, 10 insertions(+), 4 deletions(-)
> diff --git a/reposync.py b/reposync.py
> index 2e9db19..a749973 100755
> --- a/reposync.py
> +++ b/reposync.py
> @@ -153,15 +153,21 @@ def main():
> opts.tempcache = True
>
> if opts.tempcache:
> - cachedir = getCacheDir()
> - if cachedir is None:
> + if not my.setCacheDir(force=True):
> print >> sys.stderr, "Error: Could not make cachedir, exiting"
> sys.exit(50)
> -
> - my.repos.setCacheDir(cachedir)
> + my.conf.uid = 1 # force locking of user cache
This seems hacky, like we should have some API to explicitly say "do
cachedir locking" ... but, meh conf.uid isn't used for much else anyway.
ACK.
More information about the Yum-devel
mailing list