summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--scripts/lib/recipetool/create.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py
index 1c71b24bfb..1d5bfd995c 100644
--- a/scripts/lib/recipetool/create.py
+++ b/scripts/lib/recipetool/create.py
@@ -1,6 +1,6 @@
1# Recipe creation tool - create command plugin 1# Recipe creation tool - create command plugin
2# 2#
3# Copyright (C) 2014 Intel Corporation 3# Copyright (C) 2014-2015 Intel Corporation
4# 4#
5# This program is free software; you can redistribute it and/or modify 5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License version 2 as 6# it under the terms of the GNU General Public License version 2 as
@@ -110,11 +110,8 @@ def create_recipe(args):
110 if '://' in args.source: 110 if '://' in args.source:
111 # Fetch a URL 111 # Fetch a URL
112 srcuri = args.source 112 srcuri = args.source
113 if args.extract_to: 113 tempsrc = tempfile.mkdtemp(prefix='recipetool-')
114 srctree = args.extract_to 114 srctree = tempsrc
115 else:
116 tempsrc = tempfile.mkdtemp(prefix='recipetool-')
117 srctree = tempsrc
118 logger.info('Fetching %s...' % srcuri) 115 logger.info('Fetching %s...' % srcuri)
119 checksums = fetch_source(args.source, srctree) 116 checksums = fetch_source(args.source, srctree)
120 dirlist = os.listdir(srctree) 117 dirlist = os.listdir(srctree)
@@ -240,6 +237,10 @@ def create_recipe(args):
240 outlines.append('') 237 outlines.append('')
241 outlines.extend(lines_after) 238 outlines.extend(lines_after)
242 239
240 if args.extract_to:
241 shutil.move(srctree, args.extract_to)
242 logger.info('Source extracted to %s' % args.extract_to)
243
243 if outfile == '-': 244 if outfile == '-':
244 sys.stdout.write('\n'.join(outlines) + '\n') 245 sys.stdout.write('\n'.join(outlines) + '\n')
245 else: 246 else: