aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-11-02 16:46:20 +1300
committerPaul Eggleton <paul.eggleton@linux.intel.com>2016-11-10 14:40:06 +1300
commit5a9b5fccb4378b66b71e0fbfdb4ae3139d30effa (patch)
treee92e0248a17ccb0a1afa91ae02f8ae446dbe079a /scripts
parent9303d8055c45a0f6af295d70a6f6a8b9d8d8a7c9 (diff)
downloadopenembedded-core-contrib-5a9b5fccb4378b66b71e0fbfdb4ae3139d30effa.tar.gz
devtool: update-recipe: check output before treating it as a string
As of the move to Python 3 and the fixes we applied at that time, bb.process.run() will return a byte array of length 0 rather than an empty string if the output is empty. That may be a bug that we should fix, but for now it's easiest to just check the result here before treating it as a string. This fixes running "devtool update-recipe" or "devtool finish" on a recipe which has no source tree, for example initramfs-framework. Fixes [YOCTO #10563]. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/devtool/standard.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index 4523048b38..1511641099 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -332,10 +332,11 @@ def _git_ls_tree(repodir, treeish='HEAD', recursive=False):
cmd.append('-r')
out, _ = bb.process.run(cmd, cwd=repodir)
ret = {}
- for line in out.split('\0'):
- if line:
- split = line.split(None, 4)
- ret[split[3]] = split[0:3]
+ if out:
+ for line in out.split('\0'):
+ if line:
+ split = line.split(None, 4)
+ ret[split[3]] = split[0:3]
return ret
def _git_exclude_path(srctree, path):