summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--scripts/lib/recipetool/create.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py
index 844073bf59..15aa9bdbb3 100644
--- a/scripts/lib/recipetool/create.py
+++ b/scripts/lib/recipetool/create.py
@@ -260,6 +260,12 @@ def create_recipe(args):
260 260
261 if args.extract_to: 261 if args.extract_to:
262 scriptutils.git_convert_standalone_clone(srctree) 262 scriptutils.git_convert_standalone_clone(srctree)
263 if os.path.isdir(args.extract_to):
264 # If the directory exists we'll move the temp dir into it instead of
265 # its contents - of course, we could try to always move its contents
266 # but that is a pain if there are symlinks; the simplest solution is
267 # to just remove it first
268 os.rmdir(args.extract_to)
263 shutil.move(srctree, args.extract_to) 269 shutil.move(srctree, args.extract_to)
264 logger.info('Source extracted to %s' % args.extract_to) 270 logger.info('Source extracted to %s' % args.extract_to)
265 271