r58033 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r58032‎ | r58033 | r58034 >
Date:18:47, 22 October 2009
Author:maxsem
Status:reverted (Comments)
Tags:
Comment:
Set a nonzero exit status in case of maintenance script failure
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/maintenance/Maintenance.php (modified) (history)
  • /trunk/phase3/maintenance/doMaintenance.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/doMaintenance.php
@@ -86,10 +86,13 @@
8787
8888 // Do the work
8989 try {
90 - $maintenance->execute();
 90+ $result = $maintenance->execute();
9191 } catch( MWException $mwe ) {
9292 echo( $mwe->getText() );
 93+ $result = 1;
9394 }
9495
9596 // Potentially debug globals
9697 $maintenance->globals();
 98+
 99+exit( intval( $result ) );
Index: trunk/phase3/maintenance/Maintenance.php
@@ -232,7 +232,7 @@
233233 fwrite( $f, $err . "\n" );
234234 fclose( $f );
235235 }
236 - if( $die ) die();
 236+ if( $die ) exit( 1 );
237237 }
238238
239239 /**
Index: trunk/phase3/RELEASE-NOTES
@@ -258,6 +258,7 @@
259259 the parser so extensions are free to implement their own <math> tag
260260 * (bug 21047) Wrap 'cannotdelete' into a div with the generic 'error' class and
261261 an own 'mw-error-cannotdelete' class
 262+* Maintenance scripts now set nonzero exit codes when terminating due to error
262263
263264 === Bug fixes in 1.16 ===
264265

Follow-up revisions

RevisionCommit summaryAuthorDate
r58037Revert r58033. This change made all command line scripts of the Translate ext...siebrand21:43, 22 October 2009

Comments

#Comment by Siebrand (talk | contribs)   21:40, 22 October 2009

This change made all command line scripts of the Translate extension (scripts/ subfolder) exit without any information or without doing anything. Reverting.

Status & tagging log