summaryrefslogtreecommitdiffstats
path: root/meta/classes/package.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2012-05-30 14:20:04 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-05-30 14:21:29 +0100
commit0d9e89371158c4c329eebab3bc6609250b4c86c0 (patch)
tree3bc4b02ee601a1a4be6f7cf8c33a60251bde9032 /meta/classes/package.bbclass
parentbc386b89345d1a4c941744f911065d498028d9d3 (diff)
downloadpoky-0d9e89371158c4c329eebab3bc6609250b4c86c0.tar.gz
Revert "meta: replace os.popen with subprocess.Popen"
This reverts commit e83d8e58a6b107eea87df0ec233a1bc932b2c6e as the conversion is not correct. Its replacing readlines() calls which generate an array with what are effectively strings. There are split("\n") calls missing in many cases so this needs to be reverted until it gets fixed. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/package.bbclass')
-rw-r--r--meta/classes/package.bbclass16
1 files changed, 6 insertions, 10 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index bc83bfbf4e..41139ef921 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -1061,7 +1061,7 @@ python emit_pkgdata() {
1061 1061
1062 def get_directory_size(dir): 1062 def get_directory_size(dir):
1063 if os.listdir(dir): 1063 if os.listdir(dir):
1064 size = int(bb.process.run('du -sk %s' % dir)[0].split('\t')[0]) 1064 size = int(os.popen('du -sk %s' % dir).readlines()[0].split('\t')[0])
1065 else: 1065 else:
1066 size = 0 1066 size = 0
1067 return size 1067 return size
@@ -1221,7 +1221,7 @@ python package_do_filedeps() {
1221 rpfiles.append(os.path.join(root, file)) 1221 rpfiles.append(os.path.join(root, file))
1222 1222
1223 for files in chunks(rpfiles, 100): 1223 for files in chunks(rpfiles, 100):
1224 dep_pipe = bb.process.Popen(rpmdeps + " " + " ".join(files), shell=True).stdout 1224 dep_pipe = os.popen(rpmdeps + " " + " ".join(files))
1225 1225
1226 process_deps(dep_pipe, pkg, provides_files, requires_files) 1226 process_deps(dep_pipe, pkg, provides_files, requires_files)
1227 1227
@@ -1263,15 +1263,11 @@ python package_do_shlibs() {
1263 1263
1264 def linux_so(root, path, file): 1264 def linux_so(root, path, file):
1265 needs_ldconfig = False 1265 needs_ldconfig = False
1266 cmd = d.getVar('OBJDUMP', True) + " -p " + pipes.quote(os.path.join(root, file)) 1266 cmd = d.getVar('OBJDUMP', True) + " -p " + pipes.quote(os.path.join(root, file)) + " 2>/dev/null"
1267 cmd = "PATH=\"%s\" %s" % (d.getVar('PATH', True), cmd) 1267 cmd = "PATH=\"%s\" %s" % (d.getVar('PATH', True), cmd)
1268 try: 1268 fd = os.popen(cmd)
1269 lines = "" 1269 lines = fd.readlines()
1270 lines = bb.process.run(cmd)[0] 1270 fd.close()
1271 # Some ".so" maybe ascii text, e.g: /usr/lib64/libpthread.so,
1272 # ingore those errors.
1273 except Exception:
1274 sys.exc_clear()
1275 for l in lines: 1271 for l in lines:
1276 m = re.match("\s+NEEDED\s+([^\s]*)", l) 1272 m = re.match("\s+NEEDED\s+([^\s]*)", l)
1277 if m: 1273 if m: