diff options
author | Alex Kiernan <alex.kiernan@gmail.com> | 2019-05-05 06:24:27 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-05-20 14:38:16 +0100 |
commit | 95aebbe1193a47fcfa8b6550f957e492912cb02a (patch) | |
tree | 179b8b5c7daa0085bdaad327ea688ca5cb40c7e2 /scripts | |
parent | 1f13862dbe71470628f9963ba324c67853b1c918 (diff) | |
download | poky-95aebbe1193a47fcfa8b6550f957e492912cb02a.tar.gz |
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/create.py", 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")
(From OE-Core rev: 326188e1e2424bdabe9cf83a8087b5ee046aa7f6)
Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/lib/recipetool/create.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py index 1810c70ae2..dbd74a1ca3 100644 --- a/scripts/lib/recipetool/create.py +++ b/scripts/lib/recipetool/create.py | |||
@@ -704,7 +704,7 @@ def create_recipe(args): | |||
704 | if not args.autorev and srcrev == '${AUTOREV}': | 704 | if not args.autorev and srcrev == '${AUTOREV}': |
705 | if os.path.exists(os.path.join(srctree, '.git')): | 705 | if os.path.exists(os.path.join(srctree, '.git')): |
706 | (stdout, _) = bb.process.run('git rev-parse HEAD', cwd=srctree) | 706 | (stdout, _) = bb.process.run('git rev-parse HEAD', cwd=srctree) |
707 | srcrev = stdout.rstrip() | 707 | srcrev = stdout.rstrip() |
708 | lines_before.append('SRCREV = "%s"' % srcrev) | 708 | lines_before.append('SRCREV = "%s"' % srcrev) |
709 | if args.provides: | 709 | if args.provides: |
710 | lines_before.append('PROVIDES = "%s"' % args.provides) | 710 | lines_before.append('PROVIDES = "%s"' % args.provides) |