Package: python-stdeb
Version: 0.5.1-2~ti
Severity: minor
Tags: upstream patch

If pypi-install is ran on a system without deb-src lines on sources.list,
it dies with the following (see #568122 for a complete traceback):

E: You must put some 'source' URIs in your sources.list
ERROR running: apt-cache showsrc <package>

Attached is a patch which makes pypi-install ignore this particular
error from 'apt-cache showsrc'.

Best,

Teemu


-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.32-trunk-amd64 (SMP w/4 CPU cores)
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 python-stdeb depends on:
ii  python                        2.5.4-9    An interactive high-level object-o
ii  python-setuptools             0.6.10-4   Python Distutils Enhancements (set
ii  python-support                1.0.8      automated rebuilding support for P

Versions of packages python-stdeb recommends:
ii  apt-file                      2.3.3      search for files within Debian pac
ii  dpkg-dev                      1.15.7.1   Debian package development tools

python-stdeb suggests no packages.

-- no debconf information
From 3f38fc968b773ea935959f2c2e3ad8fc3b546db9 Mon Sep 17 00:00:00 2001
From: Teemu Ikonen <[email protected]>
Date: Wed, 5 May 2010 16:57:54 +0200
Subject: [PATCH] Do not die if sources.list does not contain deb-src lines.

---
 stdeb/util.py |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/stdeb/util.py b/stdeb/util.py
index 916f9c5..9ab9071 100644
--- a/stdeb/util.py
+++ b/stdeb/util.py
@@ -522,11 +522,14 @@ def apt_cache_info(apt_cache_cmd,package_name):
     args = ["apt-cache", apt_cache_cmd, package_name]
     cmd = subprocess.Popen(args,
                            stdin=subprocess.PIPE,
+                           stderr=subprocess.PIPE,
                            stdout=subprocess.PIPE)
     returncode = cmd.wait()
     if returncode:
-        log.error('ERROR running: %s', ' '.join(args))
-        raise RuntimeError('returncode %d from subprocess %s' % (returncode,
+        errline = cmd.stderr.read()
+        if not (returncode == 100 and errline == "E: You must put some 'source' URIs in your sources.list\n"):
+            log.error('ERROR running: %s', ' '.join(args))
+            raise RuntimeError('returncode %d from subprocess %s' % (returncode,
                                                                  args))
     inlines = cmd.stdout.read()
     version_blocks = inlines.split('\n\n')
-- 
1.7.0

Reply via email to