[PATCH] Honor kickstart and command line switches to enable multilib.

Chris Lumens clumens at redhat.com
Fri Aug 31 20:14:56 UTC 2012


> 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


More information about the anaconda-patches mailing list