summaryrefslogtreecommitdiff
path: root/morph
diff options
context:
space:
mode:
authorJannis Pohlmann <jannis.pohlmann@codethink.co.uk>2012-04-10 12:02:11 +0100
committerJannis Pohlmann <jannis.pohlmann@codethink.co.uk>2012-04-10 12:24:48 +0100
commitb3d622bb295b9fbd4f29727d5af2f8293a97b5fd (patch)
tree29d63a7c13cb5c6fc263070c648167a98eea2429 /morph
parentc3d3e041382d3784c8007ce1b93d431ba575654e (diff)
downloadmorph-b3d622bb295b9fbd4f29727d5af2f8293a97b5fd.tar.gz
Various small fixes to make the new update-gits work again.
Diffstat (limited to 'morph')
-rwxr-xr-xmorph23
1 files changed, 14 insertions, 9 deletions
diff --git a/morph b/morph
index e15cf952..7c3e5a07 100755
--- a/morph
+++ b/morph
@@ -53,7 +53,8 @@ class Morph(cliapp.Application):
default=defaults['git-base-url'])
self.settings.string(['bundle-server'],
'base URL to download bundles',
- metavar='URL')
+ metavar='URL',
+ default=None)
self.settings.string(['cachedir'],
'put build results in DIR',
metavar='DIR',
@@ -222,29 +223,33 @@ class Morph(cliapp.Application):
'''
- cachedir = self.settings['cachedir']
+ cachedir = os.path.join(self.settings['cachedir'], 'gits')
baseurls = self.settings['git-base-url']
- cache = LocalRepoCache(cachedir, baseurls)
+ bundle_base_url = self.settings['bundle-server']
+ cache = morphlib.localrepocache.LocalRepoCache(
+ cachedir, baseurls, bundle_base_url)
# Reverse so we process things in the order given by the user.
queue = collections.deque(self._itertriplets(args))
while queue:
- repo, ref, filename = queue.popleft()
- cache.cache_repo(repo)
- repo = cache.get_repo(repo)
+ reponame, ref, filename = queue.popleft()
+ self.msg('updating %s:%s:%s' % (reponame, ref, filename))
+ cache.cache_repo(reponame)
+ repo = cache.get_repo(reponame)
repo.update()
absref = repo.resolve_ref(ref)
text = repo.cat(absref, filename)
morphology = morphlib.morph2.Morphology(text)
if morphology['kind'] == 'system':
for stratum in morphology['strata']:
- queue.append((repo, ref, '%s.morph' % stratum))
+ queue.append((reponame, ref, '%s.morph' % stratum))
elif morphology['kind'] == 'stratum':
for stratum in morphology['build-depends']:
- queue.append((repo, ref, '%s.morph' % stratum))
+ queue.append((reponame, ref, '%s.morph' % stratum))
for x in morphology['sources']:
- queue.append((x.repo, x.ref, x.morph))
+ queue.append((x['repo'], x['ref'],
+ '%s.morph' % x['morph']))
def cmd_build_single(self, args):
'''Build a binary from a morphology but do not build its dependencies.