fix(release): preserve multi-line changelog bodies in package mirrors
update_debian_changelog and update_spec_changelog wrapped the whole release message in a single prefixed line, so only the first line of a multi-line (already-bulleted) message was indented/dashed while the rest stayed at column 0. That made dpkg-parsechangelog emit 'badly formatted heading line' and rpmspec report 'bad date', failing the package build. Each non-empty body line is now indented (Debian) or dash-prefixed (RPM) individually. update_changelog no longer auto-prepends a '* ' bullet to the CHANGELOG.md entry: the message is inserted verbatim with blank-line separation, so a caller-provided markdown list stays markdown-lint-clean instead of gaining a stray leading bullet. Adds regression tests for the multi-line debian/rpm mirroring and the no-injected-bullet behaviour. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
f6228988e1
commit
87ee6c66c8
4 files changed
+120
-6
No files matched your search
@@ -73,7 +73,8 @@ def update_changelog(
|
||||
else:
|
||||
message = editor_message
|
||||
|
||||
entry = f"## [{new_version}] - {today}\n\n* {message}\n\n"
|
||||
body = message.strip() if message and message.strip() else f"Release {new_version}."
|
||||
entry = f"## [{new_version}] - {today}\n\n{body}\n\n"
|
||||
|
||||
if os.path.exists(changelog_path):
|
||||
try:
|
||||
|
||||
@@ -47,10 +47,17 @@ def update_debian_changelog(
|
||||
author_name, author_email = _get_debian_author()
|
||||
|
||||
first_line = f"{package_name} ({debian_version}) unstable; urgency=medium"
|
||||
body_line = message.strip() if message else f"Automated release {new_version}."
|
||||
body = (
|
||||
message.strip()
|
||||
if message and message.strip()
|
||||
else f"Automated release {new_version}."
|
||||
)
|
||||
indented_body = "\n".join(
|
||||
f" {line}" if line.strip() else line for line in body.split("\n")
|
||||
)
|
||||
stanza = (
|
||||
f"{first_line}\n\n"
|
||||
f" * {body_line}\n\n"
|
||||
f"{indented_body}\n\n"
|
||||
f" -- {author_name} <{author_email}> {date_str}\n\n"
|
||||
)
|
||||
|
||||
|
||||
@@ -30,11 +30,18 @@ def update_spec_changelog(
|
||||
date_str = now.strftime("%a %b %d %Y")
|
||||
|
||||
author_name, author_email = _get_debian_author()
|
||||
body_line = message.strip() if message else f"Automated release {new_version}."
|
||||
body = (
|
||||
message.strip()
|
||||
if message and message.strip()
|
||||
else f"Automated release {new_version}."
|
||||
)
|
||||
dashed_body = "\n".join(
|
||||
f"- {line}" if line.strip() else line for line in body.split("\n")
|
||||
)
|
||||
|
||||
stanza = (
|
||||
f"* {date_str} {author_name} <{author_email}> - {debian_version}\n"
|
||||
f"- {body_line}\n\n"
|
||||
f"{dashed_body}\n\n"
|
||||
)
|
||||
|
||||
marker = "%changelog"
|
||||
|
||||
Reference in new issue
Block a user