From 57f843146ed62c04c23bc380dc8cb38aba264f1c Mon Sep 17 00:00:00 2001 From: Robert Yang Date: Tue, 29 May 2012 22:53:07 +0800 Subject: scripts: replace os.system with subprocess.call Replace os.system with subprocess.call since the older function would fail (more or less) silently if the executed program cannot be found More info: http://docs.python.org/library/subprocess.html#subprocess-replacements [YOCTO #2454] Signed-off-by: Robert Yang Signed-off-by: Richard Purdie --- scripts/rpm-createsolvedb.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'scripts/rpm-createsolvedb.py') diff --git a/scripts/rpm-createsolvedb.py b/scripts/rpm-createsolvedb.py index 0d5f2198a9..a5b61bade7 100755 --- a/scripts/rpm-createsolvedb.py +++ b/scripts/rpm-createsolvedb.py @@ -14,6 +14,7 @@ import sys, os import hashlib import stat +import subprocess if len(sys.argv) < 1: print("Error, rpm command not specified") @@ -44,7 +45,7 @@ for path in paths: continue if os.path.exists(path + "/solvedb"): - os.system("rm -rf %s" % (path + "/solvedb")) + subprocess.call("rm -rf %s" % (path + "/solvedb"), shell=True) os.mkdir(path + "/solvedb") m = open(path + "/solvedb/manifest", "w") m.write("# Dynamically generated solve manifest\n") @@ -56,7 +57,7 @@ for path in paths: --noaid --nodeps --noorder --noscripts --notriggers --noparentdirs --nolinktos --stats \ --ignoresize --nosignature --nodigest -D "__dbi_txn create nofsync" \ ' + path + '/solvedb/manifest' - os.system(cmd) + subprocess.call(cmd, shell=True) open(path + "/solvedb.checksum", "w").write(checksum) open(path + "/solvedb.done", "w") -- cgit v1.2.3