def main(): parser = OptionParser() parser.add_option( "--mode", action="store", dest="mode", default=None, help="""\ The mode of update, prerelease, hotfix, release, auto (default auto determines from branch).""", ) options, positional_args = parser.parse_args() if positional_args: parser.print_help() sys.exit("\nError, no positional argument allowed.") # Go its own directory, to have it easy with path knowledge. goHome() with open("nuitka/Version.py") as f: option_lines = f.readlines() (version_line, ) = [ line for line in option_lines if line.startswith("Nuitka V") ] old_version = version_line[8:].rstrip() mode = options.mode branch_name = getBranchName() if mode is None: if branch_name.startswith("hotfix/"): mode = "hotfix" elif branch_name == "master" or branch_name.startswith("release/"): mode = "release" elif branch_name == "develop": mode = "prerelease" else: sys.exit("Error, cannot detect mode from branch name '%s'." % branch_name) new_version = getBumpedVersion(mode, old_version) print("Bumped", mode, old_version, "->", new_version) with open("nuitka/Version.py", "w") as options_file: for line in option_lines: if line.startswith("Nuitka V"): line = "Nuitka V" + new_version + "\n" options_file.write(line) # Debian is currently not in freeze, change to "experimental" once that changes. updateDebianChangelog(old_version, new_version, "unstable")
def main(): parser = OptionParser() parser.add_option( "--mode", action="store", dest="mode", default=None, help="""\ The mode of update, prerelease, hotfix, release, auto (default auto determines from branch).""", ) options, positional_args = parser.parse_args() if positional_args: parser.print_help() sys.exit("\nError, no positional argument allowed.") # Go its own directory, to have it easy with path knowledge. goHome() with open("nuitka/Version.py") as f: option_lines = f.readlines() version_line, = [line for line in option_lines if line.startswith("Nuitka V")] old_version = version_line[8:].rstrip() mode = options.mode branch_name = getBranchName() if mode is None: if branch_name.startswith("hotfix/"): mode = "hotfix" elif branch_name == "master" or branch_name.startswith("release/"): mode = "release" elif branch_name == "develop": mode = "prerelease" else: sys.exit("Error, cannot detect mode from branch name '%s'." % branch_name) new_version = getBumpedVersion(mode, old_version) print("Bumped", mode, old_version, "->", new_version) with open("nuitka/Version.py", "w") as options_file: for line in option_lines: if line.startswith("Nuitka V"): line = "Nuitka V" + new_version + "\n" options_file.write(line) updateDebianChangelog(old_version, new_version)
def main(): parser = OptionParser() parser.add_option("--mode", action="store", dest="mode", default="release", help="""\ The mode of update, prerelease, hotfix, or final.""") options, positional_args = parser.parse_args() if positional_args: parser.print_help() sys.exit("\nError, no positional argument allowed.") # Go its own directory, to have it easy with path knowledge. goHome() option_lines = [line for line in open("nuitka/Version.py")] version_line, = [ line for line in open("nuitka/Version.py") if line.startswith("Nuitka V") ] old_version = version_line[8:].rstrip() new_version = getBumpedVersion(options.mode, old_version) print("Bumping", old_version, "->", new_version) with open("nuitka/Version.py", 'w') as options_file: for line in option_lines: if line.startswith("Nuitka V"): line = "Nuitka V" + new_version + '\n' options_file.write(line) updateDebianChangelog(old_version, new_version)