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
rpm: packages with undefined values are written as empty strings #619
Comments
depends on google/rpmpack#88 |
Looks like this is not going to be merged, as it is a breaking change for the rpmpack. What about reserving one value |
I think that could be a good solution... want to propose that in there? |
I'm facing the same issue into my spacewalk repository for recent elastic package which use nfpm .. did you have any news about this issue ? |
closes #619 Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
see #809 |
closes #619 Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
What happened?
nfpm appears to conflate empty string and undefined fields when writing out the rpm headers. Unspecified configuration parameters get set to the empty string
""
. Whereas an equivalent configuration is created manually withrpmbuild
these parameters are left out of the headers (some may have defaults likeGroup: Unspecified
).I'd like nfpm to skip writing these headers instead of setting them to the empty string. I don't know if the intent of the project is to mimic rpmbuild's behavior or not. But at least for empty fields, yes please :)
Thank you!
Background:
We identified this issue when (after migrating to nfpm) customers reported that our packaging now had fields that were unspecified. We identified that our packages did indeed have empty fields set that show up under
rpm -qpi .../my.rpm
.How can we reproduce this?
For context, a minimum spec file indicating `rpmbuild`'s required fields
A minimally specified RPM spec file, build, and resulting metadata:
An equivalently minimum yaml config showing nfpm's undefined parameters behavior:
These tests were conducted on an CentOS 8 box. I don't know if this might be differences between how RPM displays/records the data in the header. But since we are writing the headers in pure-Go, I'm assuming it's just the fact that we are recording empty strings instead of skipping.
nfpm version
Search
Code of Conduct
Additional context
I'm not an RPM expert (so I don't think this is a wise approach), but I did add a one-liner skip logic to
index.Add
to test the behavior of excluding empty fields and see what the package looked like (see below). Though I think the correct behavior would be to make many of these optional fields*string
so nfpm can disambiguate.Quick and dirty hacked-in support for empty field handling
Which looks far more like what I would expect to have given my inputs.
The text was updated successfully, but these errors were encountered: