From c53ff26201d8bdedef29d77fc8c227dd03433a9c Mon Sep 17 00:00:00 2001 From: Jesse Keating Date: Mon, 27 Aug 2007 10:33:28 -0400 Subject: [PATCH] - Add support for $releasever in repo uris. --- Changelog | 1 + pypungi/gather.py | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Changelog b/Changelog index 96b1b174..b2b44625 100644 --- a/Changelog +++ b/Changelog @@ -1,5 +1,6 @@ * Mon Aug 27 2007 Jesse Keating - Set up arch in __init__.py as it's needed for logging +- Add support for $releasever in repo uris. * Sun Aug 26 2007 Jesse Keating - Add better support for %packages syntax using native pykickstart diff --git a/pypungi/gather.py b/pypungi/gather.py index 3c0f0238..8b5c6912 100755 --- a/pypungi/gather.py +++ b/pypungi/gather.py @@ -87,6 +87,9 @@ class Gather(pypungi.PungiBase): yumconf.installroot = os.path.join(self.workdir, 'yumroot') yumconf.uid = os.geteuid() yumconf.cache = 0 + yumvars = yum.config._getEnvVar() + yumvars['releasever'] = self.config.get('default', 'version') + yumconf.yumvar = yumvars self.ayum._conf = yumconf self.ayum.repos.setCacheDir(self.ayum.conf.cachedir) @@ -119,7 +122,8 @@ class Gather(pypungi.PungiBase): else: thisrepo.baseurl = repo.baseurl self.logger.info('URI for repo %s is %s' % (repo.name, repo.baseurl)) - self.ayum._repos.add(thisrepo) + thisrepo.yumvar.update(self.ayum.conf.yumvar) + self.ayum.repos.add(thisrepo) for repo in self.ayum.repos.repos.values(): self.logger.info('Enabling repo %s' % repo.name)