Source: git-buildpackage
Version: 0.8.12.1
Severity: important
Tags: patch

Hi,

Pretty certain this a regression from #577810 but it is no
longer possible to import various Debian native packages such
as apt and git-buildpackage itself:

$ gbp import-dsc --verbose --download apt
gbp:warning: Passing --download explicitly is deprecated.
gbp:debug: ['git', 'rev-parse', '--show-cdup']
gbp:info: Downloading 'apt' using 'apt-get'...
gbp:debug: apt-get ['--download-only', '-qq', 'source', 'apt'] []
gbp:debug: Debian Native Package
gbp:debug: Version: 1.4~beta4
gbp:debug: Debian tarball: /tmp/tmp85CXa3/apt_1.4~beta4.tar.xz
gbp:info: No git repository found, creating one.
gbp:debug: ['git', 'init']
gbp:debug: ['git', 'rev-parse', '--show-cdup']
gbp:debug: ['git', 'rev-parse', '--is-bare-repository']
gbp:debug: ['git', 'rev-parse', '--git-dir']
gbp:debug: ['git', 'config', 'user.name', 'Chris Lamb']
gbp:debug: ['git', 'config', 'user.email', 'la...@debian.org']
gbp:debug: tar ['-C', 
'/home/lamby/temp/cdt.20170206182054.hYM5Oha2O3/tmpisHWRy', '-a', '-xf', 
'/tmp/tmp85CXa3/apt_1.4~beta4.tar.xz'] []
gbp:debug: ['git', 'tag', '-l', 'debian/1.4_beta4']
gbp:debug: ['git', 'tag', '-l', 'debian/1.4.beta4']
gbp:debug: ['git', 'tag', '-l', 'debian/1.4_beta4']
gbp:debug: ['git', 'tag', '-l', 'debian/1.4.beta4']
gbp:info: Tag debian/1.4_beta4 not found, importing Debian tarball
gbp:debug: ['git', 'add', '-f', '.']
gbp:debug: ['git', 'write-tree']
gbp:debug: ['git', 'commit-tree', '046e88c2658cb144ce0968b3ebd280c4d3153ed3']
gbp:debug: ['git', 'update-ref', '-m', 'gbp: Import Debian version 
1.4~beta4\n\napt (1.4~beta4) unstable; urgency=med
<snip very long line here>
gbp:error: Git command failed: Error running git update-ref: [Errno 7] Argument 
list too long
gbp:debug: rm ['-rf', 
'/home/lamby/temp/cdt.20170206182054.hYM5Oha2O3/tmpisHWRy'] []
gbp:debug: rm ['-rf', '/tmp/tmp85CXa3'] []

$ echo $?
1

Patch attached.


Regards,

-- 
      ,''`.
     : :'  :     Chris Lamb
     `. `'`      la...@debian.org / chris-lamb.co.uk
       `-
diff --git a/gbp/scripts/import_dsc.py b/gbp/scripts/import_dsc.py
index 280be43..02ae343 100644
--- a/gbp/scripts/import_dsc.py
+++ b/gbp/scripts/import_dsc.py
@@ -446,10 +446,16 @@ def main(argv):
             if src.native:
                 author = get_author_from_changelog(upstream.unpacked)
                 committer = get_committer_from_author(author, options)
-                commit_msg = "Import %s\n%s" % (msg, 
get_changes(upstream.unpacked,
-                                                                 repo,
-                                                                 is_empty,
-                                                                 
options.debian_branch))
+                changes = get_changes(upstream.unpacked,
+                                      repo,
+                                      is_empty,
+                                      options.debian_branch)
+                # Truncate debian/changelog if necessary to avoid the
+                # command-line argument list becoming too long.
+                max_len = 10000
+                if len(changes) > max_len:
+                    changes = "%s\n\n[changelog truncated at %d bytes]" % 
(changes[:max_len], max_len)
+                commit_msg = "Import %s\n%s" % (msg, changes)
             else:
                 author = committer = {}
                 commit_msg = "Import %s" % msg

Reply via email to