summaryrefslogtreecommitdiffstats
path: root/scripts/lib
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2015-06-09 17:08:43 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-06-18 09:14:06 +0100
commit32ed5f5769499f1ff64043adee498bf4b4fd60bd (patch)
treef5d691c1da695987ff0211a9b6801df31180aee2 /scripts/lib
parent44e036904c0a66a2c88821f49b4989792775cc4f (diff)
downloadpoky-32ed5f5769499f1ff64043adee498bf4b4fd60bd.tar.gz
recipetool: appendfile: fix file command error handling
* It turns out that not all versions of the file command support the -E option - the version in Ubuntu 14.04 doesn't support it for example. This option is supposed to force file to return an error if the file can't be opened - since we can't rely upon it then fall back to looking at the output instead. (The results of this issue were simply that we didn't notice if the file was executable and give a warning, which tripped an oe-selftest failure - so it was minor.) * If we receive an error there's not much point looking at the output to see what type was returned because there wasn't one. (From OE-Core rev: 7bf9dccef1aa626adc9c45addcd066fed69cace9) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib')
-rw-r--r--scripts/lib/recipetool/append.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/lib/recipetool/append.py b/scripts/lib/recipetool/append.py
index 28015c683d..ed4ce4a805 100644
--- a/scripts/lib/recipetool/append.py
+++ b/scripts/lib/recipetool/append.py
@@ -262,10 +262,12 @@ def appendfile(args):
262 262
263 stdout = '' 263 stdout = ''
264 try: 264 try:
265 (stdout, _) = bb.process.run('LANG=C file -E -b %s' % args.newfile, shell=True) 265 (stdout, _) = bb.process.run('LANG=C file -b %s' % args.newfile, shell=True)
266 if 'cannot open' in stdout:
267 raise bb.process.ExecutionError(stdout)
266 except bb.process.ExecutionError as err: 268 except bb.process.ExecutionError as err:
267 logger.debug('file command returned error: %s' % err) 269 logger.debug('file command returned error: %s' % err)
268 pass 270 stdout = ''
269 if stdout: 271 if stdout:
270 logger.debug('file command output: %s' % stdout.rstrip()) 272 logger.debug('file command output: %s' % stdout.rstrip())
271 if ('executable' in stdout and not 'shell script' in stdout) or 'shared object' in stdout: 273 if ('executable' in stdout and not 'shell script' in stdout) or 'shared object' in stdout: