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-06-28 09:44:15 +0100
commit6bc56e634a9f01a84dcc64569f79a6813d0bf5ca (patch)
treeafcb024c8d6467e696f0bbade98a4d20e020d36e /scripts
parentf64d73f8c458b0bf1d3a585e92e1e37965af7aa1 (diff)
downloadast2050-yocto-poky-6bc56e634a9f01a84dcc64569f79a6813d0bf5ca.zip
ast2050-yocto-poky-6bc56e634a9f01a84dcc64569f79a6813d0bf5ca.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 master rev: 0eeecce96a0aa757c2c4c4ac4d82e3bcbf0f982c) (From OE-Core rev: 3378c932570ba2301cd02103225fcf7629de656f) 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 1c71b24..1d5bfd9 100644
--- a/scripts/lib/recipetool/create.py
+++ b/scripts/lib/recipetool/create.py
@@ -1,6 +1,6 @@
# 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
@@ -110,11 +110,8 @@ def create_recipe(args):
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)
@@ -240,6 +237,10 @@ def create_recipe(args):
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:
OpenPOWER on IntegriCloud