From fbf891fdfff5c83780a5ca61adad4423e850117a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Fri, 17 Mar 2023 10:41:04 +0100 Subject: [PATCH] packaging: Adapt `get_last_modification()` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The function is returning "" when called from the script used to cache the artefacts and one difference noted between this version and the already working one from the CCv0 is that we make sure to `pushd ${repo_root_dir}` in the CCv0 version. Let's give it a try here and see if it solves the issue. Signed-off-by: Fabiano FidĂȘncio --- tools/packaging/scripts/lib.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/packaging/scripts/lib.sh b/tools/packaging/scripts/lib.sh index c4253410817..aa101b870ed 100644 --- a/tools/packaging/scripts/lib.sh +++ b/tools/packaging/scripts/lib.sh @@ -106,6 +106,7 @@ get_kata_hash() { get_last_modification() { local file="${1}" + pushd ${repo_root_dir} &> /dev/null # This is a workaround needed for when running this code on Jenkins git config --global --add safe.directory ${repo_root_dir} &> /dev/null @@ -113,6 +114,7 @@ get_last_modification() { [ $(git status --porcelain | grep "${file#${repo_root_dir}/}" | wc -l) -gt 0 ] && dirty="-dirty" echo "$(git log -1 --pretty=format:"%H" ${file})${dirty}" + popd &> /dev/null } # $1 - The tag to be pushed to the registry