From d4cf63b0283a9bce2c95b80fc72f07ef8ec0a3e7 Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Wed, 18 Apr 2012 11:56:28 +0100 Subject: morph: try not needing a morph for chunks --- morph | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'morph') diff --git a/morph b/morph index fd30bfa5..69156482 100755 --- a/morph +++ b/morph @@ -334,26 +334,33 @@ class Morph(cliapp.Application): cachedir, baseurls, bundle_base_url) # Reverse so we process things in the order given by the user. - queue = collections.deque(self._itertriplets(args)) + queue = collections.deque((n, r, f, None) + for n, r, f in self._itertriplets(args)) while queue: - reponame, ref, filename = queue.popleft() + reponame, ref, filename, kind = queue.popleft() self.msg('Updating %s|%s|%s' % (reponame, ref, filename)) repo = cache.cache_repo(reponame) repo.update() + if kind == 'chunk': + continue absref = repo.resolve_ref(ref) text = repo.cat(absref, filename) morphology = morphlib.morph2.Morphology(text) - if morphology['kind'] == 'system': + if kind == None: + kind = morphology['kind'] + if kind == 'system': for stratum in morphology['strata']: - queue.append((reponame, ref, '%s.morph' % stratum)) - elif morphology['kind'] == 'stratum': + queue.append((reponame, ref, '%s.morph' % stratum, + 'stratum')) + elif kind == 'stratum': if morphology['build-depends']: for stratum in morphology['build-depends']: - queue.append((reponame, ref, '%s.morph' % stratum)) + queue.append((reponame, ref, '%s.morph' % stratum, + 'stratum')) for x in morphology['sources']: queue.append((x['repo'], x['ref'], - '%s.morph' % x['morph'])) + '%s.morph' % x['morph'], 'chunk')) def cmd_build_single(self, args): '''Build a binary from a morphology but do not build its dependencies. -- cgit v1.2.1