I would like to propose proper mechanism for error handling in portage. It is very natural to use exceptions instead of print "I am doing harakiri now ;)" sys.exit(1) as done now. This will resolve situations when certain problematic situation catched deep inside some method has to be dealt with differently based on where it was called (like emerge system vs world...). Case in hand: bug #1841. I created module portage_exceptions.py to introduce such functionality. It contains basic PortageError class with virtual methods handle and report. and GenericPortageError, which imitates p[resent portage behavior: handle will output error message and halt, while report will only output message. In order to gracefully report a problem instead of printing a traceback, the module defines and hooks generic exception handler (which just calls handle of corresponding exception). Thus the default behaviour in case of a problem imitates the one at present (which is hardwired now). The advantage is that with exceptions it is possible to override it whenever necessary. It is very easy to modify exicting sources to make use of this mechanism: just replace occurencies of print ErrorMessage sys.exit(1) with raise GenericPortageError(ErrorMessage) and that's it! (don't forget to import portage_exceptions of course). In case you need somewhat different error reporting functionality, derive new exception from either basic or generic one and override appropriate method (most likely that will be "handle"). Please see sources for more details. George
Created attachment 756 [details] portage exceptions module
Created attachment 814 [details, diff] a fix to emerge to comment out "broken" world entries this is a complimentary fix from 1841, adding here per Daniel's request since it #1841 was closed. This patch will scan world entries before checking dependencies when doing emerge --update world and comment out problematic entries. Uses introduced exception mechanism. should apply against emerge-1.90
*** Bug 2410 has been marked as a duplicate of this bug. ***
i don't think this will still apply, if this is still an issue open a new bug