-
Notifications
You must be signed in to change notification settings - Fork 290
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
lib/checkout: support filtering #1441
Conversation
gpointer unused_ptrs[5]; | ||
gpointer unused_ptrs[3]; | ||
OstreeRepoCheckoutFilter filter; /* Since: 2018.2 */ | ||
gpointer filter_user_data; /* Since: 2018.2 */ |
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 can transform those two into a single object, similar to OstreeRepoCommitModifier
, if we want to conserve pointers.
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.
Eh, feels unlikely we keep adding a lot more functionality to checkout. If we do, I think I'd vote we add new high level APIs.
This will be used by coreos/rpm-ostree#1227. Marking as WIP for now for tests and initial feedback. |
src/libostree/ostree-repo-checkout.c
Outdated
if (state->path_buf) | ||
g_string_truncate (state->path_buf, state->path_buf->len - n); | ||
if (state->selabel_path_buf && !state->shared_path_buf) | ||
g_string_truncate (state->selabel_path_buf, state->selabel_path_buf->len - n); |
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.
Note that this mostly reverts #936. AFAICT, the algorithm before was good, there was just an off-by-one error to account for the added /
when truncating after recursing into a subdir.
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.
Yeah, makes sense.
ee950e6
to
654add0
Compare
Added tests and split out some of the prep in #1442. Dropping WIP. |
src/libostree/ostree-repo-checkout.c
Outdated
// If SELinux labeling is enabled, we need to keep track of the full path string | ||
|
||
if (options->filter) | ||
state.path_buf = new_canonicalized_path_buf (options->subpath); |
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 can switch this to /
so that we call back with the subpath prefixed removed already. Hmm, yeah that feels more natural actually.
5eedb07
to
02dba1d
Compare
bot, retest this please |
☔ The latest upstream changes (presumably 8174885) made this pull request unmergeable. Please resolve the merge conflicts. |
This is analogous to the filtering support for the commit API: we allow library users to skip over checking out specific files. This is useful in some tricky situations where we *know* that the files to be checked out will conflict with existing files in subtle ways. One such example is in rpm-ostree support for multilib. There, we want to allow checking out a package onto an existing tree, but skipping over files that are not coloured to our preferred value (e.g. not overwriting an i686 version of `ldconfig` if we already have the `x86_64` version). See coreos/rpm-ostree#1227 for details.
02dba1d
to
6aca057
Compare
This is ready for review! |
src/libostree/ostree-repo-checkout.c
Outdated
if (state->selabel_path_buf) | ||
if (state->path_buf) | ||
g_string_free (state->path_buf, TRUE); | ||
if (state->selabel_path_buf && !state->shared_path_buf) |
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 could also just check state->path_buf != state->selabel_path_buf
and lose the boolean, right?
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.
True, done in ⬇️!
This is analogous to the filtering support for the commit API: we allow library users to skip over checking out specific files. This is useful in some tricky situations where we *know* that the files to be checked out will conflict with existing files in subtle ways. One such example is in rpm-ostree support for multilib. There, we want to allow checking out a package onto an existing tree, but skipping over files that are not coloured to our preferred value (e.g. not overwriting an i686 version of `ldconfig` if we already have the `x86_64` version). See coreos/rpm-ostree#1227 for details. Closes: #1441 Approved by: cgwalters
💥 Test timed out |
@rh-atomic-bot retry |
This is analogous to the filtering support for the commit API: we allow library users to skip over checking out specific files. This is useful in some tricky situations where we *know* that the files to be checked out will conflict with existing files in subtle ways. One such example is in rpm-ostree support for multilib. There, we want to allow checking out a package onto an existing tree, but skipping over files that are not coloured to our preferred value (e.g. not overwriting an i686 version of `ldconfig` if we already have the `x86_64` version). See coreos/rpm-ostree#1227 for details. Closes: #1441 Approved by: cgwalters
💔 Test failed - status-atomicjenkins |
@rh-atomic-bot retry
…On Tue, Feb 6, 2018, at 10:37 AM, Atomic Bot wrote:
💔 Test failed - [status-atomicjenkins]
(https://s3.amazonaws.com/aos-ci/ghprb/ostreedev/ostree/ca9f18aa0e55056b46a44d3dc31cc144a058fa68.1517931419301646592/index.html)
--
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
#1441 (comment)
|
☀️ Test successful - status-atomicjenkins |
This is analogous to the filtering support for the commit API: we allow
library users to skip over checking out specific files. This is useful
in some tricky situations where we know that the files to be checked
out will conflict with existing files in subtle ways.
One such example is in rpm-ostree support for multilib. There, we want
to allow checking out a package onto an existing tree, but skipping over
files that are not coloured to our preferred value (e.g. not overwriting
an i686 version of
ldconfig
if we already have thex86_64
version).See coreos/rpm-ostree#1227 for details.