Skip to content

Commit 05acf46

Browse files
jessp01nforro
andcommitted
Address #491
add_changelog_entry(): Incorrect evr expansion Use the tags() context manager directly for better performance Co-authored-by: Nikola Forró <[email protected]>
1 parent 21a45ba commit 05acf46

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

specfile/specfile.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,15 @@ def add_changelog_entry(
611611
if self.contains_autochangelog(section):
612612
continue
613613
if evr is None:
614-
evr = "%{?epoch:%{epoch}:}%{version}-%{release}"
614+
with self.tags() as tags:
615+
try:
616+
evr = f"{tags.epoch.expanded_value}:"
617+
except AttributeError:
618+
evr = ""
619+
evr += f"{tags.version.expanded_value}-"
620+
evr += self.expand(
621+
tags.release.value, extra_macros=[("dist", "")]
622+
)
615623
with self.changelog(section) as changelog:
616624
if changelog is None:
617625
return

0 commit comments

Comments
 (0)