2019-06-24 13:51:42 +00:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
# -*-coding:UTF-8 -*
|
|
|
|
|
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
import time
|
|
|
|
import argparse
|
|
|
|
|
2022-07-08 07:47:47 +00:00
|
|
|
sys.path.append(os.environ['AIL_BIN'])
|
|
|
|
##################################
|
|
|
|
# Import Project packages
|
|
|
|
##################################
|
|
|
|
from lib import ail_updates
|
2019-11-05 14:18:03 +00:00
|
|
|
|
2019-06-24 13:51:42 +00:00
|
|
|
if __name__ == '__main__':
|
|
|
|
parser = argparse.ArgumentParser(description='AIL default update')
|
2022-11-23 10:02:33 +00:00
|
|
|
parser.add_argument('-t', help='version tag', type=str, dest='tag', required=True)
|
2019-06-24 13:51:42 +00:00
|
|
|
args = parser.parse_args()
|
|
|
|
|
|
|
|
if not args.tag:
|
|
|
|
parser.print_help()
|
|
|
|
sys.exit(0)
|
|
|
|
|
|
|
|
# remove space
|
|
|
|
update_tag = args.tag.replace(' ', '')
|
2022-07-08 07:47:47 +00:00
|
|
|
if not ail_updates.check_version(update_tag):
|
|
|
|
parser.print_help()
|
2022-11-23 10:02:33 +00:00
|
|
|
print(f'Error: Invalid update tag {update_tag}')
|
2022-07-08 07:47:47 +00:00
|
|
|
sys.exit(0)
|
2019-06-24 13:51:42 +00:00
|
|
|
|
|
|
|
start_deb = time.time()
|
|
|
|
|
2022-07-08 07:47:47 +00:00
|
|
|
ail_updates.add_ail_update(update_tag)
|