[elbe-devel] [PATCH v2] elbe-dump: remove LOCALMACHINE from sources.list

Torben Hohn torben.hohn at linutronix.de
Wed Sep 2 17:16:03 CEST 2020


On Wed, Sep 02, 2020 at 12:04:15PM +0200, Christian Teklenborg wrote:
> When LOCALMACHINE is used within an Elbe XML, a line 'deb ... http://10.0.2.2'
> is appended to /etc/apt/sources.list. Remove it so that any apt operation on
> the resulting system shall not give any warning or error.
> 
> Signed-off-by: Christian Teklenborg <chris at linutronix.de>
> ---
>  elbepack/dump.py | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/elbepack/dump.py b/elbepack/dump.py
> index edc6637f..84920e97 100644
> --- a/elbepack/dump.py
> +++ b/elbepack/dump.py
> @@ -164,6 +164,19 @@ def check_full_pkgs(pkgs, fullpkgs, cache):
>          validation.info("No Errors found")
>  
>  
> +def clean_apt_sources_list():
> +
> +    src_path = "../target/etc/apt/sources.list"

you are assuming, that the current working directory is the project dir.

anyways... please make that a finetuning action.
it might also make sense, to have a parameter.

because we might want to remove other repositories which are not
available at the targets deployment site also.


> +
> +    with open(src_path, "r") as f:
> +        src_lst = f.read().split('\n')
> +
> +    src_lst = [src for src in src_lst if "10.0.2.2" not in src]
> +
> +    with open(src_path, "w") as f:
> +        f.write('\n'.join(src_lst) + '\n')
> +
> +
>  def elbe_report(xml, buildenv, cache, targetfs):
>  
>      # pylint: disable=too-many-arguments
> @@ -173,6 +186,8 @@ def elbe_report(xml, buildenv, cache, targetfs):
>  
>      rfs = buildenv.rfs
>  
> +    clean_apt_sources_list()
> +
>      report.info("ELBE Report for Project %s\n\n"
>                  "Report timestamp: %s\n"
>                  "elbe: %s",
> -- 
> 2.20.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