This is my output: >>> emerge (4 of 6) mail-client/sylpheed-claws-1.0.0 to / Traceback (most recent call last): File "/usr/bin/emerge", line 3045, in ? mydepgraph.merge(mydepgraph.altlist()) File "/usr/bin/emerge", line 1838, in merge retval=portage.doebuild(y,"merge",myroot,self.pkgsettings,edebug) File "/usr/lib/portage/pym/portage.py", line 2608, in doebuild if not digestcheck(checkme, mysettings, ("strict" in features)): File "/usr/lib/portage/pym/portage.py", line 2196, in digestcheck mymdigests=digestParseFile(manifestfn) File "/usr/lib/portage/pym/portage.py", line 2124, in digestParseFile raise portage_exception.DigestException, "Conflicting sizes in digest: %(filename)s" % {"filename":myfilename} portage_exception.DigestException: 'Conflicting sizes in digest: /usr/portage/mail-client/sylpheed-claws/Manifest' On further investigating, I've found out that cvs update b0rked my Manifest file (attached). Maybe emerge should do a more strict data correctness checking or something.
Created attachment 49124 [details] Broken Manifest file
I'm not sure how you guys like catching exceptions. If you leave the try: except: block in the function it contains the handler close to the code that raised and you get action right away. If you leave the try: except: blocks to the callers whomever uses the function has to know to put those blocks there, but gets the advantage of possibly recovering the error instead of doing what I just did ( printing an error message ). So I'll submit 2 patches, one handling it in the functoin, and one handling it in the 3 calls I found in portage.py.
Created attachment 49131 [details, diff] Patched in Callers in portage.py This is probably the worse one, there could be other files that call this function, I haven't looked at them all yet. Exception handled in the Called and not the function itself.
Created attachment 49132 [details, diff] Patch for handling the exception in the function itself. Handles the exception in the functoin itself. Kind of stupid because it's thrown in the function as well, but you don't have the hassle of changing every other call in portage.
The final line of the exception is fairly straightforward to understand and that's about the best we can offer at the moment. And no, we can't do more strict data-correctness testing. We *were* doing that and now can't introduce SHA1 sums into the tree because they don't fit into previous portage versions' idea of correct. At the moment, any line beginning with "MD5" is checked for correctness.
Actually, the line doesn't say what's wrong with the manifest - it was b0rked by cvs update, not containing wrong size for some file. Atleast emerge should ignore lines not beginning with MD5 - it shouldn't be hard to not ignore lines starting with SHA1 later.
<<<<<<< Manifest MD5 7b8a169ad5b6a1b0574273eabcd1e3b5 ChangeLog 18177 <snip> MD5 731014f8588d480e362722ce7892c719 ChangeLog 18324 <snip> Would you prefer that it said 'Duplicate entry with conflicting sizes in digest' instead?
Actually, I'd prefer it to say something along the lines of "Metadata file corrupted", but what with GPG signature lines being in there, I guess that would be quite hard to detect. What you suggested would suffice, unless it slows manifest parsing too much.
The only problem with the current code is that it does not give a solution for repairing the Manifest file. Not everyone knows what is going on under the hood here.