From b1a1c7db79b92b1276e5fb433a8e287754fc089b Mon Sep 17 00:00:00 2001 From: Sfikas Date: Mon, 20 Jan 2025 14:25:32 +0100 Subject: [PATCH] fix(update-agent): fix destination on xz components (ORBS-241) (#351) --- update-agent/src/component.rs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/update-agent/src/component.rs b/update-agent/src/component.rs index 98821749..fdc94555 100644 --- a/update-agent/src/component.rs +++ b/update-agent/src/component.rs @@ -83,9 +83,11 @@ impl Component { } fn process_compressed(&mut self, dst: &Path) -> eyre::Result<()> { - let uncompressed_path = dst.with_extension("uncompressed"); - let uncompressed_path_verified = - get_verified_component_path(&uncompressed_path); + let uncompressed_path = + util::make_component_path(dst, &self.source.unique_name()) + .with_extension("uncompressed"); + let uncompressed_path_verified: PathBuf = + uncompressed_path.with_extension("uncompressed.verified"); match check_existing_component(&uncompressed_path, self.manifest_component.size) { @@ -295,7 +297,7 @@ pub fn download>( name: &str, unique_name: &str, size: u64, - dst_dir: P, + dst_dir: &P, supervisor_proxy: Option<&dbus::SupervisorProxyBlocking<'static>>, download_delay: Duration, ) -> Result { @@ -500,7 +502,7 @@ pub fn fetch>( &source.name, &source.unique_name(), source.size, - dst_dir, + &dst_dir, supervisor, download_delay, )?, @@ -509,7 +511,10 @@ pub fn fetch>( "checking sha256 hash of downloaded `{}`", manifest_component.name() ); - let path_verified = get_verified_component_path(&path); + let path_verified = get_verified_component_path(&util::make_component_path( + &dst_dir, + &source.unique_name(), + )); if path_verified.exists() { info!(