summaryrefslogtreecommitdiff
path: root/lorry
diff options
context:
space:
mode:
authorJannis Pohlmann <jannis.pohlmann@codethink.co.uk>2012-02-22 18:23:33 +0000
committerJannis Pohlmann <jannis.pohlmann@codethink.co.uk>2012-02-22 18:23:33 +0000
commit814feeb2cd7597bf456cae418a3691f48ddb5a47 (patch)
tree63b4f79349f3e4114f4ca64812e4766586806185 /lorry
parent636c371a2240b1a70e73b28f733d38a2111d72b0 (diff)
downloadlorry-814feeb2cd7597bf456cae418a3691f48ddb5a47.tar.gz
Add an sed hack to avoid unrecognized headers in generated bundles.
Diffstat (limited to 'lorry')
-rwxr-xr-xlorry14
1 files changed, 14 insertions, 0 deletions
diff --git a/lorry b/lorry
index 0b272df..10979d2 100755
--- a/lorry
+++ b/lorry
@@ -114,9 +114,23 @@ class Lorry(cliapp.Application):
quote_url(bundlename)) + '.bndl'
if not os.path.exists(path) or self.settings['bundle'] == 'always':
self.progress('.. building bundle %s' % bundlename)
+
+ # create the bundle
self.run_program(['git', 'bundle', 'create', path, '--branches',
'--tags'], cwd=gitdir)
+ # FIXME this is a hack to avoid unrecognized headers in bundles,
+ # which happens with some repositories. See
+ #
+ # http://marc.info/?l=git&m=132992959317420&w=2
+ #
+ # for more information. From the bundle's header section, the
+ # expression below will remove all garbage lines that appear
+ # between the first line (the bundle format meta comment) and
+ # the list of refs.
+ expr = '1,/^[0-9a-f]\{40\}/{ /^[0-9a-f]\{40\}/!{/^[^#]/d}}'
+ self.run_program(['sed', '-i', '-e', expr, path], cwd=gitdir)
+
def gitify(self, name, spec):
self.progress('Getting %s' % name)
table = {