summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2011-12-19 13:53:51 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2011-12-19 13:53:51 +0100
commit44163ca57ac3f6311e05b1521ac03f120e67d520 (patch)
treedf1d06f27b47e2855c7dbd07182f7008a88fda18
parentd02c0c3a2ded6afcc25f69c8de4b6cc396854027 (diff)
parent375920c5172a5f60acba02b73c3b32ffbccc8ab2 (diff)
downloadpython-apt-44163ca57ac3f6311e05b1521ac03f120e67d520.tar.gz
merged from lp:~mvo/python-apt/mvo
-rw-r--r--apt/debfile.py15
-rw-r--r--apt/progress/gtk2.py3
-rw-r--r--aptsources/distinfo.py6
-rw-r--r--aptsources/distro.py4
-rw-r--r--aptsources/sourceslist.py3
-rw-r--r--debian/changelog2
6 files changed, 9 insertions, 24 deletions
diff --git a/apt/debfile.py b/apt/debfile.py
index 160a4a72..ab24c50b 100644
--- a/apt/debfile.py
+++ b/apt/debfile.py
@@ -94,7 +94,8 @@ class DebPackage(object):
return pkgname
elif self._cache.is_virtual_package(pkgname):
return pkgname
- elif self._cache[pkgname].candidate.architecture == "all":
+ elif (pkgname in self._cache and
+ self._cache[pkgname].candidate.architecture == "all"):
return pkgname
# now do the real multiarch checking
multiarch_pkgname = "%s:%s" % (pkgname, self._multiarch)
@@ -159,10 +160,6 @@ class DebPackage(object):
def _satisfy_or_group(self, or_group):
"""Try to satisfy the or_group."""
-
- or_found = False
- virtual_pkg = None
-
for dep in or_group:
depname, ver, oper = dep
@@ -232,10 +229,6 @@ class DebPackage(object):
def _check_conflicts_or_group(self, or_group):
"""Check the or-group for conflicts with installed pkgs."""
self._dbg(2, "_check_conflicts_or_group(): %s " % (or_group))
-
- or_found = False
- virtual_pkg = None
-
for dep in or_group:
depname = dep[0]
ver = dep[1]
@@ -513,7 +506,7 @@ class DebPackage(object):
for pkg in self._need_pkgs:
try:
self._cache[pkg].mark_install(from_user=False)
- except SystemError as e:
+ except SystemError:
self._failure_string = _("Cannot install '%s'") % pkg
self._cache.clear()
return False
@@ -606,7 +599,7 @@ class DebPackage(object):
# auto-convert to hex
try:
data = unicode(data, "utf-8")
- except Exception as e:
+ except Exception:
new_data = _("Automatically converted to printable ascii:\n")
new_data += self.to_strish(data)
return new_data
diff --git a/apt/progress/gtk2.py b/apt/progress/gtk2.py
index b5794e92..c2635ca0 100644
--- a/apt/progress/gtk2.py
+++ b/apt/progress/gtk2.py
@@ -22,9 +22,6 @@
# USA
"""GObject-powered progress classes and a GTK+ status widget."""
-import os
-import time
-
import pygtk
pygtk.require('2.0')
import gtk
diff --git a/aptsources/distinfo.py b/aptsources/distinfo.py
index c8ec5c46..ec162c2d 100644
--- a/aptsources/distinfo.py
+++ b/aptsources/distinfo.py
@@ -24,17 +24,13 @@
import errno
import logging
import os
-import gettext
from os import getenv
from subprocess import Popen, PIPE
import re
import apt_pkg
-
-def _(s):
- return gettext.dgettext("python-apt", s)
-
+from apt_pkg import gettext as _
class Template(object):
diff --git a/aptsources/distro.py b/aptsources/distro.py
index f777a4ea..b4056b27 100644
--- a/aptsources/distro.py
+++ b/aptsources/distro.py
@@ -30,9 +30,7 @@ import sys
from xml.etree.ElementTree import ElementTree
import gettext
-
-def _(s):
- return gettext.dgettext("python-apt", s)
+from apt_pkg import gettext as _
class NoDistroTemplateException(Exception):
diff --git a/aptsources/sourceslist.py b/aptsources/sourceslist.py
index 40a0379b..e3b8c9be 100644
--- a/aptsources/sourceslist.py
+++ b/aptsources/sourceslist.py
@@ -23,7 +23,6 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
# USA
-import gettext
import glob
import logging
import os.path
@@ -35,6 +34,7 @@ import time
import apt_pkg
from distinfo import DistInfo
from apt.deprecation import function_deprecated_by
+from apt_pkg import gettext as _
# some global helpers
@@ -446,7 +446,6 @@ class SourceEntryMatcher(object):
def match(self, source):
"""Add a matching template to the source"""
- _ = gettext.gettext
found = False
for template in self.templates:
if (re.search(template.match_uri, source.uri) and
diff --git a/debian/changelog b/debian/changelog
index 0412f696..908843e7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,8 @@ python-apt (0.8.3.1) UNRELEASED; urgency=low
* tests/test_apt_cache.py:
- fix tests on kfreebsd/ia64
+ * apt/debfile.py:
+ - fix crash in dep multiarch handling
-- Michael Vogt <michael.vogt@ubuntu.com> Fri, 09 Dec 2011 09:23:16 +0100