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 #9103

Merged

Commits on Aug 6, 2020

  1. osutil: add helper for a file copy using atomic file

    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>
    bboozzoo committed Aug 6, 2020
    Configuration menu
    Copy the full SHA
    e26422e View commit details
    Browse the repository at this point in the history
  2. gadget: use atomic file copy, adjust tests

    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>
    bboozzoo committed Aug 6, 2020
    Configuration menu
    Copy the full SHA
    78e2fd1 View commit details
    Browse the repository at this point in the history
  3. gadget: tweak comments

    Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
    bboozzoo committed Aug 6, 2020
    Configuration menu
    Copy the full SHA
    eb9dd3b View commit details
    Browse the repository at this point in the history
  4. gadget,osutil: rename CopyFileAtomic to AtomicWriteFileCopy

    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
    pedronis committed Aug 6, 2020
    Configuration menu
    Copy the full SHA
    46a7e60 View commit details
    Browse the repository at this point in the history