[kernel] r18142 - in dists/sid/linux-2.6: . debian/lib/python/debian_linux

Ben Hutchings benh at alioth.debian.org
Sun Oct 2 22:50:54 UTC 2011


Author: benh
Date: Sun Oct  2 22:50:53 2011
New Revision: 18142

Log:
Fix debian_linux.utils.read_control to tolerate extra blank lines

Cherry-picked from trunk r18042.

Modified:
   dists/sid/linux-2.6/   (props changed)
   dists/sid/linux-2.6/debian/lib/python/debian_linux/utils.py

Modified: dists/sid/linux-2.6/debian/lib/python/debian_linux/utils.py
==============================================================================
--- dists/sid/linux-2.6/debian/lib/python/debian_linux/utils.py	Sun Oct  2 22:50:17 2011	(r18141)
+++ dists/sid/linux-2.6/debian/lib/python/debian_linux/utils.py	Sun Oct  2 22:50:53 2011	(r18142)
@@ -71,14 +71,16 @@
     from .debian import Package
 
     entries = []
+    eof = False
 
-    while True:
+    while not eof:
         e = Package()
         last = None
         lines = []
         while True:
             line = f.readline()
             if not line:
+                eof = True
                 break
             line = line.strip('\n')
             if not line:
@@ -97,10 +99,8 @@
             lines = [line[i+1:].lstrip()]
         if last:
             e[last] = '\n'.join(lines)
-        if not e:
-            break
-
-        entries.append(e)
+        if e:
+            entries.append(e)
 
     return entries
 



More information about the Kernel-svn-changes mailing list