Skip to content
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

gadget, osutil: use atomic file copy, adjust tests (2.45) #9108

Merged
merged 4 commits into from Aug 7, 2020

Conversation

mvo5
Copy link
Contributor

@mvo5 mvo5 commented Aug 7, 2020

This is #9103 for 2.45

bboozzoo and others added 4 commits August 7, 2020 08:44
The regular CopyFile() call can only overwrite the destination location in
place. Add a new helper that wraps the destination path with AtomicFile, to
obtain a 2 stage write & commit (or cancel) behavior.

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
Use the CopyFileAtomic helper for moving file data around. Update the tests
to match slightly changed semantics.

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
this makes it a bit clearer that ATM some aspects of the behavior are
closer to the AtomicWrite* family

for consistency this involved also swapping argument order
@mvo5 mvo5 added this to the 2.45 milestone Aug 7, 2020
@mvo5 mvo5 changed the base branch from master to release/2.45 August 7, 2020 06:46
@mvo5 mvo5 merged commit 407ca30 into snapcore:release/2.45 Aug 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants