From 56d5d5932d93a3f3ae1efa269199da529b7d61ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Sun, 4 Dec 2022 17:10:05 +0100 Subject: [PATCH] kata-deploy-binaries: Avoid pushd / popd if not needed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Let's avoid getting into a dir and risking not being able to leave that dir in case something fails. Instead, let's just stay in the current dir and move the final tarball to the exoected directory in case all the checks go as expected. Signed-off-by: Fabiano FidĂȘncio --- .../kata-deploy/local-build/kata-deploy-binaries.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/packaging/kata-deploy/local-build/kata-deploy-binaries.sh b/tools/packaging/kata-deploy/local-build/kata-deploy-binaries.sh index b338ef3f9..92e614c93 100755 --- a/tools/packaging/kata-deploy/local-build/kata-deploy-binaries.sh +++ b/tools/packaging/kata-deploy/local-build/kata-deploy-binaries.sh @@ -126,12 +126,11 @@ install_cached_component() { [ "${cached_version}" != "${current_version}" ] && return 1 info "Using cached tarball of ${component}" - pushd ${workdir} echo "Downloading tarball from: ${jenkins_build_url}/${component_tarball_name}" - curl -fL --progress-bar "${jenkins_build_url}/${component_tarball_name}" -o "${component_tarball_path}" || return cleanup_and_fail + curl -fL --progress-bar "${jenkins_build_url}/${component_tarball_name}" -o "${component_tarball_name}" || return cleanup_and_fail curl -fsOL "${jenkins_build_url}/sha256sum-${component_tarball_name}" || return cleanup_and_fail sha256sum -c "sha256sum-${component_tarball_name}" || return cleanup_and_fail - popd + mv "${component_tarball_name}" "${component_tarball_path}" } # Install static CC cloud-hypervisor asset