[Yum-devel] [PATCH] Use YumBase.conf.yumvar, for Pungi (and maybe others) ... convert all of core

Tim Lauridsen tim.lauridsen at googlemail.com
Fri Jan 8 11:08:33 UTC 2010


On Thu, Jan 7, 2010 at 7:19 PM, James Antill <james at and.org> wrote:

> ---
>  yum/__init__.py |   12 ++++++++----
>  yumcommands.py  |    4 ++--
>  2 files changed, 10 insertions(+), 6 deletions(-)
>
> diff --git a/yum/__init__.py b/yum/__init__.py
> index 4d76267..b93dd0c 100644
> --- a/yum/__init__.py
> +++ b/yum/__init__.py
> @@ -287,6 +287,10 @@ class YumBase(depsolve.Depsolve):
>
>         # run the postconfig plugin hook
>         self.plugins.run('postconfig')
> +        #  Note that Pungi has historically replaced _getConfig(), and it
> sets
> +        # up self.conf.yumvar but not self.yumvar ... and AFAIK nothing
> needs
> +        # to use YumBase.yumvar, so it's probably easier to just
> semi-deprecate
> +        # this (core now only uses YumBase.conf.yumvar).
>         self.yumvar = self.conf.yumvar
>
>         self.getReposFromConfig()
> @@ -323,7 +327,7 @@ class YumBase(depsolve.Depsolve):
>         if repo_age is None:
>             repo_age = os.stat(repofn)[8]
>
> -        confpp_obj = ConfigPreProcessor(repofn, vars=self.yumvar)
> +        confpp_obj = ConfigPreProcessor(repofn, vars=self.conf.yumvar)
>         parser = ConfigParser()
>         try:
>             parser.readfp(confpp_obj)
> @@ -469,7 +473,7 @@ class YumBase(depsolve.Depsolve):
>             self.verbose_logger.log(logginglevels.DEBUG_4,
>                                     _('Reading Local RPMDB'))
>             self._rpmdb =
> rpmsack.RPMDBPackageSack(root=self.conf.installroot,
> -
> releasever=self.yumvar['releasever'],
> +
> releasever=self.conf.yumvar['releasever'],
>
>  persistdir=self.conf.persistdir,
>
>  cachedir=self.conf.cachedir)
>             self.verbose_logger.debug('rpmdb time: %0.3f' % (time.time() -
> rpmdb_st))
> @@ -1183,7 +1187,7 @@ class YumBase(depsolve.Depsolve):
>                 rpo = txmbr.po
>                 po.yumdb_info.from_repo = rpo.repoid
>                 po.yumdb_info.reason = txmbr.reason
> -                po.yumdb_info.releasever = self.yumvar['releasever']
> +                po.yumdb_info.releasever = self.conf.yumvar['releasever']
>                 if hasattr(self, 'cmds') and self.cmds:
>                     po.yumdb_info.command_line = ' '.join(self.cmds)
>                 csum = rpo.returnIdSum()
> @@ -4246,7 +4250,7 @@ class YumBase(depsolve.Depsolve):
>         if cachedir is None:
>             return False # Tried, but failed, to get a "user" cachedir
>
> -        cachedir += varReplace(suffix, self.yumvar)
> +        cachedir += varReplace(suffix, self.conf.yumvar)
>         self.repos.setCacheDir(cachedir)
>         self.rpmdb.setCacheDir(cachedir)
>
> diff --git a/yumcommands.py b/yumcommands.py
> index aa7be12..21ad361 100644
> --- a/yumcommands.py
> +++ b/yumcommands.py
> @@ -1160,8 +1160,8 @@ class VersionCommand(YumCommand):
>
>             return 0, ['version groupinfo']
>
> -        rel = base.yumvar['releasever']
> -        ba  = base.yumvar['basearch']
> +        rel = base.conf.yumvar['releasever']
> +        ba  = base.conf.yumvar['basearch']
>         cols = []
>         if vcmd in ('installed', 'all', 'group-installed', 'group-all'):
>             try:
> --
> 1.6.5.2
>
> _______________________________________________
> Yum-devel mailing list
> Yum-devel at lists.baseurl.org
> http://lists.baseurl.org/mailman/listinfo/yum-devel
>

ACK

Tim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.baseurl.org/pipermail/yum-devel/attachments/20100108/d87f416d/attachment.htm>


More information about the Yum-devel mailing list