[oe-commits] [openembedded-core] 15/60: devtool: update-recipe: check output before treating it as a string
git at git.openembedded.org
git at git.openembedded.org
Wed Nov 23 11:11:26 UTC 2016
rpurdie pushed a commit to branch master
in repository openembedded-core.
commit 66bf6978fc807ecc422fb6b6328f68bc3406cf15
Author: Paul Eggleton <paul.eggleton at linux.intel.com>
AuthorDate: Thu Nov 10 14:45:14 2016 +1300
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 at linux.intel.com>
Signed-off-by: Ross Burton <ross.burton at intel.com>
---
scripts/lib/devtool/standard.py | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index 4523048..1511641 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):
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list