On Mon, Apr 23, 2012 at 12:03:56AM +0200, Axel Beckert wrote:
> Package: git-buildpackage
> Version: 0.6.0~git20120415
> Severity: normal
> 
> Hi,
> 
> while I understand the reasoning in
> http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=637126 that strange
> stuff in upstream tarballs should cause a big warning if it happens
> while preparing a new package to upload, it's very annoying if it
> happens with "git-import-dscs --debsnap" (reduced to the failed
> git-import-dsc call for debugging purposes):
> 
> $ git-import-dsc -v /tmp/tmpCyNukV/source-fping/fping_2.2b1-1.dsc
> gbp:debug: Upstream version: 2.2b1
> gbp:debug: Debian version: 1
> gbp:debug: Upstream tarball: 
> /tmp/tmpCyNukV/source-fping/fping_2.2b1.orig.tar.gz
> gbp:debug: Debian patch: /tmp/tmpCyNukV/source-fping/fping_2.2b1-1.diff.gz
> gbp:debug: ['git', 'rev-parse', '--show-cdup']
> gbp:debug: ['git', 'rev-parse', '--is-bare-repository']
> gbp:debug: ['git', 'symbolic-ref', 'HEAD']
> gbp:debug: ['git', 'show-ref', 'refs/heads/master']
> gbp:debug: ['git', 'status']
> gbp:debug: tar ['-C', '/home/abe/fping/tmpKIsTeX', '-a', '-xf', 
> '/tmp/tmpCyNukV/source-fping/fping_2.2b1.orig.tar.gz'] []
> gbp:debug: ['git', 'tag', '-l', 'debian/2.2b1-1']
> gbp:debug: ['git', 'tag', '-l', 'debian/2.2b1-1']
> gbp:debug: ['git', 'tag', '-l', 'upstream/2.2b1']
> gbp:debug: ['git', 'rev-parse', '--quiet', '--verify', 'upstream/2.2b1^0']
> File fping.c is read-only; refusing to patch
> 3 out of 3 hunks ignored -- saving rejects to file fping.c.rej
> gbp:error: Error import /tmp/tmpCyNukV/source-fping/fping_2.2b1-1.diff.gz: 256
> gbp:debug: rm ['-rf', '/home/abe/fping/tmpKIsTeX'] []
> $
> 
> Reason is that fping.c in the tarball has permissions 444:
> 
> -r--r--r-- 1 abe abe 50692 Jan  8  1997 fping.c
> 
> But interestingly just git-import-dsc fails because it unpacks the
> orig.tar.gz manually with tar while git-import-orig seems to have fixed
> this error in some way for the git repo:

This is weird since your testcase works here. Do you have PATCH_GET or
similar set?  If so the attached patch should fix your problem. If not
we need to find out why patch behaves differently for you.
Cheers,
 -- Guido

> 
> -rw-r--r-- 1 abe abe 50692 Apr 22 23:33 fping.c
> 
> "dpkg-source -x" works fine on the affected .dsc and fixed the issue,
> too:
> 
> $ dpkg-source -x /tmp/tmpCyNukV/source-fping/fping_2.2b1-1.dsc
> gpgv: Signature made Sat 30 Oct 1999 09:40:42 AM CEST using RSA key ID 
> F9033421
> gpgv: Can't check signature: public key not found
> dpkg-source: warning: failed to verify signature on 
> /tmp/tmpCyNukV/source-fping/fping_2.2b1-1.dsc
> dpkg-source: info: extracting fping in fping-2.2b1
> dpkg-source: info: unpacking fping_2.2b1.orig.tar.gz
> dpkg-source: info: applying fping_2.2b1-1.diff.gz
> dpkg-source: info: upstream files that have been modified:
>  fping-2.2b1/fping.c
> $  ls -l fping-2.2b1/fping.c
> -rw-r--r-- 1 abe abe 50761 Apr 22 23:46 fping-2.2b1/fping.c
> $
> 
> So while I understand the reasoning for the wontfix in #637126, I think
> we have a) some inconsistency between git-import-dsc and
> git-import-orig/dpkg-source here and b) that git-import-dscs --debsnap
> really should accept most strange but doable things it finds in the
> snapshot archive.
> 
> -- System Information:
> Debian Release: wheezy/sid
>   APT prefers unstable
>   APT policy: (990, 'unstable'), (900, 'testing'), (600, 'stable'), (200, 
> 'experimental')
> Architecture: i386 (i686)
> 
> Kernel: Linux 3.3.0-trunk-686-pae (SMP w/1 CPU core)
> Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
> Shell: /bin/sh linked to /bin/dash
> 
> Versions of packages git-buildpackage depends on:
> ii  devscripts       2.11.6
> ii  git              1:1.7.10-1
> ii  python           2.7.2-10
> ii  python-dateutil  1.5-1
> ii  python2.7        2.7.3~rc2-2
> 
> Versions of packages git-buildpackage recommends:
> ii  cowbuilder    <none>
> ii  pristine-tar  1.24
> 
> Versions of packages git-buildpackage suggests:
> ii  python-notify  0.1.1-3
> ii  unzip          6.0-6
> 
> -- no debconf information
> 
> 
>From 7300f6360cde87324d39a9d2bbbd5008a68ed097 Mon Sep 17 00:00:00 2001
Message-Id: <7300f6360cde87324d39a9d2bbbd5008a68ed097.1335556022.git....@sigxcpu.org>
From: =?UTF-8?q?Guido=20G=C3=BCnther?= <a...@sigxcpu.org>
Date: Fri, 27 Apr 2012 21:46:40 +0200
Subject: [PATCH] import_dsc: apply patch with the same options as
 "dpkg-source -x"

---
 gbp/scripts/import_dsc.py |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/gbp/scripts/import_dsc.py b/gbp/scripts/import_dsc.py
index 186143f..7c43971 100644
--- a/gbp/scripts/import_dsc.py
+++ b/gbp/scripts/import_dsc.py
@@ -62,9 +62,14 @@ def download_source(pkg, dirs):
 
 def apply_patch(diff):
     "Apply patch to a source tree"
+    patch_opts = ['-N', '-p1', '-F0', '-u', '-t',
+                  '-Vnever', '-g0', '-b', '-z',
+                  '--quiet']
+
     pipe = pipes.Template()
     pipe.prepend('gunzip -c %s' % diff,  '.-')
-    pipe.append('patch -p1 --quiet', '-.')
+    pipe.append('patch %s' % ' '.join(patch_opts), '-.')
+
     try:
         ret = pipe.copy('', '')
         if ret:
-- 
1.7.10

Reply via email to