summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-01-23 23:49:59 +0000
committerZac Medico <zmedico@gentoo.org>2007-01-23 23:49:59 +0000
commit177dd2e75bb565ba1794bebb74a25ed527d9b4a4 (patch)
tree36d54d45cf3883a7858472d237bfe03749da7a5d
parentFor bug #142279, detect and warn about null bytes in CONTENTS. (diff)
downloadportage-multirepo-177dd2e75bb565ba1794bebb74a25ed527d9b4a4.tar.gz
portage-multirepo-177dd2e75bb565ba1794bebb74a25ed527d9b4a4.tar.bz2
portage-multirepo-177dd2e75bb565ba1794bebb74a25ed527d9b4a4.zip
Fix broken line number counting for CONTENTS.v2.1.2-r3
svn path=/main/trunk/; revision=5765
-rw-r--r--pym/portage.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/pym/portage.py b/pym/portage.py
index eb44be8a..98303857 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -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