summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2016-09-01 15:25:19 +1200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-09-08 00:36:43 +0100
commit65d5cc62d4ecfc78ce4b37b3886a7fe5aa05a75e (patch)
tree531b66b3311a9d6c6b95f0c85e9e8c0494b1cf41 /scripts
parent46a068ca35975988a8e9c0310f71fdcee55937a4 (diff)
downloadopenembedded-core-65d5cc62d4ecfc78ce4b37b3886a7fe5aa05a75e.tar.gz
openembedded-core-65d5cc62d4ecfc78ce4b37b3886a7fe5aa05a75e.tar.bz2
openembedded-core-65d5cc62d4ecfc78ce4b37b3886a7fe5aa05a75e.zip
recipetool: create: support git submodules
Ensure we fetch submodules and set SRC_URI correctly when pointing to a git repository that contains submodules. Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/recipetool/create.py11
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):
if '<html' in f.read(100).lower():
logger.error('Fetching "%s" returned a single HTML page - check the URL is correct and functional' % fetchuri)
sys.exit(1)
+ if os.path.exists(os.path.join(srctree, '.gitmodules')) and srcuri.startswith('git://'):
+ srcuri = 'gitsm://' + srcuri[6:]
+ logger.info('Fetching submodules...')
+ bb.process.run('git submodule update --init --recursive', cwd=srctree)
if is_package(fetchuri):
tmpfdir = tempfile.mkdtemp(prefix='recipetool-')
@@ -658,8 +662,11 @@ def create_recipe(args):
# devtool looks for this specific exit code, so don't change it
sys.exit(15)
else:
- if srcuri and srcuri.startswith(('git://', 'hg://', 'svn://')):
- outfile = '%s_%s.bb' % (pn, srcuri.split(':', 1)[0])
+ if srcuri and srcuri.startswith(('gitsm://', 'git://', 'hg://', 'svn://')):
+ suffix = srcuri.split(':', 1)[0]
+ if suffix == 'gitsm':
+ suffix = 'git'
+ outfile = '%s_%s.bb' % (pn, suffix)
elif realpv:
outfile = '%s_%s.bb' % (pn, realpv)
else: