aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
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:12:01 +0100
commit7bf9dccef1aa626adc9c45addcd066fed69cace9 (patch)
treed256f6ac5dda389cbe31552484d444fd531e9c91 /scripts
parenta0a595307d28d0350c3752293ab8ebf499ee416f (diff)
downloadopenembedded-core-contrib-7bf9dccef1aa626adc9c45addcd066fed69cace9.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. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Diffstat (limited to 'scripts')
-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):
stdout = ''
try:
- (stdout, _) = bb.process.run('LANG=C file -E -b %s' % args.newfile, shell=True)
+ (stdout, _) = bb.process.run('LANG=C file -b %s' % args.newfile, shell=True)
+ if 'cannot open' in stdout:
+ raise bb.process.ExecutionError(stdout)
except bb.process.ExecutionError as err:
logger.debug('file command returned error: %s' % err)
- pass
+ stdout = ''
if stdout:
logger.debug('file command output: %s' % stdout.rstrip())
if ('executable' in stdout and not 'shell script' in stdout) or 'shared object' in stdout: