Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packager will check the tag number. #152

Open
wants to merge 2 commits into
base: future
Choose a base branch
from
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