]> code.ossystems Code Review - openembedded-core.git/commit
scriptutils.py: Add check before deleting path
authorChandana kalluri <ckalluri@xilinx.com>
Tue, 28 Sep 2021 02:40:18 +0000 (19:40 -0700)
committerAnuj Mittal <anuj.mittal@intel.com>
Mon, 4 Oct 2021 02:46:18 +0000 (10:46 +0800)
commit366070c476405a1f49e22a02c21fd99fc0ec76d9
treed5b70a167fb29bd5d3b0e8cbed3baf9135b5c0e3
parentc0993e6c4108ae65537ad6e70de90387dacc5495
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

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: Anuj Mittal <anuj.mittal@intel.com>
scripts/lib/scriptutils.py