The 'srctree' argument might point to an existing source directory, and
'devtool modify' without '--no-extract' given (maybe because of the
user's forgetfulness or inexperience) will override its content without
futher warning. Catch this accidental use case, and prompt the user to
specify '--no-extract' if this source tree should be used.

Signed-off-by: Roland Hieber <[email protected]>
---
Note: this patch was developed on kirkstone and will probably also apply
on scarthgap.

 scripts/lib/devtool/standard.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index b2e1a6ca3a5e..5354f298f598 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -790,6 +790,10 @@ def modify(args, config, basepath, workspace):
                             "not exist or is not a directory" %
                             srctree)
 
+        if not args.no_extract and os.path.isdir(srctree):
+            raise DevtoolError("Source path %s already exists. Did you mean to 
"
+                               "specify --no-extract?" % srctree)
+
         recipefile = rd.getVar('FILE')
         appendfile = recipe_to_append(recipefile, config, args.wildcard)
         if os.path.exists(appendfile):
-- 
2.39.5

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#205118): 
https://lists.openembedded.org/g/openembedded-core/message/205118
Mute This Topic: https://lists.openembedded.org/mt/108735796/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to