mirror of
https://git.yoctoproject.org/poky
synced 2026-01-29 21:08:42 +01:00
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: 7dbaaf8a823527a3523187327f5b0885fc682510)
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>
This commit is contained in:
committed by
Richard Purdie
parent
a005b1897a
commit
fa3daedf7c
@@ -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, _) = bb.process.run('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)
|
||||
|
||||
Reference in New Issue
Block a user