Blob Blame Raw
From b4467ce8151d2157fda8f10e488d0c22f009b1fd Mon Sep 17 00:00:00 2001
From: Alec Leamas <leamas.alec@gmail.com>
Date: Tue, 7 Jan 2014 00:56:08 +0100
Subject: [PATCH 1/3] deps: Handle malformed output from rpm (bz #1049042)

---
 src/FedoraReview/deps.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/FedoraReview/deps.py b/src/FedoraReview/deps.py
index 547de5e..5bdc462 100644
--- a/src/FedoraReview/deps.py
+++ b/src/FedoraReview/deps.py
@@ -99,7 +99,11 @@ def list_dirs(pkg_filename):
             line = rpm.stdout.next().strip()
         except StopIteration:
             return dirs
-        path, mode = line.rsplit(None, 10)[0:5:4]
+        try:
+            path, mode = line.rsplit(None, 10)[0:5:4]
+        except ValueError:
+            # E. g., when given '(contains no files)'
+            continue
         mode = int(mode, 8)
         if mode & 040000:
             dirs.append(path)
-- 
1.8.4.2