[Yum-devel] [PATCH] Don't create dirs. in cwd, when repo.base_persistdir isn't set.

seth vidal skvidal at fedoraproject.org
Wed Apr 6 19:03:09 UTC 2011


On Wed, 2011-04-06 at 14:34 -0400, James Antill wrote:
> ---
>  yum/yumRepo.py |   12 +++++++++++-
>  1 files changed, 11 insertions(+), 1 deletions(-)
> 
> diff --git a/yum/yumRepo.py b/yum/yumRepo.py
> index 6ba058c..2246aec 100644
> --- a/yum/yumRepo.py
> +++ b/yum/yumRepo.py
> @@ -544,7 +544,17 @@ class YumRepository(Repository, config.RepoConf):
>          """make the necessary dirs, if possible, raise on failure"""
>  
>          cachedir = os.path.join(self.basecachedir, self.id)
> -        persistdir = os.path.join(self.base_persistdir, self.id)
> +        if self.base_persistdir and self.base_persistdir[0] == '/':
> +            persistdir = self.base_persistdir
> +        else:
> +            #  This sucks, because cakeys can't work ... but it's better
> +            # than creating dirs. in the currect dir.
> +            if tmpdir is None:
> +                tmpdir = os.getenv('TMPDIR')
> +            if tmpdir is None: # Note that TMPDIR isn't exported by default :(
> +                tmpdir = '/var/tmp'
> +            persistdir = misc.getCacheDir(tmpdir=tmpdir)
> +        persistdir = os.path.join(persistdir, self.id)
>          pkgdir = os.path.join(cachedir, 'packages')
>          hdrdir = os.path.join(cachedir, 'headers')
>          self.setAttribute('_dir_setup_cachedir', cachedir)


So is the situation here that the root user has not done anything to
make the persistdirs?

-sv




More information about the Yum-devel mailing list