[Yum-devel] [PATCH 3/3] Don't try to lock as a normal user, if we are using root's cachedir.

seth vidal skvidal at fedoraproject.org
Fri Jan 14 16:14:10 UTC 2011


On Fri, 2011-01-14 at 10:52 -0500, James Antill wrote:
> ---
>  yum/__init__.py |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/yum/__init__.py b/yum/__init__.py
> index 8fd0710..fca6ab4 100644
> --- a/yum/__init__.py
> +++ b/yum/__init__.py
> @@ -1674,8 +1674,11 @@ class YumBase(depsolve.Depsolve):
>      def doLock(self, lockfile = YUM_PID_FILE):
>          """perform the yum locking, raise yum-based exceptions, not OSErrors"""
>          
> -        # if we're not root then lock the cache
>          if self.conf.uid != 0:
> +            #  If we are a user, assume we are using the root cache ... so don't
> +            # bother locking.
> +            if self.conf.cache:
> +                return
>              root = self.conf.cachedir
>              # Don't want <cachedir>/var/run/yum.pid ... just: <cachedir>/yum.pid
>              lockfile = os.path.basename(lockfile)

ACK

-sv




More information about the Yum-devel mailing list