patchupdate.py: Wrap debian/changelog at 80 chars.

This commit is contained in:
Sebastian Lackner 2015-05-07 02:24:03 +02:00
parent 952ab53219
commit d532c3b5bd
2 changed files with 448 additions and 214 deletions

642
debian/changelog vendored

File diff suppressed because it is too large Load Diff

View File

@ -760,6 +760,25 @@ def generate_markdown(all_patches, stable_patches):
# Add changes to git
subprocess.call(["git", "add", config.path_README_md])
def wrap_changelog():
lines = []
with open(config.path_changelog) as fp:
for line in fp:
if line.startswith(" *") and len(line.rstrip("\n")) > 80:
wrapped = textwrap.wrap(line[3:].strip(), 80 - 4)
lines.append(" * %s\n" % "\n ".join(wrapped))
else:
lines.append(line)
with open(config.path_changelog, "w") as fp:
for line in lines:
fp.write(line)
# Add changes to git
subprocess.call(["git", "add", config.path_changelog])
if __name__ == "__main__":
# Hack to avoid KeyboardInterrupts on different threads
@ -781,6 +800,7 @@ if __name__ == "__main__":
generate_ifdefined(all_patches)
generate_script(all_patches)
generate_markdown(all_patches, stable_patches)
wrap_changelog()
except PatchUpdaterError as e:
print ""