# Recipe creation tool - create command plugin
#
-# Copyright (C) 2014 Intel Corporation
+# Copyright (C) 2014-2015 Intel Corporation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
if '://' in args.source:
# Fetch a URL
srcuri = args.source
- if args.extract_to:
- srctree = args.extract_to
- else:
- tempsrc = tempfile.mkdtemp(prefix='recipetool-')
- srctree = tempsrc
+ tempsrc = tempfile.mkdtemp(prefix='recipetool-')
+ srctree = tempsrc
logger.info('Fetching %s...' % srcuri)
checksums = fetch_source(args.source, srctree)
dirlist = os.listdir(srctree)
outlines.append('')
outlines.extend(lines_after)
+ if args.extract_to:
+ shutil.move(srctree, args.extract_to)
+ logger.info('Source extracted to %s' % args.extract_to)
+
if outfile == '-':
sys.stdout.write('\n'.join(outlines) + '\n')
else: