-
Notifications
You must be signed in to change notification settings - Fork 25
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: add support for datadir in rpm spec #308
feat: add support for datadir in rpm spec #308
Conversation
test/azlinux_test.go
Outdated
"bin": {}, | ||
}, | ||
DataFiles: map[string]dalec.ArtifactConfig{ | ||
"data_dir": {}, |
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.
It might be good to add a test with a subpath in the artifact config
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.
done, thanks!
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 this looks fine to me. One thing to consider is, it likely would not be good practice to install directly under %{_datadir}
as in %{_datadir}/my_file.data
, I believe there should pretty much always be at least one directory level of nesting to specify the package the data applies to. That being said, I'm not sure here is the place to validate that necessarily.
@adamperlin Agreed I was going to comment the same thing but yeah I don't think there's really anything we can do here other than provide guidance that it should be namespaced. Looks like you need to |
@cpuguy83 @adamperlin Example: # layout of /build src directory:
# /build/src/
# L my_data_dir/
# L my_data_file
# ...
artifacts:
data_dirs:
my_data_dir:
subpath: my_namespace
# layout of /usr/share in final container:
# /usr/share/
# L my_namespace/
# L my_data_file
|
Also, add an integration test harness for development. Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
ff9e497
to
d8816d7
Compare
After discussion with @cpuguy83, we decided to allow placing files directly under |
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.
This can also use a squash.
spec.go
Outdated
@@ -128,6 +128,8 @@ type Artifacts struct { | |||
Binaries map[string]ArtifactConfig `yaml:"binaries,omitempty" json:"binaries,omitempty"` | |||
// Manpages is the list of manpages to include in the package. | |||
Manpages map[string]ArtifactConfig `yaml:"manpages,omitempty" json:"manpages,omitempty"` | |||
// DataDirs is a list of read-only architecture-independent data files, to be placed in /usr/share/ | |||
DataDirs map[string]ArtifactConfig `yaml:"data_files,omitempty" json:"data_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.
Nit we have DataDirs
as the field and data_files
as the yaml.
Can we coalesce this?
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.
done, will merge when tests pass
Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
2084544
to
0c26660
Compare
What this PR does / why we need it:
Users have requested the ability to put read-only architecture-independent data files under
/usr/share
.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):Related #242 (does not completely resolve)
Special notes for your reviewer: