The tee construction in the spawn method (GLIUtility.py) will always return 0. <command> | tee <filename> => will always return 0 even if command fails, if the filename not exists it will return not 0 but <command> | tee <filename> | tee /dev/tty8 => will also always return 0 even if the filename not exists, will ofcourse return not 0 if tty is not writeable ... I noticed this when a mount of a partition failed (still have to trace that down). The attached patch solves this problem and has the identical behaviour as the current implementation. Although it will be a bit slower. I tested this several times against installer-20050620 snapshot. Feel free to do with it what you want. :) Reproducible: Always Steps to Reproduce: 1. 2. 3.
Created attachment 61595 [details, diff] patch against GLIUtility.py.diff patch against GLIUtility.py.diff
That is definitely a valid bug, but there's a much simpler solution: cmd += "; exit $PIPESTATUS[0]" before cmd is executed. That *should* return the exit code of the first process in a series of pipes, and it's always for the last command run.
After some discussion, it was decided your patch would work under more circumstances. A modifed version (dropped the bit shifting stuff...that's what exitsuccess() is for, commented out flush() calls for speed) has been applied.
New code appears to be working...closing
Moving to Release Media/Installer.