Fix broken line number counting for CONTENTS. (trunk r5764:5765)
authorZac Medico <zmedico@gentoo.org>
Wed, 24 Jan 2007 09:06:56 +0000 (09:06 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 24 Jan 2007 09:06:56 +0000 (09:06 -0000)
svn path=/main/branches/2.1.2/; revision=5770

pym/portage.py

index f4d31a1ec91c2cde51e6cb2517c1612b8dab5142..8b97cc5b508bd83d0eb249f12610356f27a32680 100644 (file)
@@ -6736,8 +6736,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 " + \
@@ -6782,7 +6783,6 @@ class dblink:
                                        return None
                        except (KeyError,IndexError):
                                print "portage: CONTENTS line",pos,"corrupt!"
-                       pos += 1
                self.contentscache=pkgfiles
                return pkgfiles