[elbe-devel] [PATCH 03/13] Change os.sytem to call_check for "init.py"

dion at linutronix.de dion at linutronix.de
Mon Jun 24 12:48:43 CEST 2019


From: Olivier Dion <dion at linutronix.de>

Signed-off-by: Olivier Dion <dion at linutronix.de>
---
 elbepack/commands/init.py | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/elbepack/commands/init.py b/elbepack/commands/init.py
index 08f77d1e..84044baa 100644
--- a/elbepack/commands/init.py
+++ b/elbepack/commands/init.py
@@ -12,6 +12,7 @@ import sys
 import shutil
 
 from optparse import OptionParser
+from subprocess import check_call
 
 from elbepack.treeutils import etree
 from elbepack.validate import validate_xml
@@ -224,9 +225,8 @@ def run_command(argv):
                     os.path.join(out_path, "source.xml"))
 
     if opt.cdrom:
-        os.system(
-            '7z x -o%s "%s" elbe-keyring.gpg' %
-            (out_path, opt.cdrom))
+        check_call('7z x -o%s "%s" elbe-keyring.gpg' % (out_path, opt.cdrom),
+                   shell=True)
 
     if opt.devel:
         out_real = os.path.realpath(out_path)
@@ -235,8 +235,6 @@ def run_command(argv):
             ignore = '--exclude "%s"' % os.path.relpath(out_path,
                                                         start=elbe_dir)
 
-        os.system(
-            'tar cfj "%s" %s -C "%s" .' % (
-                os.path.join(out_path, "elbe-devel.tar.bz2"),
-                ignore,
-                elbe_dir))
+        check_call('tar cfj "%s" %s -C "%s" .' % (os.path.join(out_path, "elbe-devel.tar.bz2"),
+                                                  ignore, elbe_dir),
+                   shell=True)
-- 
2.11.0




More information about the elbe-devel mailing list