[Yum-devel] [PATCH 2/2] repo.getGroups() already did repo_gen_decompress.

James Antill james at fedoraproject.org
Mon Sep 24 12:53:13 UTC 2012


On Mon, 2012-09-24 at 04:47 -0400, Zdenek Pavlas wrote:
> >> avoid mkdir /gen/gen/
> > 
> >  ACK. although I can't help but feel like we should also have some
> >  code so that this doesn't happen anyway.
> 
> I think this might be appropriate- makes sure we mkdir /gen/ only once.
> Should also get rid of some corner --cacheonly cases.

 ACK.

> commit 3d26e18ca0eed5bb8f6f802d5c0a0ba8c5a871bd
> Author: Zdeněk Pavlas <zpavlas at redhat.com>
> Date:   Mon Sep 24 10:38:51 2012 +0200
> 
>     YumRepo.dirSetup(): mkdir $cachedir/gen
> 
> diff --git a/yum/misc.py b/yum/misc.py
> index 43f34f8..0fd3e90 100644
> --- a/yum/misc.py
> +++ b/yum/misc.py
> @@ -1160,13 +1160,7 @@ def repo_gen_decompress(filename, generated_name, cached=False):
>      """ This is a wrapper around decompress, where we work out a cached
>          generated name, and use check_timestamps. filename _must_ be from
>          a repo. and generated_name is the type of the file. """
> -    dest = os.path.dirname(filename)
> -    dest += '/gen'
> -    if not os.path.exists(dest):
> -        if cached:
> -            return None
> -        os.makedirs(dest, mode=0755)
> -    dest += '/' + generated_name
> +    dest = os.path.dirname(filename) + '/gen/' + generated_name

 This will now raise on open() error if we get /gen/gen ... right? I
guess that's the best we can do.



More information about the Yum-devel mailing list