From: Max Semenik Date: Thu, 22 Oct 2009 18:47:27 +0000 (+0000) Subject: Set a nonzero exit status in case of maintenance script failure X-Git-Tag: 1.31.0-rc.0~39169 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=5a7a3a885efebe5470b458ebac19628fc061463f;p=lhc%2Fweb%2Fwiklou.git Set a nonzero exit status in case of maintenance script failure --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index ddd75fcb32..900520169c 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -258,6 +258,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN the parser so extensions are free to implement their own tag * (bug 21047) Wrap 'cannotdelete' into a div with the generic 'error' class and an own 'mw-error-cannotdelete' class +* Maintenance scripts now set nonzero exit codes when terminating due to error === Bug fixes in 1.16 === diff --git a/maintenance/Maintenance.php b/maintenance/Maintenance.php index bcd2913a20..8055af460b 100644 --- a/maintenance/Maintenance.php +++ b/maintenance/Maintenance.php @@ -232,7 +232,7 @@ abstract class Maintenance { fwrite( $f, $err . "\n" ); fclose( $f ); } - if( $die ) die(); + if( $die ) exit( 1 ); } /** diff --git a/maintenance/doMaintenance.php b/maintenance/doMaintenance.php index cb6faf3070..77286c3b33 100644 --- a/maintenance/doMaintenance.php +++ b/maintenance/doMaintenance.php @@ -86,10 +86,13 @@ $wgTitle = null; // Do the work try { - $maintenance->execute(); + $result = $maintenance->execute(); } catch( MWException $mwe ) { echo( $mwe->getText() ); + $result = 1; } // Potentially debug globals $maintenance->globals(); + +exit( intval( $result ) );