Fix broken line number counting for CONTENTS. v2.1.2-r3
authorZac Medico <zmedico@gentoo.org>
Tue, 23 Jan 2007 23:49:59 +0000 (23:49 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 23 Jan 2007 23:49:59 +0000 (23:49 -0000)
svn path=/main/trunk/; revision=5765

pym/portage.py

index eb44be8aada3b35c09d6c107064c9ee8d88fdfe5..98303857b5ac1ed47645234b68df4df86b249798 100644 (file)
@@ -6801,8 +6801,9 @@ class dblink:
                myc.close()
                null_byte = "\0"
                contents_file = os.path.join(self.dbdir, "CONTENTS")
-               pos=1
+               pos = 0
                for line in mylines:
+                       pos += 1
                        if null_byte in line:
                                # Null bytes are a common indication of corruption.
                                writemsg("!!! Null byte found in contents " + \
@@ -6847,7 +6848,6 @@ class dblink:
                                        return None
                        except (KeyError,IndexError):
                                print "portage: CONTENTS line",pos,"corrupt!"
-                       pos += 1
                self.contentscache=pkgfiles
                return pkgfiles