r92831 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92830‎ | r92831 | r92832 >
Date:00:05, 22 July 2011
Author:aaron
Status:ok (Comments)
Tags:
Comment:
* Added cdbmake file back and cleaned up some .cdb file generation confusion
* Merged some CommonSettings changes
Modified paths:
  • /trunk/tools/mwmultiversion/multiversion/populateWikiversionCDB.php (modified) (history)
  • /trunk/tools/mwmultiversion/scripts/cdbmake-12.sh (added) (history)
  • /trunk/tools/mwmultiversion/scripts/wikiversions.dat.sample (added) (history)
  • /trunk/tools/mwmultiversion/scripts/wikiversions.list.sample (deleted) (history)
  • /trunk/tools/mwmultiversion/wmf-config/CommonSettings.php (modified) (history)

Diff [purge]

Index: trunk/tools/mwmultiversion/multiversion/populateWikiversionCDB.php
@@ -16,6 +16,7 @@
1717 */
1818 function populateWikiversionsCDB() {
1919 global $argv;
 20+ $common = '/home/wikipedia/common';
2021
2122 $argsValid = false;
2223 if ( count( $argv ) >= 2 ) {
@@ -29,7 +30,7 @@
3031 die( "Usage: populateWikiVersionsCDB.php php-X.XX\n" );
3132 }
3233
33 - $path = '/home/wikipedia/common/all.dblist';
 34+ $path = "$common/all.dblist";
3435 $dbList = explode( "\n", file_get_contents( $path ) );
3536 $dbList = array_filter( $dbList ); // remove whitespace entry
3637 if ( !count( $dbList ) ) {
@@ -41,8 +42,18 @@
4243 $wikiVersionList .= "$dbName $version\n";
4344 }
4445
45 - $path = '/home/wikipedia/common/wikiversions.cdb';
 46+ $path = "$common/wikiversions.dat";
4647 if ( !file_put_contents( $path, $wikiVersionList ) ) {
 48+ die( "Unable to write to wikiversions.dat.\n" );
 49+ }
 50+
 51+ $ret = 1; // failed by default?
 52+ passthru( sprintf(
 53+ "$common/multiversion/cdbmake-12.sh %s %s < $common/wikiversions.dat",
 54+ "$common/wikiversions.cdb",
 55+ "$common/wikiversions.dat.tmp"
 56+ ) );
 57+ if ( $ret != 0 ) {
4758 die( "Unable to write to wikiversions.cdb.\n" );
4859 }
4960 }
Index: trunk/tools/mwmultiversion/scripts/wikiversions.list.sample
@@ -1,3 +0,0 @@
2 -trunkwiki php-trunk
3 -enwiki php-1.17
4 -testwiki php-1.18
Index: trunk/tools/mwmultiversion/scripts/cdbmake-12.sh
@@ -0,0 +1,14 @@
 2+#!/bin/sh
 3+# This File is from the following cdb package
 4+# http://cr.yp.to/cdb.html
 5+# Version: cdb-0.75 (2000.02.19, "beta")
 6+# Usage: cdbmake-12.sh wikiversions.cdb wikiversions.tmp < wikiversions.dat
 7+# See: wikiversions.dat.sample
 8+awk '
 9+ /^[^#]/ {
 10+ print "+" length($1) "," length($2) ":" $1 "->" $2
 11+ }
 12+ END {
 13+ print ""
 14+ }
 15+' | cdbmake "$@"
Property changes on: trunk/tools/mwmultiversion/scripts/cdbmake-12.sh
___________________________________________________________________
Added: svn:eol-style
116 + native
Added: svn:executable
217 + *
Index: trunk/tools/mwmultiversion/scripts/wikiversions.dat.sample
@@ -0,0 +1,3 @@
 2+trunkwiki php-trunk
 3+enwiki php-1.17
 4+testwiki php-1.18
Property changes on: trunk/tools/mwmultiversion/scripts/wikiversions.dat.sample
___________________________________________________________________
Added: svn:eol-style
15 + native
Index: trunk/tools/mwmultiversion/wmf-config/CommonSettings.php
@@ -1188,7 +1188,7 @@
11891189
11901190 // Newer entries
11911191 if( $wgDBname == 'zhwiki' ) $wgCacheEpoch = '20060528093500'; # parser bug?
1192 -if( $wgDBname == 'lawikibooks' ) $wgCacheEpoch = '20060610090000'; # sidebar bug
 1192+if( $wgDBname == 'lawikibooks' ) $wgCacheEpoch = '20060610090000'; # sidebar bug
11931193 if ( $wmgHTTPSExperiment ) $wgCacheEpoch = '20110718202400';
11941194
11951195 #$wgThumbnailEpoch = '20060227114700'; # various rsvg and imagemagick fixes
@@ -2096,8 +2096,8 @@
20972097
20982098 $wgArticleFeedbackTracking = array(
20992099 'buckets' => array(
2100 - 'track' => 0.386,
2101 - 'ignore' => 99.614,
 2100+ 'track' => 0.318,
 2101+ 'ignore' => 99.682,
21022102 //'track'=>0, 'ignore' => 100
21032103 ),
21042104 'version' => 8,

Comments

#Comment by Catrope (talk | contribs)   18:43, 25 July 2011
+	passthru( sprintf(
+		"$common/multiversion/cdbmake-12.sh %s %s < $common/wikiversions.dat",
+		"$common/wikiversions.cdb",
+		"$common/wikiversions.dat.tmp"
+	) );

The use of sprintf here comes across as unnecessarily funky to me (the arguments are constants). OK otherwise.

#Comment by Aaron Schulz (talk | contribs)   18:43, 25 July 2011

This stuff was killed anyway ;)

Status & tagging log