-
Notifications
You must be signed in to change notification settings - Fork 305
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
repo: Add a "force copy" flag to checkout #804
Conversation
This is intended to be used for copying `/usr/etc` → `/etc` for deployments. A TODO here is to use `glnx_file_copy_at()` if the repo mode allows it - then we'd use reflinks if available.
@@ -102,6 +104,11 @@ process_one_checkout (OstreeRepo *repo, | |||
"Cannot specify both --union and --union-add"); | |||
goto out; | |||
} | |||
if (opt_require_hardlinks && opt_force_copy) |
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.
Should this be checked at the API level too?
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 ⬇️
tests/basic-test.sh
Outdated
@@ -41,6 +41,7 @@ fi | |||
validate_checkout_basic() { | |||
(cd $1; | |||
assert_has_file firstfile | |||
assert_not_streq $(stat -c '%h' firstfile) 1 |
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.
Interesting, this is failing in test-basic-user.sh
. Surprisingly, not in the -U -H
case, but just in the vanilla $OSTREE checkout test2 checkout-test2
test. Is there a bug there? Seems like it's hardlinking from a bare-user repo even without -U
.
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.
Wait, I read this backwards. The fact that it's failing means that it is copying rather than hardlinking, which is what we want in user-mode without -U
. So I think this just needs some conditionals around it.
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, this only works in bare right now. This whole suite really needs rewriting.
☀️ Test successful - status-atomicjenkins |
This isn't a new API function so the default rpm detection doesn't work. But we do need a new ostree for ostreedev/ostree#804.
This is intended to be used for copying
/usr/etc
→/etc
fordeployments.
A TODO here is to use
glnx_file_copy_at()
if the repo mode allowsit - then we'd use reflinks if available.