[elbe-devel] [PATCH 4/4] elbeproject: Pass other components for src cdrom

Torben Hohn torben.hohn at linutronix.de
Thu Apr 2 15:23:34 CEST 2020


On Mon, Mar 23, 2020 at 02:53:56PM -0400, Olivier Dion wrote:
> For every components, if its path exists, ensures that
> /etc/apt/sources.list is created.  Then iterates over the list of
> installed packages and recorded it in tuple.  This informations is
> then passed down to mk_source_cdrom to download include the source in
> the desired components.
> 
> Signed-off-by: Olivier Dion <dion at linutronix.de>
> ---
>  elbepack/elbeproject.py | 29 +++++++++++++++++++++++++++--
>  1 file changed, 27 insertions(+), 2 deletions(-)
> 
> diff --git a/elbepack/elbeproject.py b/elbepack/elbeproject.py
> index b64a5fcb..2ec7f3ed 100644
> --- a/elbepack/elbeproject.py
> +++ b/elbepack/elbeproject.py
> @@ -472,7 +472,31 @@ class ElbeProject (object):
>                  if not cdrom_size and self.xml.has("src-cdrom/size"):
>                      cdrom_size = size_to_int(self.xml.text("src-cdrom/size"))
>  
> -                validation.info("Source CD %s", sysrootstr)
> +                validation.info("Source CD\n%s", sysrootstr)
> +
> +                others = {}
> +
> +                sysroot_host_path = os.path.join(self.sdkpath, "sysroots", "host")
> +
> +                components = [(self.targetpath, "target"),
> +                              (sysroot_host_path, "sysroot-host")]
> +
> +                if env.path != self.chrootpath:
> +                    components.append((self.chrootpath, "chroot"))
> +
> +                for path, name in components:
> +                    if os.path.exists(path):
> +                        validation.info("(including %s packages)", name)
> +                        others[name] = []
> +                        tmp_env = BuildEnv(self.xml, path)
> +                        with tmp_env:
> +                            tmp_env.seed_etc()
> +                        cache = self.get_rpcaptcache(env=tmp_env)
> +                        cache.update()
> +
> +                        for pkg in cache.get_installed_pkgs():
> +                            others[name].append((pkg.name, pkg.installed_version))
> +

the same as for the licence informations applies here.
The target is only a subset of the buildenv. More so... you can not
assume, that dpkg or apt is installed. 

So... and rpcaptcache for the target can not be generated.

use the pkg list returned by dump() und operate on the buildenv
rpcaptcache.

>                  try:
>                      self.repo_images += mk_source_cdrom(env.rfs,
>                                                          self.arch,
> @@ -480,7 +504,8 @@ class ElbeProject (object):
>                                                          init_codename,
>                                                          self.builddir,
>                                                          cdrom_size=cdrom_size,
> -                                                        xml=self.xml)
> +                                                        xml=self.xml,
> +                                                        others=others)
>                  except SystemError as e:
>                      # e.g. no deb-src urls specified
>                      validation.error(str(e))
> -- 
> 2.25.1
> 
> 
> _______________________________________________
> elbe-devel mailing list
> elbe-devel at linutronix.de
> https://lists.linutronix.de/mailman/listinfo/elbe-devel

-- 
Torben Hohn
Linutronix GmbH | Bahnhofstrasse 3 | D-88690 Uhldingen-Mühlhofen
Phone: +49 7556 25 999 18; Fax.: +49 7556 25 999 99

Hinweise zum Datenschutz finden Sie hier (Informations on data privacy 
can be found here): https://linutronix.de/kontakt/Datenschutz.php

Linutronix GmbH | Firmensitz (Registered Office): Uhldingen-Mühlhofen | 
Registergericht (Registration Court): Amtsgericht Freiburg i.Br., HRB700 
806 | Geschäftsführer (Managing Directors): Heinz Egger, Thomas Gleixner



More information about the elbe-devel mailing list