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
feat: Support RPM ghost files #245
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/goreleaser/nfpm/x5z8hufgg |
Codecov Report
@@ Coverage Diff @@
## master #245 +/- ##
==========================================
+ Coverage 66.86% 67.11% +0.25%
==========================================
Files 9 9
Lines 1023 1031 +8
==========================================
+ Hits 684 692 +8
Misses 204 204
Partials 135 135
Continue to review full report at Codecov.
|
nfpm.go
Outdated
@@ -181,6 +181,7 @@ type RPM struct { | |||
// https://www.cl.cam.ac.uk/~jw35/docs/rpm_config.html | |||
ConfigNoReplaceFiles map[string]string `yaml:"config_noreplace_files,omitempty"` | |||
Signature RPMSignature `yaml:"signature,omitempty"` | |||
Ghosts []string `yaml:"ghosts,omitempty"` |
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.
maybe GhostFiles instead (to go with ConfigNoReplaceFiles)?
Ghosts []string `yaml:"ghosts,omitempty"` | |
GhostFiles []string `yaml:"ghost_files,omitempty"` |
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.
Sounds good, thanks for reviewing. I'll make the changes.
From the [Maximum RPM] guide: The %ghost Directive As we mentioned in the Section called The %files List, if a file is specified in the %files list, that file will automatically be included in the package. There are times when a file should be owned by the package but not installed - log files and state files are good examples of cases you might desire this to happen. The way to achieve this, is to use the %ghost directive. By adding this directive to the line containing a file, RPM will know about the ghosted file, but will not add it to the package. Ghost files are specified using `Type: rpmpack.GhostFile` when constructing the output package. The test ensures that we have: - The target file present in the RPM. - The specified mode attributes (although not really important, either). - An empty file *[1]* in the RPM for the named ghost, see [google/rpmpack #51]. *[1] Instead of an empty file, no file should be created, but this is not possible until the upstream issue is resolved.* [Maximum RPM]: http://ftp.rpm.org/max-rpm/s1-rpm-inside-files-list-directives.html [google/rpmpack #51]: google/rpmpack#51
Thanks! |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
From the Maximum RPM guide:
Ghost files are specified using
Type: rpmpack.GhostFile
whenconstructing the output package.
The test ensures that we have:
either).
see google/rpmpack #51.
[1] Instead of an empty file, no file should be created, but this is
not possible until the upstream issue is resolved.