summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-01-24 09:06:56 +0000
committerZac Medico <zmedico@gentoo.org>2007-01-24 09:06:56 +0000
commitb6cd0701fb017dc15f1e198c5e8a60e6962d840d (patch)
treed9e6e268282b296b5ffee689dde4fa1a2cf72a9e
parentFor bug #142279, detect and warn about null bytes in CONTENTS. (trunk r5762:5... (diff)
downloadportage-b6cd0701fb017dc15f1e198c5e8a60e6962d840d.tar.gz
portage-b6cd0701fb017dc15f1e198c5e8a60e6962d840d.tar.bz2
portage-b6cd0701fb017dc15f1e198c5e8a60e6962d840d.zip
Fix broken line number counting for CONTENTS. (trunk r5764:5765)
svn path=/main/branches/2.1.2/; revision=5770
-rw-r--r--pym/portage.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/pym/portage.py b/pym/portage.py
index f4d31a1ec..8b97cc5b5 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -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