[elbe-devel] [PATCH 2/3] Transform the <archivedir> tag to <archive>

Torben Hohn torben.hohn at linutronix.de
Thu Sep 5 11:12:21 CEST 2019


On Wed, Sep 04, 2019 at 04:03:19PM +0200, Akash Satamkar wrote:
> The contents in the <archivedir> tag is replaced by the
> preprocessor with a base64 encoded archive of the contents
> of the directory.

this is not, what this change does.

this change adds a parameter to ElbeXML.archive_tmpfile()
so that it can be pointed to an <archive> node different from 
the root archive node.

i am also not sure, whether the parameter can be an xpath.

> 
> Signed-off-by: Akash Satamkar <akash at linutronix.de>
> ---
>  elbepack/dump.py    | 2 +-
>  elbepack/elbexml.py | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/elbepack/dump.py b/elbepack/dump.py
> index d73b3789..180ede30 100644
> --- a/elbepack/dump.py
> +++ b/elbepack/dump.py
> @@ -207,7 +207,7 @@ def elbe_report(xml, buildenv, cache, reportname, errorname, targetfs):
>      outf.h2("archive extract")
>  
>      if xml.has("archive") and not xml.text("archive") is None:
> -        with xml.archive_tmpfile() as fp:
> +        with xml.archive_tmpfile("archive") as fp:
>              outf.do('tar xvfj "%s" -h -C "%s"' % (fp.name, targetfs.path))
>          mt_index_postarch = targetfs.mtime_snap()
>      else:
> diff --git a/elbepack/elbexml.py b/elbepack/elbexml.py
> index 5972600c..9de0fa02 100644
> --- a/elbepack/elbexml.py
> +++ b/elbepack/elbexml.py
> @@ -364,9 +364,9 @@ class ElbeXML(object):
>      def append_initvm_pkg(self, aptpkg):
>          self.append_pkg(aptpkg, 'initvmpkgs')
>  
> -    def archive_tmpfile(self):
> +    def archive_tmpfile(self, xpath):
>          fp = NamedTemporaryFile()
> -        fp.write(standard_b64decode(self.text("archive")))
> +        fp.write(standard_b64decode(self.text(xpath)))
>          fp.file.flush()
>          return fp
>  
> -- 
> 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