Commit bec598d9 authored by Aaron Wells's avatar Aaron Wells
Browse files

Make sure new upgrade.php sections match with version.php

Bug 1215662

Change-Id: I6887957d91090ca3453b774ad62da4896ff215be
parent d384c7b1
......@@ -66,4 +66,22 @@ if (strlen($newconfig->version) != 10) {
if ($stablebranch && substr($newconfig->version, 0, 8) != substr($oldconfig->version, 0, 8)) {
echo "(test/versioncheck.php) ERROR: Version number in lib/version.php has gone up too much for a stable branch!\n";
exit(3);
}
// If they added new code to lib/db/upgrade.php, make sure the last block in it matches the new version number
if ($newconfig->version > $oldconfig->version) {
$p = popen('git show -- htdocs/lib/db/upgrade.php', 'r');
$upgradeversion = false;
while (!feof($p)) {
$buffer = fgets($p);
if (1 == preg_match('#\$oldversion.*\b(\d{10})\b#', $buffer, $matches)) {
$upgradeversion = $matches[1];
echo "New lib/db/upgrade.php: {$upgradeversion}\n";
}
}
pclose($p);
if ($upgradeversion != $newconfig->version) {
echo "(test/versioncheck.php) ERROR: Version in lib/version.php should match version of last new section in lib/db/upgrade.php\n";
die(5);
}
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment