diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2016-09-01 15:25:19 +1200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-09-08 00:36:48 +0100 |
commit | 17afc803204a552d2cc7aedf1c9bebb3f050e814 (patch) | |
tree | 4312bc6738fceb64de3f3c970e43f6e9a8847409 /scripts | |
parent | 9885a9dd3167670f4716991a39aed1b04e274c87 (diff) | |
download | poky-17afc803204a552d2cc7aedf1c9bebb3f050e814.tar.gz |
recipetool: create: support git submodules
Ensure we fetch submodules and set SRC_URI correctly when pointing to a
git repository that contains submodules.
(From OE-Core rev: 65d5cc62d4ecfc78ce4b37b3886a7fe5aa05a75e)
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.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/scripts/lib/recipetool/create.py b/scripts/lib/recipetool/create.py index a08352ee25..431a09dd60 100644 --- a/scripts/lib/recipetool/create.py +++ b/scripts/lib/recipetool/create.py | |||
@@ -399,6 +399,10 @@ def create_recipe(args): | |||
399 | if '<html' in f.read(100).lower(): | 399 | if '<html' in f.read(100).lower(): |
400 | logger.error('Fetching "%s" returned a single HTML page - check the URL is correct and functional' % fetchuri) | 400 | logger.error('Fetching "%s" returned a single HTML page - check the URL is correct and functional' % fetchuri) |
401 | sys.exit(1) | 401 | sys.exit(1) |
402 | if os.path.exists(os.path.join(srctree, '.gitmodules')) and srcuri.startswith('git://'): | ||
403 | srcuri = 'gitsm://' + srcuri[6:] | ||
404 | logger.info('Fetching submodules...') | ||
405 | bb.process.run('git submodule update --init --recursive', cwd=srctree) | ||
402 | 406 | ||
403 | if is_package(fetchuri): | 407 | if is_package(fetchuri): |
404 | tmpfdir = tempfile.mkdtemp(prefix='recipetool-') | 408 | tmpfdir = tempfile.mkdtemp(prefix='recipetool-') |
@@ -658,8 +662,11 @@ def create_recipe(args): | |||
658 | # devtool looks for this specific exit code, so don't change it | 662 | # devtool looks for this specific exit code, so don't change it |
659 | sys.exit(15) | 663 | sys.exit(15) |
660 | else: | 664 | else: |
661 | if srcuri and srcuri.startswith(('git://', 'hg://', 'svn://')): | 665 | if srcuri and srcuri.startswith(('gitsm://', 'git://', 'hg://', 'svn://')): |
662 | outfile = '%s_%s.bb' % (pn, srcuri.split(':', 1)[0]) | 666 | suffix = srcuri.split(':', 1)[0] |
667 | if suffix == 'gitsm': | ||
668 | suffix = 'git' | ||
669 | outfile = '%s_%s.bb' % (pn, suffix) | ||
663 | elif realpv: | 670 | elif realpv: |
664 | outfile = '%s_%s.bb' % (pn, realpv) | 671 | outfile = '%s_%s.bb' % (pn, realpv) |
665 | else: | 672 | else: |