Enable pkg_rpm and pkg_subrpm to create empty RPMs #859
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
At present we fail in two ways if we try to create empty RPMs:
we expect srcs to be both non-empty and will fail if it is empty and we have no spec file
we don't emit anything for the
%files
block in the RPM if there are no actual files and rpmbuild doesn't like thisThis change tweaks the former condition so that srcs has to be non-None or we have to have a specfile, but will allow us to have an empty (
[]
) value for srcs. Additionally, it injects%defattr(-,root,root)
as a reasonable default for the%files
blocks so as to allow rpmbuild to be happy with what we're providing.Fixes #711