summaryrefslogtreecommitdiffstats
path: root/yuminstall.py
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2009-03-17 13:55:17 -0400
committerChris Lumens <clumens@redhat.com>2009-03-17 14:17:20 -0400
commit275591c48084283d1e154ebf1fd3b0c941723f9f (patch)
tree6d94e7a297db86850116a49d9b664bad6de139ee /yuminstall.py
parentb2b53f1ef3d0fe7526ffe723201153f421c7360a (diff)
downloadanaconda-275591c48084283d1e154ebf1fd3b0c941723f9f.tar.gz
anaconda-275591c48084283d1e154ebf1fd3b0c941723f9f.tar.xz
anaconda-275591c48084283d1e154ebf1fd3b0c941723f9f.zip
Simplify kernel package selection.
Diffstat (limited to 'yuminstall.py')
-rw-r--r--yuminstall.py64
1 files changed, 22 insertions, 42 deletions
diff --git a/yuminstall.py b/yuminstall.py
index d842a1771..a5de70225 100644
--- a/yuminstall.py
+++ b/yuminstall.py
@@ -1229,58 +1229,38 @@ reposdir=/etc/anaconda.repos.d,/tmp/updates/anaconda.repos.d,/tmp/product/anacon
return None
return pkgs[0]
- foundkernel = False
- kpkg = getBestKernelByArch("kernel", self.ayum)
-
- # FIXME: this is a bit of a hack. we shouldn't hard-code and
- # instead check by provides. but alas.
- for k in ("kernel", "kernel-smp", "kernel-PAE"):
- if len(self.ayum.tsInfo.matchNaevr(name=k)) > 0:
- self.selectModulePackages(anaconda, k)
- foundkernel = True
-
- if not foundkernel and (isys.smpAvailable() or isys.htavailable()):
+ def selectKernel(pkgname):
try:
- ksmp = getBestKernelByArch("kernel-smp", self.ayum)
+ pkg = getBestKernelByArch(pkgname, self.ayum)
except PackageSackError:
- ksmp = None
- log.debug("no kernel-smp package")
+ log.debug("no %s package" % pkgname)
+ return False
- if ksmp and ksmp.returnSimple("arch") == kpkg.returnSimple("arch"):
- foundkernel = True
- log.info("selected kernel-smp package for kernel")
- self.ayum.install(po=ksmp)
- self.selectModulePackages(anaconda, ksmp.name)
+ if not pkg:
+ return False
- if len(self.ayum.tsInfo.matchNaevr(name="gcc")) > 0:
- log.debug("selecting kernel-smp-devel")
- self.selectPackage("kernel-smp-devel.%s" % (kpkg.arch,))
+ log.info("selected %s package for kernel" % pkg.name)
+ self.ayum.install(po=pkg)
+ self.selectModulePackages(anaconda, pkg.name)
- if not foundkernel and isys.isPaeAvailable():
- try:
- kpae = getBestKernelByArch("kernel-PAE", self.ayum)
- except PackageSackError:
- kpae = None
- log.debug("no kernel-PAE package")
+ if len(self.ayum.tsInfo.matchNaevr(name="gcc")) > 0:
+ log.debug("selecting %s-devel" % pkg.name)
+ self.selectPackage("%s-devel.%s" % (pkg.name, pkg.arch))
+
+ return True
+
+ foundkernel = False
- if kpae and kpae.returnSimple("arch") == kpkg.returnSimple("arch"):
+ if isys.smpAvailable() or isys.htavailable():
+ if selectKernel("kernel-smp"):
foundkernel = True
- log.info("select kernel-PAE package for kernel")
- self.ayum.install(po=kpae)
- self.selectModulePackages(anaconda, kpae.name)
- if len(self.ayum.tsInfo.matchNaevr(name="gcc")) > 0:
- log.debug("selecting kernel-PAE-devel")
- self.selectPackage("kernel-PAE-devel.%s" % (kpkg.arch,))
+ if not foundkernel and isys.isPaeAvailable():
+ if selectKernel("kernel-PAE"):
+ foundkernel = True
if not foundkernel:
- log.info("selected kernel package for kernel")
- self.ayum.install(po=kpkg)
- self.selectModulePackages(anaconda, kpkg.name)
-
- if len(self.ayum.tsInfo.matchNaevr(name="gcc")) > 0:
- log.debug("selecting kernel-devel")
- self.selectPackage("kernel-devel.%s" % (kpkg.arch,))
+ selectKernel("kernel")
def selectFSPackages(self, storage):
for device in storage.fsset.devices: