Fix "devtool finish --force" command, by allowing to copy folders that were not previously existing but also by preventing it from trying to remove non-existent files. Devtool was particularly confused when using the finish subcommand on a recipe that was just added.
Fixes: ce8190c51905: devtool: Drop oe-local-files and simplify Signed-off-by: Mathieu Dubois-Briand <[email protected]> --- scripts/lib/devtool/standard.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py index 9b2643604d1d..536411efef6a 100644 --- a/scripts/lib/devtool/standard.py +++ b/scripts/lib/devtool/standard.py @@ -1461,13 +1461,17 @@ def _export_local_files(srctree, rd, destdir, srctreebase): if os.path.exists(os.path.join(fullfile, ".git")): # submodules handled elsewhere continue - if f not in existing_files: + if f not in existing_files and os.path.exists(fullfile): added[f] = {} + parentdir = os.path.normpath(os.path.join(destdir, f, os.pardir)) + if not os.path.isdir(parentdir): + os.makedirs(parentdir) + if os.path.isdir(os.path.join(srctree, f)): shutil.copytree(fullfile, os.path.join(destdir, f)) else: shutil.copy2(fullfile, os.path.join(destdir, f)) - elif not os.path.exists(fullfile): + elif f in existing_files and not os.path.exists(fullfile): removed[f] = existing_files[f] elif f in existing_files: updated[f] = {'path' : existing_files[f]} -- 2.47.3
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#243518): https://lists.openembedded.org/g/openembedded-core/message/243518 Mute This Topic: https://lists.openembedded.org/mt/120774329/21656 Group Owner: [email protected] Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
