[Fedora-livecd-list] 2 commits - imgcreate/creator.py imgcreate/kickstart.py

Jim Gettys jg at laptop.org
Fri Sep 5 15:11:41 UTC 2008


I updated from git; running with the PYTHONPATH set, I get:
                         - Jim


tune2fs 1.40.8 (13-Mar-2008)
Setting maximal mount count to -1
Setting interval between checks to 0 seconds
filespec_eval:  hash table stats: 12 elements, 11/65536 buckets used,
longest chain length 2
Traceback (most recent call last):
  File "./livecd/tools/livecd-creator", line 136, in <module>
    sys.exit(main())
  File "./livecd/tools/livecd-creator", line 119, in main
    creator.install()
  File "/home/build/livecd/imgcreate/creator.py", line 644, in install
    if kickstart.inst_langs(self.ks) != None:
  File "/home/build/livecd/imgcreate/kickstart.py", line 530, in
inst_langs
    return ks.handler.packages.instLange
AttributeError: Packages instance has no attribute 'instLange'


On Fri, 2008-09-05 at 14:54 +0000, Jeremy Katz wrote:
> imgcreate/creator.py   |    3 +++
>  imgcreate/kickstart.py |   19 +++++++++++++++++++
>  2 files changed, 22 insertions(+)
> 
> New commits:
> commit 9d05379c53f718699080bdce60a4457b13dd5870
> Author: Bryan Kearney <bkearney at redhat.com>
> Date:   Thu Sep 4 16:47:07 2008 -0400
> 
>     Record rpm macro information
>     
>     Record used rpm macros into the /etc/rpm/macros.imgcreate so
>     they persist with the image
> 
> diff --git a/imgcreate/creator.py b/imgcreate/creator.py
> index f8ecdfd..519735e 100644
> --- a/imgcreate/creator.py
> +++ b/imgcreate/creator.py
> @@ -720,6 +720,7 @@ class ImageCreator(object):
>          kickstart.ServicesConfig(self._instroot).apply(ksh.services)
>          kickstart.XConfig(self._instroot).apply(ksh.xconfig)
>          kickstart.NetworkConfig(self._instroot).apply(ksh.network)
> +        kickstart.RPMMacroConfig(self._instroot).apply(self.ks)
>  
>          self._create_bootconfig()
>  
> diff --git a/imgcreate/kickstart.py b/imgcreate/kickstart.py
> index 8444682..7072d51 100644
> --- a/imgcreate/kickstart.py
> +++ b/imgcreate/kickstart.py
> @@ -234,6 +234,22 @@ class XConfig(KickstartConfig):
>          f.write(buf)
>          f.close()
>  
> +class RPMMacroConfig(KickstartConfig):
> +    """A class to apply the specified rpm macros to the filesystem"""
> +    def apply(self, ks):
> +        if not ks:
> +            return
> +        f = open(self.path("/etc/rpm/macros.imgcreate"), "w+")
> +        if exclude_docs(ks):
> +            f.write("%_exludedocs 1\n")
> +        if not selinux_enabled(ks):
> +            f.write("%__file_context_path %{nil}\n")
> +        if inst_langs(ks) != None:
> +            f.write("%_install_langs ")
> +            f.write(inst_langs(ks))
> +            f.write("\n")
> +        f.close()
> +
>  class NetworkConfig(KickstartConfig):
>      """A class to apply a kickstart network configuration to a system."""
>      def write_ifcfg(self, network):
> 
> 
> commit 39f6ab31a40e9fe9c0f07f5963d00b7f0fc27fa6
> Author: Bryan Kearney <bkearney at redhat.com>
> Date:   Thu Sep 4 15:08:57 2008 -0400
> 
>     Added logic for the --instLangs %packages option to be used
>     
>     This patch adds support for the --instLangs option being passed in on the
>     %packages line
>     
>     Note that currently, pykickstart sets the option to be instLange not
>     instLangs. This patch uses the bad option name.
> 
> diff --git a/imgcreate/creator.py b/imgcreate/creator.py
> index d9fa711..f8ecdfd 100644
> --- a/imgcreate/creator.py
> +++ b/imgcreate/creator.py
> @@ -641,6 +641,8 @@ class ImageCreator(object):
>              rpm.addMacro("_excludedocs", "1")
>          if not kickstart.selinux_enabled(self.ks):
>              rpm.addMacro("__file_context_path", "%{nil}")
> +        if kickstart.inst_langs(self.ks) != None:
> +            rpm.addMacro("_install_langs", kickstart.inst_langs(self.ks))
>  
>          try:
>              self.__select_packages(ayum)
> diff --git a/imgcreate/kickstart.py b/imgcreate/kickstart.py
> index 11eac7c..8444682 100644
> --- a/imgcreate/kickstart.py
> +++ b/imgcreate/kickstart.py
> @@ -510,6 +510,9 @@ def ignore_missing(ks):
>  def exclude_docs(ks):
>      return ks.handler.packages.excludeDocs
>  
> +def inst_langs(ks):
> +    return ks.handler.packages.instLange
> +
>  def get_post_scripts(ks):
>      scripts = []
>      for s in ks.handler.scripts:
> 
> 
> --
> Fedora-livecd-list mailing list
> Fedora-livecd-list at redhat.com
> https://www.redhat.com/mailman/listinfo/fedora-livecd-list
-- 
Jim Gettys <jg at laptop.org>
One Laptop Per Child




More information about the livecd mailing list