From 3e9ef68a8d9f63d888d817b7ff630b52d0a39e35 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Fri, 14 Oct 2011 23:10:39 +0200 Subject: [PATCH] Allow packages to not have configuration files. --- python/pakfire/packages/file.py | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) 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("/"): -- 2.39.5