-
Notifications
You must be signed in to change notification settings - Fork 23
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
Add handling for docs files and license files #256
Conversation
Signed-off-by: Jeremy Rickard <jrickard@microsoft.com>
Signed-off-by: Jeremy Rickard <jrickard@microsoft.com>
Signed-off-by: Jeremy Rickard <jrickard@microsoft.com>
spec.go
Outdated
@@ -131,6 +131,10 @@ type Artifacts struct { | |||
Directories *CreateArtifactDirectories `yaml:"createDirectories,omitempty" json:"createDirectories,omitempty"` | |||
// ConfigFiles is a list of files that should be marked as config files in the package. | |||
ConfigFiles map[string]ArtifactConfig `yaml:"configFiles,omitempty" json:"configFiles,omitempty"` | |||
// DocFiles is a list of doc files included in the package | |||
DocFiles []string `yaml:"docFiles,omitempty" json:"docFiles,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.
The reason I like to make these structs is so that it is not a breaking change to add additional options.
I also think subdir
is a thing relavent for these files (and licenses).
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.
Got it to work. I needed to handle the copy myself for the subpaths and emit the full path inside the %files section.
spec.go
Outdated
@@ -131,6 +131,10 @@ type Artifacts struct { | |||
Directories *CreateArtifactDirectories `yaml:"createDirectories,omitempty" json:"createDirectories,omitempty"` | |||
// ConfigFiles is a list of files that should be marked as config files in the package. | |||
ConfigFiles map[string]ArtifactConfig `yaml:"configFiles,omitempty" json:"configFiles,omitempty"` | |||
// DocFiles is a list of doc files included in the package | |||
DocFiles []string `yaml:"docFiles,omitempty" json:"docFiles,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.
Also can we name these docs
and licenses
in the yaml/json?
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.
Yep, I updated. I also changed the struct fields to Docs
and Licenses
, that seemed like better naming to me.
7c0b1e7
to
85a897c
Compare
Signed-off-by: Jeremy Rickard <jrickard@microsoft.com>
85a897c
to
0b8cc0b
Compare
spec.go
Outdated
@@ -131,6 +131,10 @@ type Artifacts struct { | |||
Directories *CreateArtifactDirectories `yaml:"createDirectories,omitempty" json:"createDirectories,omitempty"` | |||
// ConfigFiles is a list of files that should be marked as config files in the package. | |||
ConfigFiles map[string]ArtifactConfig `yaml:"configFiles,omitempty" json:"configFiles,omitempty"` | |||
// DocFiles is a list of doc files included in the package |
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.
These doc strings are not correct anymore 🙈
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.
// DocFiles is a list of doc files included in the package | |
// Docs is a list of doc files included in the package |
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.
LOL sorry
spec.go
Outdated
@@ -131,6 +131,10 @@ type Artifacts struct { | |||
Directories *CreateArtifactDirectories `yaml:"createDirectories,omitempty" json:"createDirectories,omitempty"` | |||
// ConfigFiles is a list of files that should be marked as config files in the package. | |||
ConfigFiles map[string]ArtifactConfig `yaml:"configFiles,omitempty" json:"configFiles,omitempty"` | |||
// DocFiles is a list of doc files included in the package | |||
Docs map[string]ArtifactConfig `yaml:"docs,omitempty" json:"docs,omitempty"` | |||
// LicenseFiles is a list of doc files included in the package |
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.
// LicenseFiles is a list of doc files included in the package | |
// Licenses is a list of doc files included in the package |
Signed-off-by: Jeremy Rickard <jrickard@microsoft.com>
What this PR does / why we need it:
This PR adds the ability to add files to the package and have them represented by the
%doc
directive or the %license directive within the %files list.There isn't a corresponding install entry, because RPM handles this already:
The same happens with license files.
I thought that a slice of strings made more sense than using ArtifactConfig here, since we don't really need to provide any other real options. It seems like you can specify a full path with the %doc directive (%license as well), but I think we can go with this for now? It feels cleaner/more organized.
Which issue(s) this PR fixes (optional, using
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when the PR gets merged):fixes #241
Special notes for your reviewer: