From: Alexander Kanavin Date: Thu, 9 Mar 2023 15:19:33 +0000 (+0100) Subject: devtool/upgrade: do not delete the workspace/recipes directory X-Git-Tag: 2023-04-mickledore~233 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=af82e59e8f08369aabd5fa6eb43022982d4e59a7;p=thirdparty%2Fopenembedded%2Fopenembedded-core.git devtool/upgrade: do not delete the workspace/recipes directory If it exists, there is no need to delete it, and if it does not, devtool prints an ugly traceback. Signed-off-by: Alexander Kanavin Signed-off-by: Alexandre Belloni Signed-off-by: Richard Purdie --- diff --git a/scripts/lib/devtool/upgrade.py b/scripts/lib/devtool/upgrade.py index 967d1570770..6c4a62b5584 100644 --- a/scripts/lib/devtool/upgrade.py +++ b/scripts/lib/devtool/upgrade.py @@ -125,11 +125,8 @@ def _write_append(rc, srctreebase, srctree, same_dir, no_same_dir, rev, copied, return af def _cleanup_on_error(rd, srctree): - rdp = os.path.split(rd)[0] # recipes folder if os.path.exists(rd): shutil.rmtree(rd) - if not len(os.listdir(rdp)): - os.rmdir(rdp) srctree = os.path.abspath(srctree) if os.path.exists(srctree): shutil.rmtree(srctree)