From 20e23c16e3bad44f5e15f8dde58a13da4f3afc29 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Wed, 13 Mar 2013 23:36:13 +0100 Subject: apt/package.py: Try both filenames for package file lists (Closes: #700715) --- apt/package.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'apt') 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): """ -- cgit v1.2.3