summaryrefslogtreecommitdiffstats
path: root/mgagnome
diff options
context:
space:
mode:
authorOlav Vitters <ovitters@mageia.org>2012-03-19 13:11:44 +0000
committerOlav Vitters <ovitters@mageia.org>2012-03-19 13:11:44 +0000
commit817c742dba44d94b96ac248b7a17978fe02cbea8 (patch)
tree47c0824bb7cdd3791a20c6d3afe7f5f8698a5497 /mgagnome
parent03faa2361fd37e8474833af588c4109123f76443 (diff)
downloadmgagnome-817c742dba44d94b96ac248b7a17978fe02cbea8.tar
mgagnome-817c742dba44d94b96ac248b7a17978fe02cbea8.tar.gz
mgagnome-817c742dba44d94b96ac248b7a17978fe02cbea8.tar.bz2
mgagnome-817c742dba44d94b96ac248b7a17978fe02cbea8.tar.xz
mgagnome-817c742dba44d94b96ac248b7a17978fe02cbea8.zip
get error message from last non-empty line
Diffstat (limited to 'mgagnome')
-rwxr-xr-xmgagnome3
1 files changed, 2 insertions, 1 deletions
diff --git a/mgagnome b/mgagnome
index 9cdfae1..944b373 100755
--- a/mgagnome
+++ b/mgagnome
@@ -695,7 +695,7 @@ def cmd_parse_ftp_release_list(options, parser):
if error:
# XXX - ugly
contents.seek(0)
- lastline = contents.read().splitlines()[-1]
+ lastline = contents.read().rstrip().splitlines()[-1]
# Remove things like "ERROR: " and so on from the last line
lastline = re.sub(r'^(?:[^ :]+:\s+)+', '', lastline)
subjecterror = " (ERROR: %s)" % lastline if lastline else " (ERROR)"
@@ -850,4 +850,5 @@ def main():
sys.exit(0)
if __name__ == "__main__":
+ os.environ['PYTHONUNBUFFERED'] = '1'
main()