diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/lib/devtool/__init__.py | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/scripts/lib/devtool/__init__.py b/scripts/lib/devtool/__init__.py index 50604e6e0d..e617d60405 100644 --- a/scripts/lib/devtool/__init__.py +++ b/scripts/lib/devtool/__init__.py | |||
@@ -100,18 +100,20 @@ def setup_tinfoil(config_only=False, basepath=None, tracking=False): | |||
100 | """Initialize tinfoil api from bitbake""" | 100 | """Initialize tinfoil api from bitbake""" |
101 | import scriptpath | 101 | import scriptpath |
102 | orig_cwd = os.path.abspath(os.curdir) | 102 | orig_cwd = os.path.abspath(os.curdir) |
103 | if basepath: | 103 | try: |
104 | os.chdir(basepath) | 104 | if basepath: |
105 | bitbakepath = scriptpath.add_bitbake_lib_path() | 105 | os.chdir(basepath) |
106 | if not bitbakepath: | 106 | bitbakepath = scriptpath.add_bitbake_lib_path() |
107 | logger.error("Unable to find bitbake by searching parent directory of this script or PATH") | 107 | if not bitbakepath: |
108 | sys.exit(1) | 108 | logger.error("Unable to find bitbake by searching parent directory of this script or PATH") |
109 | 109 | sys.exit(1) | |
110 | import bb.tinfoil | 110 | |
111 | tinfoil = bb.tinfoil.Tinfoil(tracking=tracking) | 111 | import bb.tinfoil |
112 | tinfoil.prepare(config_only) | 112 | tinfoil = bb.tinfoil.Tinfoil(tracking=tracking) |
113 | tinfoil.logger.setLevel(logger.getEffectiveLevel()) | 113 | tinfoil.prepare(config_only) |
114 | os.chdir(orig_cwd) | 114 | tinfoil.logger.setLevel(logger.getEffectiveLevel()) |
115 | finally: | ||
116 | os.chdir(orig_cwd) | ||
115 | return tinfoil | 117 | return tinfoil |
116 | 118 | ||
117 | def get_recipe_file(cooker, pn): | 119 | def get_recipe_file(cooker, pn): |