Skip to content

Commit

Permalink
updatehub: object: copy: if file is missing, install it
Browse files Browse the repository at this point in the history
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
  • Loading branch information
otavio committed May 3, 2022
1 parent 28f386c commit aca3da6
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions updatehub/src/object/installer/copy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,13 @@ impl Installer for objects::Copy {
{
let mount_guard = utils::fs::mount(&device, filesystem, mount_options)?;
let file_path = mount_guard.mount_point().join(&target_path);
let should_skip_install = super::should_skip_install(
&self.install_if_different,
&self.sha256sum,
async move { Ok(fs::File::open(file_path).await?) },
)
.await?;
let should_skip_install = file_path.exists()
&& super::should_skip_install(
&self.install_if_different,
&self.sha256sum,
async move { Ok(fs::File::open(file_path).await?) },
)
.await?;
if should_skip_install {
return Ok(());
}
Expand Down

0 comments on commit aca3da6

Please sign in to comment.