summaryrefslogtreecommitdiff
path: root/apt/package.py
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2013-03-13 23:36:13 +0100
committerJulian Andres Klode <jak@debian.org>2013-03-13 23:36:13 +0100
commit20e23c16e3bad44f5e15f8dde58a13da4f3afc29 (patch)
tree2f4bee1671127f8fb6b14e9b077c063c45424a0a /apt/package.py
parent93ffde462b8cde95be2339036739a1f10bd97cf4 (diff)
downloadpython-apt-20e23c16e3bad44f5e15f8dde58a13da4f3afc29.tar.gz
apt/package.py: Try both filenames for package file lists
(Closes: #700715)
Diffstat (limited to 'apt/package.py')
-rw-r--r--apt/package.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/apt/package.py b/apt/package.py
index 29eec909..7de35687 100644
--- a/apt/package.py
+++ b/apt/package.py
@@ -1045,12 +1045,17 @@ class Package(object):
Return a list of unicode names of the files which have
been installed by this package
"""
- path = "/var/lib/dpkg/info/%s.list" % self.name
- try:
- with open(path, "rb") as file_list:
- return file_list.read().decode("utf-8").split(u"\n")
- except EnvironmentError:
- return []
+ for name in self.shortname, self.fullname:
+ path = "/var/lib/dpkg/info/%s.list" % name
+ try:
+ with open(path, "rb") as file_list:
+ return file_list.read().decode("utf-8").split(u"\n")
+ except OSError as error:
+ continue
+ except EnvironmentError:
+ return []
+
+ raise error
def get_changelog(self, uri=None, cancel_lock=None):
"""