From: Chad Horohoe Date: Mon, 6 Apr 2009 14:41:33 +0000 (+0000) Subject: (bug 17948) Maintenance scripts now exit(0) or exit(1) as appropriate X-Git-Tag: 1.31.0-rc.0~42210 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22statistiques_visites%22%2C%22%22%29%20.%20%22?a=commitdiff_plain;h=221967100c4eeb3c126acc0000f0e7d2250a38d0;p=lhc%2Fweb%2Fwiklou.git (bug 17948) Maintenance scripts now exit(0) or exit(1) as appropriate --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 1fabf9b790..80d3a474d5 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -327,6 +327,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * The "noautoblock" flag is no longer displayed in the block log when blocking an IP address * (bug 18009) $wgHooks and $wgExtensionFunctions now support closures +* (bug 17948) Maintenance scripts now exit(0) or exit(1) as appropriate == API changes in 1.15 == * (bug 16858) Revamped list=deletedrevs to make listing deleted contributions diff --git a/maintenance/archives/upgradeWatchlist.php b/maintenance/archives/upgradeWatchlist.php index 9788aa56de..ee0167312c 100644 --- a/maintenance/archives/upgradeWatchlist.php +++ b/maintenance/archives/upgradeWatchlist.php @@ -10,7 +10,7 @@ print "This script is obsolete!"; print "It is retained in the source here in case some of its code might be useful for ad-hoc conversion tasks, but it is not maintained and probably won't even work as is."; -exit(); +exit(1); # Convert watchlists to new format diff --git a/maintenance/deleteOrphanedRevisions.php b/maintenance/deleteOrphanedRevisions.php index 78441f8e32..f440cd7d9f 100644 --- a/maintenance/deleteOrphanedRevisions.php +++ b/maintenance/deleteOrphanedRevisions.php @@ -15,8 +15,10 @@ require_once( 'commandLine.inc' ); require_once( 'deleteOrphanedRevisions.inc.php' ); echo( "Delete Orphaned Revisions\n" ); -if( isset( $options['help'] ) ) +if( isset( $options['help'] ) ) { showUsage(); + exit(1); +} $report = isset( $options['report'] ); @@ -39,7 +41,7 @@ echo( "found {$count}.\n" ); # Nothing to do? if( $report || $count == 0 ) { $dbw->immediateCommit(); - exit(); + exit(0); } # Delete each revision diff --git a/maintenance/fuzz-tester.php b/maintenance/fuzz-tester.php index 1ca496aeb2..f401215c86 100644 --- a/maintenance/fuzz-tester.php +++ b/maintenance/fuzz-tester.php @@ -2447,7 +2447,7 @@ function validateHTML($text) { if (curl_error($ch)) { trigger_error("Curl error #: " . curl_errno($ch) . " - " . curl_error ($ch) ); print "Curl error #: " . curl_errno($ch) . " - " . curl_error ($ch) . " - exiting.\n"; - exit(); + exit(1); } curl_close ($ch); diff --git a/maintenance/importImages.php b/maintenance/importImages.php index 7997b0d570..727af3cd8c 100644 --- a/maintenance/importImages.php +++ b/maintenance/importImages.php @@ -184,7 +184,7 @@ if( count( $args ) > 0 ) { showUsage(); } -exit(); +exit(0); function showUsage( $reason = false ) { if( $reason ) { @@ -211,5 +211,5 @@ Options: --unprotect Unprotects all uploaded images END; - exit(); + exit(1); } \ No newline at end of file diff --git a/maintenance/initStats.php b/maintenance/initStats.php index d206c202cb..bb0cf304f5 100644 --- a/maintenance/initStats.php +++ b/maintenance/initStats.php @@ -16,7 +16,7 @@ echo( "Refresh Site Statistics\n\n" ); if( isset( $options['help'] ) ) { showHelp(); - exit(); + exit(1); } require "$IP/maintenance/initStats.inc"; diff --git a/maintenance/language/checkLanguage.inc b/maintenance/language/checkLanguage.inc index 52281b575b..486490e036 100644 --- a/maintenance/language/checkLanguage.inc +++ b/maintenance/language/checkLanguage.inc @@ -24,7 +24,7 @@ class CheckLanguageCLI { public function __construct( Array $options ) { if ( isset( $options['help'] ) ) { echo $this->help(); - exit(); + exit(1); } if ( isset( $options['lang'] ) ) { @@ -459,7 +459,7 @@ class CheckExtensionsCLI extends CheckLanguageCLI { public function __construct( Array $options, $extension ) { if ( isset( $options['help'] ) ) { echo $this->help(); - exit(); + exit(1); } if ( isset( $options['lang'] ) ) { diff --git a/maintenance/language/rebuildLanguage.php b/maintenance/language/rebuildLanguage.php index 91fda3f4bb..bfbda850f4 100644 --- a/maintenance/language/rebuildLanguage.php +++ b/maintenance/language/rebuildLanguage.php @@ -39,7 +39,7 @@ Options: * remove-unknown: Remove unknown messages. END; - exit(); + exit(1); } # Get the language code diff --git a/maintenance/language/transstat.php b/maintenance/language/transstat.php index b433abb40b..fe50c6c50d 100644 --- a/maintenance/language/transstat.php +++ b/maintenance/language/transstat.php @@ -40,7 +40,7 @@ Usage: php transstat.php [--help] [--output=csv|text|wiki] Example: php maintenance/transstat.php --output=text END; - exit(); + exit(1); } diff --git a/maintenance/rebuildall.php b/maintenance/rebuildall.php index ca7e4c066f..536ebd3f34 100644 --- a/maintenance/rebuildall.php +++ b/maintenance/rebuildall.php @@ -37,6 +37,6 @@ print "\n\n** Rebuilding links tables -- this can take a long time. It should be refreshLinks( 1 ); print "Done.\n"; -exit(); +exit(0); diff --git a/maintenance/rebuildrecentchanges.php b/maintenance/rebuildrecentchanges.php index 9311d0fa94..4231ff7f1a 100644 --- a/maintenance/rebuildrecentchanges.php +++ b/maintenance/rebuildrecentchanges.php @@ -19,6 +19,6 @@ $wgDBpassword = $wgDBadminpassword; rebuildRecentChangesTable(); print "Done.\n"; -exit(); +exit(0); diff --git a/maintenance/rebuildtextindex.php b/maintenance/rebuildtextindex.php index 73dca87f9f..b19f78b6e8 100644 --- a/maintenance/rebuildtextindex.php +++ b/maintenance/rebuildtextindex.php @@ -18,7 +18,7 @@ require_once( "rebuildtextindex.inc" ); $database = wfGetDB( DB_MASTER ); if( !$database instanceof DatabaseMysql ) { print "This script is only for MySQL.\n"; - exit(); + exit(1); } $wgTitle = Title::newFromText( "Rebuild text index script" ); @@ -28,6 +28,6 @@ rebuildTextIndex( $database ); createTextIndex( $database ); print "Done.\n"; -exit(); +exit(0); diff --git a/maintenance/removeUnusedAccounts.php b/maintenance/removeUnusedAccounts.php index 419955b06b..5f74b65538 100644 --- a/maintenance/removeUnusedAccounts.php +++ b/maintenance/removeUnusedAccounts.php @@ -16,7 +16,7 @@ $fname = 'removeUnusedAccounts'; if( isset( $options['help'] ) ) { showHelp(); - exit(); + exit(1); } # Do an initial scan for inactive accounts and report the result diff --git a/maintenance/storage/compressOld.php b/maintenance/storage/compressOld.php index 6f8b48eb53..7ff102a557 100644 --- a/maintenance/storage/compressOld.php +++ b/maintenance/storage/compressOld.php @@ -68,6 +68,6 @@ if ( $success ) { print "Done.\n"; } -exit(); +exit(0); diff --git a/maintenance/update.php b/maintenance/update.php index 3f48413783..f3fb6b3454 100644 --- a/maintenance/update.php +++ b/maintenance/update.php @@ -29,7 +29,7 @@ if( !isset( $wgDBadminuser ) || !isset( $wgDBadminpassword ) ) { echo( "No superuser credentials could be found. Please provide the details\n" ); echo( "of a user with appropriate permissions to update the database. See\n" ); echo( "AdminSettings.sample for more details.\n\n" ); - exit(); + exit(1); } # Attempt to connect to the database as a privileged user @@ -40,7 +40,7 @@ if( !$wgDatabase->isOpen() ) { # Appears to have failed echo( "A connection to the database could not be established. Check the\n" ); echo( "values of \$wgDBadminuser and \$wgDBadminpassword.\n" ); - exit(); + exit(1); } print "Going to run database updates for ".wfWikiID()."\n";