Re: [PATCH] Use the yum preconf object to do $releasever substitution.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Looks ok,

Regards,

hans


On 07/08/2009 04:25 PM, Chris Lumens wrote:
---
  yuminstall.py |   16 ++++++----------
  1 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/yuminstall.py b/yuminstall.py
index 5fdca80..5170e94 100644
--- a/yuminstall.py
+++ b/yuminstall.py
@@ -555,11 +555,11 @@ class AnacondaYum(YumSorter):
      # We need to make sure $releasever gets set up before .repo files are
      # read.  Since there's no redhat-release package in /mnt/sysimage (and
      # won't be for quite a while), we need to do our own substutition.
-    def getReposFromConfig(self):
-        def _getReleasever():
-            from ConfigParser import ConfigParser
-            c = ConfigParser()
+    def _getReleasever():
+        from ConfigParser import ConfigParser
+        c = ConfigParser()

+        try:
              if os.access("%s/.treeinfo" % self.anaconda.methodstr, os.R_OK):
                  ConfigParser.read(c, "%s/.treeinfo" % self.anaconda.methodstr)
              else:
@@ -569,13 +569,8 @@ class AnacondaYum(YumSorter):
                  ConfigParser.read(c, "/tmp/.treeinfo")

              return c.get("general", "version")
-
-        try:
-            self.yumvar["releasever"] = _getReleasever()
          except:
-            self.yumvar["releasever"] = productVersion
-
-        YumSorter.getReposFromConfig(self)
+            return productVersion

      # Override this method so yum doesn't nuke our existing logging config.
      def doLoggingSetup(self, *args, **kwargs):
@@ -611,6 +606,7 @@ class AnacondaYum(YumSorter):
          if hasattr(self, "preconf"):
              self.preconf.fn = fn
              self.preconf.root = root
+            self.preconf.releasever = self._getReleasever()
              self.preconf.enabled_plugins = ["whiteout", "blacklist"]
              YumSorter._getConfig(self)
          else:

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux