patchupdate.py: Rename stable -> released in multiple functions and variables.

This commit is contained in:
Sebastian Lackner 2015-10-05 21:21:56 +02:00
parent 3307e90080
commit 2dc572f110

View File

@ -163,12 +163,12 @@ def _read_changelog():
r = re.match("^([a-zA-Z0-9][^(]*)\((.*)\) ([^;]*)", line)
if r: yield (r.group(1).strip(), r.group(2).strip(), r.group(3).strip())
def _latest_staging_version(only_stable=False):
"""Get version number of the latest stable release."""
def _latest_staging_version(only_released=False):
"""Get version number of the latest release / unreleased version."""
for package, version, distro in _read_changelog():
if distro.lower() != "unreleased":
return version
elif not only_stable:
elif not only_released:
return "%s (unreleased)" % version
def _latest_wine_commit(commit=None):
@ -803,7 +803,7 @@ def generate_script(all_patches, skip_checks=False):
# Add changes to git
subprocess.call(["git", "add", config.path_script])
def generate_markdown(all_patches, stable_patches):
def generate_markdown(all_patches, release_patches):
"""Generate README.md including information about specific patches and bugfixes."""
def _format_bug(mode, bugid, bugname):
@ -820,8 +820,8 @@ def generate_markdown(all_patches, stable_patches):
key = bugid if bugid is not None else bugname
all_fixes[key] = [1, bugid, bugname]
# Compare with fixes for latest stable version
for _, patch in stable_patches.iteritems():
# Compare with fixes for last release
for _, patch in release_patches.iteritems():
for bugid, bugname in patch.fixes:
if bugid is not None and all_fixes.has_key(bugid):
all_fixes[bugid][0] = 0
@ -934,11 +934,11 @@ if __name__ == "__main__":
# Get information about Wine and Staging version
latest_wine_commit = _latest_wine_commit(args.commit)
latest_staging_version = _latest_staging_version(only_stable=True)
latest_staging_version = _latest_staging_version(only_released=True)
# Read current and stable patches
all_patches = read_patchset()
stable_patches = read_patchset(revision="v%s" % latest_staging_version)
# Read current and release patches
all_patches = read_patchset()
release_patches = read_patchset(revision="v%s" % latest_staging_version)
# Check bugzilla
check_bug_status(all_patches, sync_bugs=args.sync_bugs)
@ -946,7 +946,7 @@ if __name__ == "__main__":
# Update autogenerated files
generate_ifdefined(all_patches, skip_checks=args.skip_checks)
generate_script(all_patches, skip_checks=args.skip_checks)
generate_markdown(all_patches, stable_patches)
generate_markdown(all_patches, release_patches)
wrap_changelog()
except PatchUpdaterError as e: