diff options
author | Chandana kalluri <ckalluri@xilinx.com> | 2021-09-27 19:40:18 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-10-23 23:14:16 +0100 |
commit | d1bb485d053a1c84a639b308657a4698623c9886 (patch) | |
tree | 64940edf122513a3e47333c65ef42646e742be8a /scripts | |
parent | ac19191a46deb8ba1acc7478c7a1e6c86cc6bb1c (diff) | |
download | poky-d1bb485d053a1c84a639b308657a4698623c9886.tar.gz |
scriptutils.py: Add check before deleting path
Add a check before deleting path when using recipetool commands to avoid the following type of errors:
Traceback (most recent call last):
File "<workdir>/sources/core/scripts/lib/scriptutils.py", line 218, in fetch_url
shutil.rmtree(path)
File "/usr/local/lib/python3.7/shutil.py", line 476, in rmtree
onerror(os.lstat, path, sys.exc_info())
File "/usr/local/lib/python3.7/shutil.py", line 474, in rmtree
orig_st = os.lstat(path)
FileNotFoundError: [Errno 2] No such file or directory: '<workdir>/build/tmp/work/recipetool-usg7o81n/work/recipe-sysroot'
ERROR: Command 'script -e -q -c "recipetool --color=always create --devtool -o /tmp/devtool5sq_op37 'file:///<SRCTREE>' -x <workdir>/build/workspace/sources/devtoolsrcxc1b9zjq -N test" /dev/null' failed
(From OE-Core rev: a21d3d8f6da9fbb71f484343244cc3a63a346337)
Signed-off-by: Sai Hari Chandana Kalluri <chandana.kalluri@xilinx.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit b6aa8b47e023004ffd6958d1cec18c2d9c95d77b)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/lib/scriptutils.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/lib/scriptutils.py b/scripts/lib/scriptutils.py index f92255d8dc..3164171eb2 100644 --- a/scripts/lib/scriptutils.py +++ b/scripts/lib/scriptutils.py | |||
@@ -215,7 +215,8 @@ def fetch_url(tinfoil, srcuri, srcrev, destdir, logger, preserve_tmp=False, mirr | |||
215 | pathvars = ['T', 'RECIPE_SYSROOT', 'RECIPE_SYSROOT_NATIVE'] | 215 | pathvars = ['T', 'RECIPE_SYSROOT', 'RECIPE_SYSROOT_NATIVE'] |
216 | for pathvar in pathvars: | 216 | for pathvar in pathvars: |
217 | path = rd.getVar(pathvar) | 217 | path = rd.getVar(pathvar) |
218 | shutil.rmtree(path) | 218 | if os.path.exists(path): |
219 | shutil.rmtree(path) | ||
219 | finally: | 220 | finally: |
220 | if fetchrecipe: | 221 | if fetchrecipe: |
221 | try: | 222 | try: |