From: Michael Tremer Date: Fri, 14 Oct 2011 21:10:39 +0000 (+0200) Subject: Allow packages to not have configuration files. X-Git-Tag: 0.9.14~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3e9ef68a8d9f63d888d817b7ff630b52d0a39e35;p=pakfire.git Allow packages to not have configuration files. --- diff --git a/python/pakfire/packages/file.py b/python/pakfire/packages/file.py index a249677d9..a2bd88c04 100644 --- a/python/pakfire/packages/file.py +++ b/python/pakfire/packages/file.py @@ -425,13 +425,17 @@ class FilePackage(Package): # Cache configfiles. configfiles = [] - f = a.extractfile("configs") - for line in f.readlines(): - line = line.rstrip() - if not line.startswith("/"): - line = "/%s" % line - configfiles.append(line) - f.close() + + try: + f = a.extractfile("configs") + for line in f.readlines(): + line = line.rstrip() + if not line.startswith("/"): + line = "/%s" % line + configfiles.append(line) + f.close() + except KeyError: + pass # Package has no configuration files. Never mind. f = a.extractfile("filelist") for line in f.readlines(): @@ -442,6 +446,10 @@ class FilePackage(Package): if self.format >= 1: line = line.rstrip() line = line.split() + + if len(line) <= 6: + continue + name = line[0] if not name.startswith("/"):