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

Check the version number in the committed version.php, not the filesystem

Bug 1215662

Change-Id: Id9b7dbe0b14366cf5b467d83b378131b97d4ec9a
parent 78b2638d
......@@ -24,17 +24,20 @@ error_reporting(0);
define('INTERNAL', 1);
require('htdocs/lib/version.php');
$newconfig = clone $config;
$newconfig = get_mahara_version('HEAD');
$oldconfig = get_mahara_version('HEAD~');
exec('git show HEAD~:htdocs/lib/version.php', $lines, $returnval);
if ($returnval !== 0) {
echo "ERROR (test/versioncheck.php): Couldn't locate previous commit's version.php file.";
exit(1);
}
function get_mahara_version($gitversion) {
exec("git show {$gitversion}:htdocs/lib/version.php", $lines, $returnval);
if ($returnval !== 0) {
echo "ERROR (test/versioncheck.php): Couldn't locate version.php file in {$gitversion}.";
exit(1);
}
array_shift($lines);
eval(implode("\n", $lines));
$oldconfig = $config;
array_shift($lines);
eval(implode("\n", $lines));
return $config;
}
if ($oldconfig->version != $newconfig->version) {
echo "Bumping lib/version.php...\n";
......
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