]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
devtool/upgrade: do not delete the workspace/recipes directory
authorAlexander Kanavin <alex.kanavin@gmail.com>
Thu, 9 Mar 2023 15:19:33 +0000 (16:19 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 14 Mar 2023 17:09:57 +0000 (17:09 +0000)
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 <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/lib/devtool/upgrade.py

index 967d1570770929f8d3f4ea65fd13f9dfad3f13e6..6c4a62b55840ffe231e406d1672a09972609b374 100644 (file)
@@ -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)