summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Fedora Unity) <kanarip@fedoraunity.org>2009-07-18 20:29:10 (GMT)
committerJeroen van Meeuwen (Fedora Unity) <kanarip@fedoraunity.org>2009-07-18 20:29:10 (GMT)
commit01643517c4f40cbaeccb673f39b2eff4b4ee7b68 (patch)
tree2875d60ccfbafdd75137fd1845f17a32b4e91674
parent2a5592a1e357bcec241c0ce2a8a1287ed041dd37 (diff)
downloadrevisor-01643517c4f40cbaeccb673f39b2eff4b4ee7b68.zip
revisor-01643517c4f40cbaeccb673f39b2eff4b4ee7b68.tar.gz
revisor-01643517c4f40cbaeccb673f39b2eff4b4ee7b68.tar.xz
Do the conditionals *after* the pkglist has been selected
-rw-r--r--revisor/pkgorder.py69
1 files changed, 50 insertions, 19 deletions
diff --git a/revisor/pkgorder.py b/revisor/pkgorder.py
index fded5a9..dbb35a1 100644
--- a/revisor/pkgorder.py
+++ b/revisor/pkgorder.py
@@ -54,13 +54,13 @@ class PackageOrderer(yum.YumBase):
self.final_pkgobjs = {}
yum.YumBase.__init__(self)
- self.arch = self.cfg.architecture
self.processed = {}
# Boo
- if self.arch == "i386":
- self.arch = "i686"
+ if hasattr(self, "arch"):
+ if self.arch == "i386":
+ self.arch = "i686"
# We're gonna use this an awful lot
self.toppath = os.path.join(self.cfg.working_directory,"revisor-pungi",self.cfg.version,self.cfg.model,self.cfg.architecture,"os")
@@ -93,16 +93,6 @@ class PackageOrderer(yum.YumBase):
# packageLst = grp.mandatory_packages.keys() + grp.default_packages.keys() + grp.optional_packages.keys()
packageLst = grp.mandatory_packages.keys() + grp.default_packages.keys()
- for condreq, cond in grp.conditional_packages.iteritems():
- self.log.debug(_("Adding conditional: %s / %s") % (condreq, cond), level=9)
- pkgs = self.pkgSack.searchNevra(name=condreq)
- if len(pkgs) > 1:
- pkgs = self.bestPackagesFromList(pkgs)
- if self.tsInfo.conditionals.has_key(cond):
- self.tsInfo.conditionals[cond].extend(pkgs)
- else:
- self.tsInfo.conditionals[cond] = pkgs
-
self.log.debug(_("The following packages are in group %s: %r") % (group, packageLst), level=9)
for pkg in packageLst:
@@ -114,6 +104,16 @@ class PackageOrderer(yum.YumBase):
except yum.Errors.PackageSackError, e:
pass
+ for condreq, cond in grp.conditional_packages.iteritems():
+ self.log.debug(_("Adding conditional: %s / %s") % (condreq, cond), level=9)
+ pkgs = self.pkgSack.searchNevra(name=condreq)
+ if len(pkgs) > 1:
+ pkgs = self.bestPackagesFromList(pkgs)
+ if self.tsInfo.conditionals.has_key(cond):
+ self.tsInfo.conditionals[cond].extend(pkgs)
+ else:
+ self.tsInfo.conditionals[cond] = pkgs
+
if self.cfg.pkgorder_style == "yum":
self.resolveDeps()
else:
@@ -135,6 +135,7 @@ class PackageOrderer(yum.YumBase):
self.resolveDeps()
else:
(self.resolved_deps, self.final_pkgobjs) = revisor.misc.resolve_dependencies_inclusive(self, logger=self.log, resolved_deps=self.resolved_deps, final_pkgobjs=self.final_pkgobjs)
+ #revisor.misc.resolve_dependencies_inclusive(self, logger=self.log, resolved_deps=self.resolved_deps, final_pkgobjs=self.final_pkgobjs)
for po in self.final_pkgobjs.keys():
self.printMatchingPkgs(os.path.basename(po.localPkg()))
@@ -185,19 +186,49 @@ enabled=1
def doFileLogSetup(self, uid, logfile):
pass
- def doLoggingSetup(self, *args, **kwargs):
- pass
+ #def doLoggingSetup(self, *args, **kwargs):
+ #pass
def setup(self,pbar=None):
if not pbar == None:
self.pbar = pbar
- if hasattr(self,"_getConfig"):
- self._getConfig(fn=self.createConfig(), root=self.testpath, init_plugins=False)
+ if hasattr(self,"preconf"):
+ self.preconf.fn = self.cfg.main
+ self.preconf.init_plugins = True
+ self.preconf.plugin_types = (yum.plugins.TYPE_CORE,)
+ self.preconf.debuglevel = self.cfg.debuglevel
+ self.preconf.errorlevel = self.cfg.debuglevel
+
+ #self.preconf.arch = rpmUtils.ArchStorage()
+
+ self._getConfig()
+ elif hasattr(self,"_getConfig"):
+ self._getConfig(fn=self.cfg.main, plugin_types=(yum.plugins.TYPE_CORE,))
else:
- self.doConfigSetup(fn=self.createConfig(), root=self.testpath, init_plugins=False)
- self.log.debug(_("Using deprecated YUM function: %s()") % "doConfigSetup")
+ self.doConfigSetup(fn=self.cfg.main, plugin_types=(yum.plugins.TYPE_CORE,))
+ self.log.debug(_("Using deprecated YUM function: %s()") % "doConfigSetup", level=7)
+
+ #try:
+ #if hasattr(self,"preconf"):
+ #self.preconf.fn = self.cfg.main
+ #self.preconf.init_plugins = True
+ #self.preconf.plugin_types = (yum.plugins.TYPE_CORE,)
+ #self.preconf.debuglevel = self.cfg.debuglevel
+ #self.preconf.errorlevel = self.cfg.debuglevel
+
+ #self.preconf.arch = rpmUtils.ArchStorage()
+
+ #self._getConfig()
+ #elif hasattr(self,"_getConfig"):
+ #self._getConfig(fn=self.cfg.main, plugin_types=(yum.plugins.TYPE_CORE,))
+ #else:
+ #self.doConfigSetup(fn=self.cfg.main, plugin_types=(yum.plugins.TYPE_CORE,))
+ #self.log.debug(_("Using deprecated YUM function: %s()") % "doConfigSetup", level=7)
+ #except:
+ #self.log.error(_("yum.YumBase.doConfigSetup failed, probably an invalid configuration file %s") % self.cfg.main, recoverable=False)
+
self.doRepoSetup()
if hasattr(self,"_getTs"):
self._getTs()