chg: [update] older versions: filter 5.0 updates

This commit is contained in:
Terrtia 2023-05-17 11:40:42 +02:00
parent 88d3870230
commit 5b6a7f15ce
No known key found for this signature in database
GPG key ID: 1E1B1F50D84613D0

View file

@ -16,7 +16,11 @@ import argparse
import subprocess import subprocess
sys.path.append(os.environ['AIL_BIN']) # # TODO: move other functions sys.path.append(os.environ['AIL_BIN'])
##################################
# Import Project packages
##################################
# TODO: move other functions
from packages import git_status from packages import git_status
@ -157,7 +161,7 @@ def get_git_current_tag(path_current_version):
with open(path_current_version, 'r') as version_content: with open(path_current_version, 'r') as version_content:
version = version_content.read() version = version_content.read()
except FileNotFoundError: except FileNotFoundError:
version = 'v1.4' version = 'v5.0' # TODO Replace with VERSION.json
with open(path_current_version, 'w') as version_content: with open(path_current_version, 'w') as version_content:
version_content.write(version) version_content.write(version)
@ -230,6 +234,11 @@ def get_git_upper_tags_remote(current_tag, is_fork):
except ValueError: except ValueError:
continue continue
if float(current_tag) < 4.2:
# add tag with last commit
if float(current_tag_val) <= float(tag_val) < float(4.2):
dict_tags_commit[tag] = commit
else:
# add tag with last commit # add tag with last commit
if float(tag_val) >= float(current_tag_val): if float(tag_val) >= float(current_tag_val):
dict_tags_commit[tag] = commit dict_tags_commit[tag] = commit
@ -444,3 +453,7 @@ if __name__ == "__main__":
print(' {}AIL Auto update is disabled{}'.format(TERMINAL_RED, TERMINAL_DEFAULT)) print(' {}AIL Auto update is disabled{}'.format(TERMINAL_RED, TERMINAL_DEFAULT))
aborting_update() aborting_update()
sys.exit(0) sys.exit(0)
# r = get_git_upper_tags_remote('4.2.1', False)
# print(r)