[oe-commits] [openembedded-core] 09/17: recipetool: fix unbound variable when fixed SRCREV can't be found

git at git.openembedded.org git at git.openembedded.org
Wed May 8 11:22:48 UTC 2019


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master
in repository openembedded-core.

commit 8e4b301573071ea04911b0df6533c25bc4596b93
Author: Alex Kiernan <alex.kiernan at gmail.com>
AuthorDate: Sun May 5 06:24:27 2019 +0100

    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")
    Signed-off-by: Alex Kiernan <alex.kiernan at gmail.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 scripts/lib/recipetool/create.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py
index 1810c70..dbd74a1 100644
--- a/scripts/lib/recipetool/create.py
+++ b/scripts/lib/recipetool/create.py
@@ -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)

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list