Commit 3e806118 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Merge "Adjusting the minaccept for deleted version file"

parents c1731283 8156cb44
...@@ -169,13 +169,17 @@ function validate_version($versionfile, $upgradefile) { ...@@ -169,13 +169,17 @@ function validate_version($versionfile, $upgradefile) {
} }
echo "New version: {$newconfig->version}\n"; echo "New version: {$newconfig->version}\n";
} }
# Check if version file has been deleted
if ($newconfig->version < $oldconfig->version) { $isdeleted = `git diff HEAD~1 -- {$versionfile} | grep 'deleted file mode'`;
if ($isdeleted) {
echo "WARNING: {$versionfile} is deleted - this may be due to it being renamed\n";
}
if ($newconfig->version < $oldconfig->version && !$isdeleted) {
echo "ERROR: Version number in {$versionfile} has decreased!\n"; echo "ERROR: Version number in {$versionfile} has decreased!\n";
$ERROR = true; $ERROR = true;
} }
if (strlen($newconfig->version) != 10) { if (strlen($newconfig->version) != 10 && !$isdeleted) {
echo "ERROR: Version number in {$versionfile} should be exactly 10 digits.\n"; echo "ERROR: Version number in {$versionfile} should be exactly 10 digits.\n";
$ERROR = true; $ERROR = true;
} }
......
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