summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2015-04-28 12:22:36 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-05-01 17:08:49 +0100
commit24e5ad268ceb3272a370f67ac3ee02f38f92f2ee (patch)
treea8899103da753c684c1b61531bbc85caf4aef126 /scripts
parentbae779411213b73376b2d713683e3392829acef9 (diff)
downloadpoky-24e5ad268ceb3272a370f67ac3ee02f38f92f2ee.tar.gz
recipetool: avoid second-level subdir when extracting
When -x was specified, we were getting the normal unpack subdirectory which we don't really want - if there's only one subdirectory unpacked then we should effectively copy just it to the extraction path, not as a subdirectory under it. (From OE-Core rev: 0eeecce96a0aa757c2c4c4ac4d82e3bcbf0f982c) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-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: