Switch is-latest-version check from whether the branch types match to directly comparing the new version against the current version

This commit is contained in:
Steve Rowe 2016-06-25 13:11:16 -04:00
parent d730f4a1ca
commit 60fac6c177
2 changed files with 4 additions and 6 deletions

View File

@ -179,9 +179,7 @@ def read_config():
c = parser.parse_args()
c.branch_type = find_branch_type()
c.matching_branch = c.version.is_bugfix_release() and c.branch_type == BranchType.release or \
c.version.is_minor_release() and c.branch_type == BranchType.stable or \
c.version.is_major_release() and c.branch_type == BranchType.unstable
c.is_latest_version = c.version.on_or_after(Version.parse(find_current_version()))
print ("branch_type is %s " % c.branch_type)
@ -217,9 +215,9 @@ def main():
print('\nAdding new version %s' % c.version)
update_changes('lucene/CHANGES.txt', c.version)
update_changes('solr/CHANGES.txt', c.version, get_solr_init_changes())
add_constant(c.version, not c.matching_branch)
add_constant(c.version, not c.is_latest_version)
if c.matching_branch:
if c.is_latest_version:
print('\nUpdating latest version')
update_build_version(c.version)
update_latest_constant(c.version)

View File

@ -119,7 +119,7 @@ def find_branch_type():
version_prop_re = re.compile('version\.base=(.*)')
def find_current_version():
return version_prop_re.search(open('lucene/version.properties').read()).group(1)
return version_prop_re.search(open('lucene/version.properties').read()).group(1).strip()
if __name__ == '__main__':
print('This is only a support module, it cannot be run')