[elbe-devel] [PATCH v2] elbeproject: split build_cdroms() out of build()

John Ogness john.ogness at linutronix.de
Mon Jul 30 10:58:14 CEST 2018


Hi Manuel,

My Reviewed-by is included. However, I found a very small detail that
you may want to fixup before comitting. Comment inline...

On 2018-07-23, Manuel Traut <manut at linutronix.de> wrote:
> this allows building cdroms at different stages in the future.
> e.g. after building the sysroot, to include the dev packages
> on the cdroms.
>
> Signed-off-by: Manuel Traut <manut at linutronix.de>

Reviewed-by: John Ogness <john.ogness at linutronix.de>

> ---
>
> changes since v1:
>
>  * fix headline prints into validation.txt
>
>  elbepack/elbeproject.py | 73 ++++++++++++++++++++++++++---------------
>  1 file changed, 47 insertions(+), 26 deletions(-)
>
> diff --git a/elbepack/elbeproject.py b/elbepack/elbeproject.py
> index 67935ed4..9999be4d 100644
> --- a/elbepack/elbeproject.py
> +++ b/elbepack/elbeproject.py
> @@ -349,6 +349,52 @@ class ElbeProject (object):
>          # pdebuild_build(-1) means use all cpus
>          self.pdebuild_build(cpuset=-1)
>  
> +
> +    def build_cdroms(self, build_bin=True, build_sources=False, cdrom_size=None):
> +        self.repo_images = []
> +
> +        elog = ASCIIDocLog(self.validationpath, True)
> +
> +        env = None
> +        sysrootstr = ""
> +        if os.path.exists(self.sysrootpath):
> +            sysrootstr = " (including sysroot packages)"

The %s in elog.h1() already has a preceeding space. Either remove the
preceeding space in sysrootstr or in the elog.h1() lines.

> +            env = BuildEnv(self.xml, self.log, self.sysrootpath,
> +                    build_sources=build_sources, clean=False)
> +        else:
> +            env = BuildEnv(self.xml, self.log, self.chrootpath,
> +                    build_sources=build_sources, clean=False)
> +
> +        with env:
> +            init_codename = self.xml.get_initvm_codename()
> +
> +
> +            if build_bin:
> +                elog.h1("Binary CD %s" % sysrootstr)
> +
> +                self.repo_images += mk_binary_cdrom(env.rfs,
> +                                                    self.arch,
> +                                                    self.codename,
> +                                                    init_codename,
> +                                                    self.xml,
> +                                                    self.builddir,
> +                                                    self.log,
> +                                                    cdrom_size=cdrom_size)
> +            if build_sources:
> +                elog.h1("Source CD %s" % sysrootstr)
> +                try:
> +                    self.repo_images += mk_source_cdrom(env.rfs,
> +                                                        self.arch,
> +                                                        self.codename,
> +                                                        init_codename,
> +                                                        self.builddir,
> +                                                        self.log,
> +                                                        cdrom_size=cdrom_size,
> +                                                        xml=self.xml)
> +                except SystemError as e:
> +                    # e.g. no deb-src urls specified
> +                    elog.printo(str(e))
> +
>      def build(self, skip_debootstrap=False, build_bin=False,
>                build_sources=False, cdrom_size=None, debug=False,
>                skip_pkglist=False, skip_pbuild=False):
> @@ -504,32 +550,7 @@ class ElbeProject (object):
>              grub_fw_type = ""
>          self.targetfs.part_target(self.builddir, grub_version, grub_fw_type)
>  
> -        # Build cdrom images
> -        self.repo_images = []
> -        with self.buildenv:
> -            init_codename = self.xml.get_initvm_codename()
> -            if build_bin:
> -                self.repo_images += mk_binary_cdrom(self.buildenv.rfs,
> -                                                    self.arch,
> -                                                    self.codename,
> -                                                    init_codename,
> -                                                    self.xml,
> -                                                    self.builddir,
> -                                                    self.log,
> -                                                    cdrom_size=cdrom_size)
> -            if build_sources:
> -                try:
> -                    self.repo_images += mk_source_cdrom(self.buildenv.rfs,
> -                                                        self.arch,
> -                                                        self.codename,
> -                                                        init_codename,
> -                                                        self.builddir,
> -                                                        self.log,
> -                                                        cdrom_size=cdrom_size,
> -                                                        xml=self.xml)
> -                except SystemError as e:
> -                    # e.g. no deb-src urls specified
> -                    self.log.printo(str(e))
> +        self.build_cdroms(build_bin, build_sources, cdrom_size)
>  
>          if self.postbuild_file:
>              self.log.h2("postbuild script:")



More information about the elbe-devel mailing list