diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2015-05-13 14:33:16 +0000 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2015-05-14 14:40:37 +0000 |
commit | 2607fa30774f9990b24d7a1213836668f1a68077 (patch) | |
tree | 5972c6a0e9125aab6a333e82ec12d996e777e83f /morphlib/localrepocache.py | |
parent | 1da8ee6f66718de5d5dd413e188425ee4bdcfb47 (diff) | |
download | morph-2607fa30774f9990b24d7a1213836668f1a68077.tar.gz |
Fix crash in handling of recursive submodules
It turns out I completely broke Morph's handling of recursive submodules
in commit 0855c357e74e6dd7a.
We didn't notice because nothing in the reference systems actually uses
recursive submodules. However, building the baserock/tlsa/mason2 branch
of definitions.git triggered the bug due to the
delta:python-packages/gitpython chunk, which contains
delta:python-packages/gitdb which in turn contains
delta:python-packages/smmap.
The error is this:
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/cliapp/app.py", line 190, in _run
self.process_args(args)
File "/src/morph/morphlib/app.py", line 290, in process_args
cliapp.Application.process_args(self, args)
File "/usr/lib/python2.7/site-packages/cliapp/app.py", line 539, in process_args
method(args[1:])
File "/src/morph/morphlib/plugins/build_plugin.py", line 291, in build
self._build(source_pool, filename, component_names=component_names)
File "/src/morph/morphlib/plugins/build_plugin.py", line 316, in _build
bc.build_in_order(component)
File "/src/morph/morphlib/buildcommand.py", line 296, in build_in_order
self.cache_or_build_source(s, build_env)
File "/src/morph/morphlib/buildcommand.py", line 316, in cache_or_build_source
self.build_source(source, build_env)
File "/src/morph/morphlib/buildcommand.py", line 336, in build_source
self.fetch_sources(source)
File "/src/morph/morphlib/buildcommand.py", line 400, in fetch_sources
self.lrc.ensure_submodules(source.repo, source.sha1)
File "/src/morph/morphlib/localrepocache.py", line 308, in ensure_submodules
if (submod.url, submod.commit) not in done:
AttributeError: 'tuple' object has no attribute 'url'
This commit fixes the breakage and the baserock/tlsa/mason2 branch of
definitions.git now builds again.
Change-Id: Id24ac40f4670a60655e84953bcfd84d8f77e1da9
Diffstat (limited to 'morphlib/localrepocache.py')
-rw-r--r-- | morphlib/localrepocache.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/morphlib/localrepocache.py b/morphlib/localrepocache.py index 1d80c463..f9ecdc0c 100644 --- a/morphlib/localrepocache.py +++ b/morphlib/localrepocache.py @@ -316,5 +316,5 @@ class LocalRepoCache(object): cached_repo = self.get_updated_repo(url, ref=ref) for submod in submodules_for_repo(cached_repo.path, ref): - if (submod.url, submod.commit) not in done: - subs_to_process.add((submod.url, submod.commit)) + if submod not in done: + subs_to_process.append(submod) |