mirror of
git://git.yoctoproject.org/poky.git
synced 2025-07-19 21:09:03 +02:00
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>
This commit is contained in:
parent
bae7794112
commit
24e5ad268c
|
@ -1,6 +1,6 @@
|
||||||
# Recipe creation tool - create command plugin
|
# 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
|
# 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
|
# 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:
|
if '://' in args.source:
|
||||||
# Fetch a URL
|
# Fetch a URL
|
||||||
srcuri = args.source
|
srcuri = args.source
|
||||||
if args.extract_to:
|
tempsrc = tempfile.mkdtemp(prefix='recipetool-')
|
||||||
srctree = args.extract_to
|
srctree = tempsrc
|
||||||
else:
|
|
||||||
tempsrc = tempfile.mkdtemp(prefix='recipetool-')
|
|
||||||
srctree = tempsrc
|
|
||||||
logger.info('Fetching %s...' % srcuri)
|
logger.info('Fetching %s...' % srcuri)
|
||||||
checksums = fetch_source(args.source, srctree)
|
checksums = fetch_source(args.source, srctree)
|
||||||
dirlist = os.listdir(srctree)
|
dirlist = os.listdir(srctree)
|
||||||
|
@ -240,6 +237,10 @@ def create_recipe(args):
|
||||||
outlines.append('')
|
outlines.append('')
|
||||||
outlines.extend(lines_after)
|
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 == '-':
|
if outfile == '-':
|
||||||
sys.stdout.write('\n'.join(outlines) + '\n')
|
sys.stdout.write('\n'.join(outlines) + '\n')
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user