On Thu, 2007-08-02 at 23:16 -0400, Seth Vidal wrote:
> yum/repos.py |    2 ++
>  1 file changed, 2 insertions(+)
> 
> New commits:
> commit 4d832cb25f710435d8f75e9c32630069e7cee076
> Author: Seth Vidal <[EMAIL PROTECTED]>
> Date:   Thu Aug 2 23:15:56 2007 -0400
> 
>     make sure _something_ in the RepoStorage object calls _getConfig() before 
> we try to setup the repos
>     otherwise all sorts of silly things happen
> 
> diff --git a/yum/repos.py b/yum/repos.py
> index 4af1087..575bbcf 100644
> --- a/yum/repos.py
> +++ b/yum/repos.py
> @@ -41,6 +41,8 @@ class RepoStorage:
>          self.ayum = ayum
>  
>      def doSetup(self, thisrepo = None):
> +        
> +        self.ayum._getConfig() # touch the config - first thing we do
>          self.ayum.plugins.run('prereposetup')
>          
>          if thisrepo is None:


by way of explanation:

if you had a script like:


import yum
my = yum.YumBase()
my.pkgSack.searchNevra()


then yum would do:


YumBase.__init__()
YumBase._getSacks()
YumBase._getRepos()
YumBase.repos.doSetup()

none of this would read in a config file or .repo files until you go to
for repo in repos:
    repo.setup(self.ayum.conf.cache, self.ayum.mediagrabber)
    num += 1

in repos.doSetup()

that's all fine - but we have nothing of our repositories in place at
that point so it's all pretty firmly screwed underneath.

Anyway - if someone ends up calling doRepoSetup() before doConfigSetup()
then they clearly do not want the non-default config. So - I added a
call to make sure we referenced the config before everything else
exploded.

The only reason why we hadn't seen this more, earlier, is b/c the cli
and most callers of yum do _something_ to the config before they touch
the repositories.

So, this helps it.


-sv


_______________________________________________
Yum-devel mailing list
[email protected]
https://lists.dulug.duke.edu/mailman/listinfo/yum-devel

Reply via email to