[elbe-devel] [PATCH v2 2/3] Changes to the preprocessor

Akash Satamkar akash at linutronix.de
Tue Sep 10 11:20:30 CEST 2019


Pass a parameter to archive_tmpfile() method, so as to point to
an <archive> node in src-cdrom which is different from root
<archive> node.

Signed-off-by: Akash Satamkar <akash at linutronix.de>
---
 elbepack/dump.py    | 4 ++--
 elbepack/elbexml.py | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/elbepack/dump.py b/elbepack/dump.py
index 4642ae92..46eed1e2 100644
--- a/elbepack/dump.py
+++ b/elbepack/dump.py
@@ -194,8 +194,8 @@ def elbe_report(xml, buildenv, cache, targetfs):
 
     report.info("Archive extract")
 
-    if xml.has("archive") and not xml.text("archive") is None:
-        with xml.archive_tmpfile() as fp:
+    if xml.has("archive") and xml.text("archive"):
+        with xml.archive_tmpfile(xml.node("archive")) as fp:
             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..cfd8f80f 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, arch_file):
         fp = NamedTemporaryFile()
-        fp.write(standard_b64decode(self.text("archive")))
+        fp.write(standard_b64decode(arch_file.et.text))
         fp.file.flush()
         return fp
 
-- 
2.20.1




More information about the elbe-devel mailing list