[elbe-devel] [PATCH 12/13] Change os.sytem to call_check for "updatedpkg.py"
dion at linutronix.de
dion at linutronix.de
Mon Jun 24 12:48:52 CEST 2019
From: Olivier Dion <dion at linutronix.de>
Signed-off-by: Olivier Dion <dion at linutronix.de>
---
elbepack/updatepkg.py | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/elbepack/updatepkg.py b/elbepack/updatepkg.py
index b41cffe0..922a3523 100644
--- a/elbepack/updatepkg.py
+++ b/elbepack/updatepkg.py
@@ -8,6 +8,7 @@ from __future__ import print_function
import os
+from subprocess import check_call
from shutil import rmtree, copyfile, copytree
from elbepack.elbexml import ElbeXML
@@ -109,7 +110,7 @@ def gen_update_pkg(project, xml_filename, upd_filename,
if os.path.exists(update):
rmtree(update)
- os.system('mkdir -p %s' % update)
+ check_call('mkdir -p %s' % update, shell=True)
if xml_filename:
repodir = os.path.join(update, "repo")
@@ -128,14 +129,11 @@ def gen_update_pkg(project, xml_filename, upd_filename,
dump_fullpkgs(project.xml, project.buildenv.rfs, cache)
project.xml.xml.write(os.path.join(update, "new.xml"))
- os.system(
- "cp %s %s" %
- (xml_filename,
- os.path.join(
- update,
- "base.xml")))
+ check_call("cp %s %s" % (xml_filename,
+ os.path.join(update, "base.xml")),
+ shell=True)
else:
- os.system("cp source.xml update/new.xml")
+ check_call("cp source.xml update/new.xml", shell=True)
if project.presh_file:
copyfile(project.presh_file, update + '/pre.sh')
--
2.11.0
More information about the elbe-devel
mailing list