[elbe-devel] [PATCH v2 07/15] Change os.sytem to shellhelper::system for "debpkg.py"
dion at linutronix.de
dion at linutronix.de
Mon Jun 24 17:39:04 CEST 2019
From: Olivier Dion <dion at linutronix.de>
Signed-off-by: Olivier Dion <dion at linutronix.de>
---
elbepack/debpkg.py | 21 +++++++++------------
1 file changed, 9 insertions(+), 12 deletions(-)
diff --git a/elbepack/debpkg.py b/elbepack/debpkg.py
index ede724cc..7fa5da1e 100644
--- a/elbepack/debpkg.py
+++ b/elbepack/debpkg.py
@@ -9,6 +9,8 @@ import string
from tempfile import mkdtemp
+from elbepack.shellhelper import system
+
control_template_string = """Package: ${name}
Version: ${version}
Section: main
@@ -55,7 +57,7 @@ def build_binary_deb(
pkgfname = "%s_%s_%s" % (name, version, arch)
pkgdir = os.path.join(tmpdir, pkgfname)
- os.system('mkdir -p "%s"' % os.path.join(pkgdir, "DEBIAN"))
+ system('mkdir -p "%s"' % os.path.join(pkgdir, "DEBIAN"))
write_file(
os.path.join(
pkgdir,
@@ -71,19 +73,14 @@ def build_binary_deb(
for (fname, instpath) in files:
full_instpath = os.path.join(pkgdir, instpath)
- os.system('mkdir -p "%s"' % full_instpath)
- os.system('cp -a "%s" "%s"' % (fname, full_instpath))
+ system('mkdir -p "%s"' % full_instpath)
+ system('cp -a "%s" "%s"' % (fname, full_instpath))
- os.system('dpkg-deb --build "%s"' % pkgdir)
+ system('dpkg-deb --build "%s"' % pkgdir)
- os.system(
- 'cp -v "%s" "%s"' %
- (os.path.join(
- tmpdir,
- pkgfname +
- ".deb"),
- target_dir))
+ system('cp -v "%s" "%s"' % (os.path.join(tmpdir, pkgfname + ".deb"),
+ target_dir))
- os.system('rm -r "%s"' % tmpdir)
+ system('rm -r "%s"' % tmpdir)
return pkgfname + ".deb"
--
2.11.0
More information about the elbe-devel
mailing list