Skip to content
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

Ensure binary and source headers are identified as such after parse #3012

Merged
merged 2 commits into from Apr 3, 2024

Conversation

pmatilai
Copy link
Member

@pmatilai pmatilai commented Apr 2, 2024

The two commits improve source and binary package header detection right after spec parse, fixing #2819 in the process. Details in commits.

headerIsSource() uses RPMTAG_SOURCERPM presence to identify binary
packages, but that tag gets inserted late in an actual package build,
whereas we'd like to source headers to be identifiable right after
spec parse already. Non-presence of a tag is not a very strong indicator
anyhow, and even less so when said headers are still under construction.

Move RPMTAG_SOURCEHEADER insertion early - there's no reason not to -
and use its presence as a positive identification of source headers,
falling back to the "not a binary" logic when not there to preserve
behavior otherwise.
@pmatilai pmatilai changed the title Ensure source headers are identified as such after a spec parse Ensure binary and source headers are identified as such after parse Apr 2, 2024
Contrary to expectations, there's a perfectly logical place to
initialize the source rpm name: initSourceHeader(). This gets called
early enough to let use insert RPMTAG_SOURCERPM right after spec
parse for proper binary package identification in headerIsSource().
The only special case is buildreqs.nosrc.rpm generation that doesn't
follow the normal process, so remember to free the normal name there.

Fixes: rpm-software-management#2819
@ffesti ffesti merged commit dc47a50 into rpm-software-management:master Apr 3, 2024
1 check passed
@dmnks dmnks added REGRESSION bug packaging Package building, SPEC files, etc. labels Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug packaging Package building, SPEC files, etc. REGRESSION
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants