From: Greg Sabino Mullane Date: Thu, 11 Jan 2007 16:05:29 +0000 (+0000) Subject: Overhaul postgres update section - standardize version - start 1.10 section. X-Git-Tag: 1.31.0-rc.0~54500 X-Git-Url: http://git.cyclocoop.org//%22%22.str_replace%28%27%22%27%2C?a=commitdiff_plain;h=e7a10986ca1312fbd3d23aea92bbe523ac5e7ed1;p=lhc%2Fweb%2Fwiklou.git Overhaul postgres update section - standardize version - start 1.10 section. --- diff --git a/maintenance/updaters.inc b/maintenance/updaters.inc index 1beffc585e..0468de7b7c 100644 --- a/maintenance/updaters.inc +++ b/maintenance/updaters.inc @@ -1007,21 +1007,31 @@ function do_postgres_updates() { ## Default to the oldest supported version $version = 1.7; + $thisver = array(); if ($wgDatabase->tableExists("mediawiki_version")) { $version = "1.8"; $sql = "SELECT mw_version FROM mediawiki_version ORDER BY cdate DESC LIMIT 1"; $tempversion = pg_fetch_result($wgDatabase->doQuery($sql),0,0); - $thisver = array(); if (preg_match('/(\d+\.\d+)/', $tempversion, $thisver)) { $version = $thisver[1]; } } - print " Detected version: $version "; + print " Detected version: $version\n"; + + ## Transform to a standard format + if (! preg_match('/(\d+)\.(\d+)/', $version, $thisver)) { + die ("Sorry, could not figure out what version \"$version\" means"); + } + $oldversion = $version; + $version = sprintf("%03d%03d",$thisver[1],$thisver[2]); + print " Standardized version: $version\n"; + $upgrade = ''; - if ($version <= 1.7) { - $upgrade = <<query("BEGIN;\n\n $upgrade\n\nCOMMIT;\n"); return;