--multilib option to ks %packages and also as an anaconda arg
Once pykickstart is built I'll also patch anaconda.spec.in to require the appropriate pykickstart version.
The new option, which can be a boot arg or an option to kickstart's packages section, is --multilib. What it does is set yum's multilib_policy to "all". The default is "best". --- anaconda | 3 +++ pyanaconda/packaging/yumpayload.py | 31 +++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 0 deletions(-)
diff --git a/anaconda b/anaconda index 0ca74a6..e42299e 100755 --- a/anaconda +++ b/anaconda @@ -230,6 +230,7 @@ def parseOptions(argv=None, cmdline=None): op.add_option("--rescue", dest="rescue", action="store_true", default=False) op.add_option("--targetarch", "rpmarch", dest="targetArch", type="string") op.add_option("--armplatform", dest="armPlatform", type="string") + op.add_option("--multilib", dest="multiLib", action="store_true", default=False)
op.add_option("-m", "--method", dest="method", default=None) op.add_option("--repo", dest="method", default=None) @@ -898,6 +899,8 @@ if __name__ == "__main__": anaconda.storage.setupDiskImages() anaconda.simpleFilter = True
+ # sets yum's multilib_policy to "all" (as opposed to "best") + ksdata.packages.multiLib = multiLib
if anaconda.displayMode == 'g': # comment out the next line to make exceptions non-fatal diff --git a/pyanaconda/packaging/yumpayload.py b/pyanaconda/packaging/yumpayload.py index 0d8e5cf..d10e356 100644 --- a/pyanaconda/packaging/yumpayload.py +++ b/pyanaconda/packaging/yumpayload.py @@ -207,6 +207,9 @@ reposdir=%s if flags.noverifyssl: buf += "sslverify=0\n"
+ if self.data.packages.multiLib: + buf += "multilib_policy=all\n" + if self.data.method.proxy: try: proxy = ProxyString(self.data.method.proxy) @@ -1239,6 +1242,34 @@ reposdir=%s
self._removeTxSaveFile()
+ if self.data.packages.multiLib: + # write out the yum config with the new multilib_policy value + # FIXME: switch to using yum-config-manager once it stops expanding + # all yumvars and writing out the expanded pairs to the conf + yb = yum.YumBase() + yum_conf_path = "/etc/yum.conf" + yb.preconf.fn = ROOT_PATH + yum_conf_path + yb.conf.multilib_policy = "all" + + # this will appear in yum.conf, which is silly + yb.conf.config_file_path = yum_conf_path + + # hack around yum having expanded $basearch in the cachedir value + cachedir = yb.conf.cachedir.replace("/%s/" % yb.arch.basearch, + "/$basearch/") + yb.conf.cachedir = cachedir + yum_conf = ROOT_PATH + yum_conf_path + if os.path.exists(yum_conf): + try: + os.rename(yum_conf, yum_conf + ".anacbak") + except OSError as e: + log.error("failed to back up yum.conf: %s" % e) + + try: + yb.conf.write(open(yum_conf, "w")) + except Exception as e: + log.error("failed to write out yum.conf: %s" % e) + super(YumPayload, self).postInstall()
class RPMCallback(object):
The new option, which can be a boot arg or an option to kickstart's packages section, is --multilib. What it does is set yum's multilib_policy to "all". The default is "best".
Are there other possible multilib policies, and will we ever be asked to support one of those in addition?
@@ -1239,6 +1242,34 @@ reposdir=%s
self._removeTxSaveFile()
if self.data.packages.multiLib:
# write out the yum config with the new multilib_policy value
# FIXME: switch to using yum-config-manager once it stops expanding
# all yumvars and writing out the expanded pairs to the conf
yb = yum.YumBase()
yum_conf_path = "/etc/yum.conf"
yb.preconf.fn = ROOT_PATH + yum_conf_path
yb.conf.multilib_policy = "all"
# this will appear in yum.conf, which is silly
yb.conf.config_file_path = yum_conf_path
# hack around yum having expanded $basearch in the cachedir value
cachedir = yb.conf.cachedir.replace("/%s/" % yb.arch.basearch,
"/$basearch/")
yb.conf.cachedir = cachedir
yum_conf = ROOT_PATH + yum_conf_path
if os.path.exists(yum_conf):
try:
os.rename(yum_conf, yum_conf + ".anacbak")
except OSError as e:
log.error("failed to back up yum.conf: %s" % e)
try:
yb.conf.write(open(yum_conf, "w"))
except Exception as e:
log.error("failed to write out yum.conf: %s" % e)
super(YumPayload, self).postInstall()
class RPMCallback(object):
Just a nitpick, but I'd like to see this in its own separate function.
- Chris
Chris Lumens (clumens@redhat.com) said:
The new option, which can be a boot arg or an option to kickstart's packages section, is --multilib. What it does is set yum's multilib_policy to "all". The default is "best".
Are there other possible multilib policies, and will we ever be asked to support one of those in addition?
There are not currently other policies in yum.
Bill
The new option, which can be a boot arg or an option to kickstart's packages section, is --multilib. What it does is set yum's multilib_policy to "all". The default is "best".
Are there other possible multilib policies, and will we ever be asked to support one of those in addition?
There are not currently other policies in yum.
Then I would be an ACK on these patches, I suppose. I just don't want to get surprised in a year or two and then need to change this to a --multilib=<policy> style argument. We can handle that in pykickstart without much difficulty but it's just annoying to have to do.
- Chris
anaconda-patches@lists.fedorahosted.org