Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions tools/packager.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,39 @@ class opts(object):
usage()
sys.exit(1)

if opts.update_version and opts.tag:
ret = subprocess.run(["git", "describe", "--tags"], capture_output=True)
if ret.returncode:
print(f"Unable to retrieve last tag information: {ret.returncode}")
sys.exit(1)

last_taginfo = ret.stdout.decode("utf-8").rstrip("\n")
ret = re.match("^\d+\.\d+\.", last_taginfo)
if ret is None:
print( "Unable to retrieve the version number from last tag: "
f"{last_taginfo}")
sys.exit(1)
ret = ret.group(0)
if not opts.tag.startswith(ret):
while True:
print("╔╗ ╔╗ ╔╗")
print("║║ ║║ ║║")
print("║║ ║║ ║║")
print("╚╝ ╚╝ ╚╝")
print("╔╗ ╔╗ ╔╗")
print("╚╝ ╚╝ ╚╝")

print( "The last tag number of the repository is not "
"compatible with the new tag number!\n"
f" Last tag: {last_taginfo}\n"
f" New tag: {opts.tag}")
res = input("Do you want to continue? (y/n) ")

if 'n' == res:
sys.exit(1)
elif 'y' == res:
break

# remove existing deban directory BEGIN
try:
shutil.rmtree("debian")
Expand Down