path: root/scripts
diff options
authorAlex Kiernan <>2019-05-05 06:24:27 +0100
committerRichard Purdie <>2019-05-08 12:12:30 +0100
commit8e4b301573071ea04911b0df6533c25bc4596b93 (patch)
tree7ffb249465c6ecf203cc73097345f39033345222 /scripts
parent2ee246524ab881d57d8aac204f671215a25a58d3 (diff)
recipetool: fix unbound variable when fixed SRCREV can't be found
If attempting to find a fixed SRCREV fails because the directory doesn't exit, avoid failing with: Traceback (most recent call last): File "/home/vagrant/poky/scripts/recipetool", line 121, in <module> ret = main() File "/home/vagrant/poky/scripts/recipetool", line 110, in main ret = args.func(args) File "/home/vagrant/poky/scripts/lib/recipetool/", line 707, in create_recipe srcrev = stdout.rstrip() UnboundLocalError: local variable 'stdout' referenced before assignment Fixes: 000480c42797 ("recipetool / devtool: set a fixed SRCREV by default when fetching from git") Signed-off-by: Alex Kiernan <> Signed-off-by: Richard Purdie <>
Diffstat (limited to 'scripts')
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/lib/recipetool/ b/scripts/lib/recipetool/
index 1810c70ae2..dbd74a1ca3 100644
--- a/scripts/lib/recipetool/
+++ b/scripts/lib/recipetool/
@@ -704,7 +704,7 @@ def create_recipe(args):
if not args.autorev and srcrev == '${AUTOREV}':
if os.path.exists(os.path.join(srctree, '.git')):
(stdout, _) ='git rev-parse HEAD', cwd=srctree)
- srcrev = stdout.rstrip()
+ srcrev = stdout.rstrip()
lines_before.append('SRCREV = "%s"' % srcrev)
if args.provides:
lines_before.append('PROVIDES = "%s"' % args.provides)