-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for openSUSE style detached changelogs #444
Add support for openSUSE style detached changelogs #444
Conversation
Build failed. ✔️ pre-commit SUCCESS in 1m 50s |
I appreciate the effort, but I don't think this should be part of |
Yes, I understand that, the problem is that in openSUSE land it has been the convention for ever and ever to have the changelog in a secondary file and not be it part of the
Yes, the openSUSE changes files follow a different format. A typical changes file entry looks like this:
In contrast to the typical rpm changelog, it always contains a time in UTC, but lacks the EVR (for practical reasons as the build service auto-rebuilds bumping the release). The build service or obs-build or rpmbuild add the changes file into the built rpm, but that happens on a binary rpm level. This doesn't really help in the context of packit. |
I would argue it should be part of packit codebase, there is literally a class called ChangelogHelper.
I see.
That shouldn't be a problem, even some Fedora/RHEL spec files don't have EVR in changelog entries. AFAICT the only difference is the line of dashes instead of an asterisk denoting the start of an entry. IMHO it would make sense to add support for that into |
To be a bit more specific, |
Ok, I'll see how far I get then. How would you recommend to handle the parsing/creation of |
Well, packit should do something similar to what Lines 479 to 551 in c0a98a8
I mean, we could also add an argument to |
Fedora packages can use changelog files too BTW (example), but they exist for preserving changelog history and are not meant to be updated. |
ce37008
to
5c2890e
Compare
@nforro I have reworked the PR, what do you think about this approach? I hope it's as noninvasive as possible |
Build succeeded. ✔️ pre-commit SUCCESS in 1m 49s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! LGTM.
Nice to have would be a property of ChangelogEntry
that would return ChangelogStyle
.
Build succeeded. ✔️ pre-commit SUCCESS in 1m 50s |
1ec1fd2
to
91251df
Compare
Build succeeded. ✔️ pre-commit SUCCESS in 1m 53s |
Just wondering, is rpm in openSUSE patched to be able to parse the changelogs (i.e. does something like |
Nope 😬 : # cat container-snap.changes | rpmspec --parse /dev/stdin
error: line 1: Unknown tag: ------------------------------------------------------------------- |
…logs - add ChangelogStyle enum - add parameter style to ChangelogEntry.assemble to switch between changelog styles - extend Changelog.parse() to process openSUSE changelog entries Co-authored-by: Nikola Forró <[email protected]>
37a09c0
to
290e1b1
Compare
Build succeeded. ✔️ pre-commit SUCCESS in 1m 51s |
I meant when you (con)cat a specfile (without changelog) with the corresponding changes file (and add |
Oh, dang. That's what you meant. So # cat /src/container-snap.spec /src/container-snap.changes | rpmspec --parse /dev/stdin > /dev/null
error: %changelog entries must start with * Afaik there is some logic in the build service that masages the changes files back into the binary rpms |
Right, that's what I thought. Thanks for the investigation and for the PR 🙂 |
Build succeeded (gate pipeline). ✔️ pre-commit SUCCESS in 1m 50s |
372c743
into
packit:main
This PR adds some hacky support for detached/openSUSE style changes files that are inserted into the %changelog section by the open build service.
The tests are not yet all passing, as there is a discrepancy between
str(DetachedChangelog)
and respective section instr(spec)
. I'm not sure if this is caused by my (probably rather odd) approach here or whether this is even required?TODO:
packit/packit.dev
.Fixes
Related to packit/packit#2399
Merge before/after
RELEASE NOTES BEGIN
Add support for detached (open)SUSE style changelogs
RELEASE NOTES END