Re: [PATCH] Set repo.cachedir to repo.basecachedir when reading configuration

seth vidal <[email protected]>
Newsgroups gmane.linux.rpm.yum
Message-ID <1216816596.10981.19.camel@rosebud>
On Wed, 2008-07-23 at 15:32 +0300, Alexander Todorov wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA512
> 

> The failure was at:
> yumdownloader -c $yumconf anaconda-runtime. The config files that come with

Is revisor actually running this command or is it doing something like
it internally?


> Apparently it was failing to download the package from http://localrepo as such
> doesn't exist but then it was failing to download the package from any
> mirrorlist (as a matter of fact mirrorlist was not used). The patch below fixed
> that. What I noticed is that repo.cachedir was empty and it was used to
> construct the path for mirrorlist.txt which resulted in /mirrorlist.txt and
> denied write. Although Revisor was running as root that was failing. I still
> have to go and find out why this happened.
> 
> Please review and apply the proposed patch.
> 
> 
> diff --git a/yum/__init__.py b/yum/__init__.py
> index 5786816..8decfca 100644
> - --- a/yum/__init__.py
> +++ b/yum/__init__.py
> @@ -325,6 +325,7 @@ class YumBase(depsolve.Depsolve):
> 
> ~         # Set attributes not from the config file
> ~         repo.basecachedir = self.conf.cachedir
> +        repo.cachedir = repo.basecachedir
> ~         repo.yumvar.update(self.conf.yumvar)
> ~         repo.cfg = parser
> 

is there some reason why repo.dirSetup() never gets run?

You'll notice that it does:
 def dirSetup(self):
        """make the necessary dirs, if possible, raise on failure"""

        cachedir = os.path.join(self.basecachedir, self.id)
        pkgdir = os.path.join(cachedir, 'packages')
        hdrdir = os.path.join(cachedir, 'headers')
        self.setAttribute('cachedir', cachedir)
        self.setAttribute('pkgdir', pkgdir)
        self.setAttribute('hdrdir', hdrdir)


There may be another bug here, but I don't think the patch you sent is
the right way to fix it.

-sv
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.