[PATCH 3/4] Make dnf._base and dnf._base.comps always available.

David Shea dshea at redhat.com
Tue Jan 6 20:33:41 UTC 2015


Instead of setting _base to None when a dnf payload is unsetup,
reconfigure it. Initialize the comps property as soon as the payload is
configured (and before any repos have been set) so that the environment
and group properties can be used immediately.
---
 pyanaconda/packaging/dnfpayload.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/pyanaconda/packaging/dnfpayload.py b/pyanaconda/packaging/dnfpayload.py
index 757885d..90f9480 100644
--- a/pyanaconda/packaging/dnfpayload.py
+++ b/pyanaconda/packaging/dnfpayload.py
@@ -189,6 +189,7 @@ class DNFPayload(packaging.PackagePayload):
     def unsetup(self):
         super(DNFPayload, self).unsetup()
         self._base = None
+        self._configure()
 
     def _replace_vars(self, url):
         """ Replace url variables with their values
@@ -343,6 +344,12 @@ class DNFPayload(packaging.PackagePayload):
         # transaction, disable it in RPM:
         conf.tsflags.append('nocrypto')
 
+        # Start with an empty comps so we can go ahead and use the environment
+        # and group properties. Unset reposdir to ensure dnf has nothing it can
+        # check automatically
+        conf.reposdir = []
+        self._base.read_comps()
+
         conf.reposdir = REPO_DIRS
 
     @property
-- 
2.1.0



More information about the anaconda-patches mailing list