Package: git-buildpackage
Version: 0.5.25
Severity: wishlist
Tags: patch

git-import-orig fails when uscan fetches a zip file. Rather,
git-import-orig should check if uscan downloaded a .tar.gz or a
.tar.bz2, and print a nice error message if that is not the case.
Currently:

ryan@epsilon:~/work/packaging/cronometer$ git-import-orig --uscan
gbp:info: Launching uscan...
Traceback (most recent call last):
  File "/usr/bin/git-import-orig", line 433, in <module>
    sys.exit(main(sys.argv))
  File "/usr/bin/git-import-orig", line 264, in main
    status, tarball = do_uscan()
  File "/usr/lib/pymodules/python2.6/gbp/deb.py", line 349, in do_uscan
    tarball = "../%s" % re.match(".*symlinked ([^\s]*) to it.*", row).group(1)
AttributeError: 'NoneType' object has no attribute 'group'
ryan@epsilon:~/work/packaging/cronometer$ uscan --verbose
-- Scanning for watchfiles in .
-- Found watchfile in ./debian
-- In debian/watch, processing watchfile line:
   http://sf.net/cronometer/CRONoMeter-([^-]+)\-?.*\.zip
-- Found the following matching hrefs:
     CRONoMeter-0.9.8-MacOSX.zip
     CRONoMeter-0.9.7-MacOSX.zip
     CRONoMeter-0.9.6.zip
     CRONoMeter-0.9.5.zip
     CRONoMeter-0.8.0.zip
Newest version on remote site is 0.9.8, local version is 0.9.7
 => CRONoMeter-0.9.8-MacOSX.zip already in package directory
-- Scan finished
ryan@epsilon:~/work/packaging/cronometer$ cat debian/watch
version=3
http://sf.net/cronometer/CRONoMeter-([^-]+)\-?.*\.zip

After patch:
gbp:info: Launching uscan...
gbp:error: Archive CRONoMeter-0.9.8-MacOSX.zip is not a gz or bz2 compressed 
tarball

Kind regards,
Ryan

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.39-1-686-pae (SMP w/4 CPU cores)
Locale: LANG=es_ES.UTF-8, LC_CTYPE=es_ES.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to es_ES.UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages git-buildpackage depends on:
ii  devscripts                   2.11.0      scripts to make the life of a Debi
ii  git [git-core]               1:1.7.5.3-1 fast, scalable, distributed revisi
ii  git-core                     1:1.7.5.3-1 fast, scalable, distributed revisi
ii  python                       2.6.6-14    interactive high-level object-orie
ii  python-dateutil              1.4.1-3     powerful extensions to the standar
ii  python-support               1.0.13      automated rebuilding support for P

Versions of packages git-buildpackage recommends:
ii  cowbuilder                    0.62+nmu2  pbuilder running on cowdancer
ii  pristine-tar                  1.13       regenerate pristine tarballs

Versions of packages git-buildpackage suggests:
pn  git-load-dirs                 <none>     (no description available)
ii  python-notify                 0.1.1-2+b3 Python bindings for libnotify

-- no debconf information

-- 
|_)|_/  Ryan Kavanagh             |  GnuPG key
| \| \  http://ryanak.ca/         |  4A11C97A (Transitioning from E95EDDC9)   
        ()  ascii ribbon campaign - against html e-mail 
        /\  www.asciiribbon.org   - against proprietary attachments
From 756feb5f378dc8d32921afda821753889d6553d8 Mon Sep 17 00:00:00 2001
From: Ryan Kavanagh <ryana...@kubuntu.org>
Date: Tue, 7 Jun 2011 11:00:06 -0400
Subject: [PATCH] Handle non gz/bz2 files from uscan

---
 gbp/deb.py |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/gbp/deb.py b/gbp/deb.py
index 930e626..5a39155 100644
--- a/gbp/deb.py
+++ b/gbp/deb.py
@@ -358,6 +358,11 @@ def do_uscan():
                     else:
                         continue
             d["ext"] = os.path.splitext(d['upstream-url'])[1]
+            if not get_compression(d["ext"]):
+                tarball = os.path.split(d['upstream-url'])[1]
+                raise GbpError, "Archive %s is not a gz or bz2 compressed tarball" % tarball
+            else:
+                tarball = "../%(package)s_%(upstream-version)s.orig.tar%(ext)s" % d
             tarball = "../%(package)s_%(upstream-version)s.orig.tar%(ext)s" % d
 
             if not os.path.exists(tarball):
-- 
1.7.5.3

Attachment: signature.asc
Description: Digital signature

Reply via email to