-
-
Notifications
You must be signed in to change notification settings - Fork 159
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: Directory content type with custom attributes #390
Conversation
Codecov Report
@@ Coverage Diff @@
## master #390 +/- ##
==========================================
+ Coverage 64.71% 65.25% +0.53%
==========================================
Files 14 14
Lines 1828 1842 +14
==========================================
+ Hits 1183 1202 +19
+ Misses 509 502 -7
- Partials 136 138 +2
Continue to review full report at Codecov.
|
@@ -166,7 +165,7 @@ func (*Deb) SetPackagerDefaults(info *nfpm.Info) { | |||
// if in the long run we should be more strict about this and error when | |||
// not set? | |||
if info.Maintainer == "" { | |||
log.Println("DEPRECATION WARNING: Leaving the 'maintainer' field unset will not be allowed in a future version") |
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.
We don't use log
, elsewhere, so I changed it to print to os.Stderr
just like the empty_folders
deprecation warning.
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.
thinking out loud here: maybe we could allow the caller to pass a io.Writer
or some other interface as to "where should we print the warnings" 🤔
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.
I think that's a good idea for another PR with some mechanism for deprecation warnings. I would leave it out of this one, though.
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.
Another idea: a package level io.Writer
for warnings that defaults to os.Stderr
that can be overwritten globally. It's simple enough to add it to this PR.
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.
LGTM
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.
just some nitpicks, but looks good overall!
awesome work!
@@ -166,7 +165,7 @@ func (*Deb) SetPackagerDefaults(info *nfpm.Info) { | |||
// if in the long run we should be more strict about this and error when | |||
// not set? | |||
if info.Maintainer == "" { | |||
log.Println("DEPRECATION WARNING: Leaving the 'maintainer' field unset will not be allowed in a future version") |
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.
thinking out loud here: maybe we could allow the caller to pass a io.Writer
or some other interface as to "where should we print the warnings" 🤔
Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
awesome work as always, thanks @erikgeiser ! |
This PR introduces the content type
dir
which can be used to add empty directories or directories with custom attributes such as owner, group or permissions. It also makesEmptyFolders
obsolete.Another important aspect is that it can be used to specified directories "owned" by the package when packaging RPMs as only those directories are removed when the package is uninstalled. This use case is also now well documented.