From 052de38e592cce3385b2b492461d5e3e2e372d47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dawid=20Ci=C4=99=C5=BCarkiewicz?= Date: Tue, 19 Sep 2023 14:00:17 -0700 Subject: [PATCH] chore: better names and messages to tell diff from full --- lib/setupHooks/installCargoArtifactsHook.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/setupHooks/installCargoArtifactsHook.sh b/lib/setupHooks/installCargoArtifactsHook.sh index bc6dccd6..23f1a07a 100644 --- a/lib/setupHooks/installCargoArtifactsHook.sh +++ b/lib/setupHooks/installCargoArtifactsHook.sh @@ -1,11 +1,11 @@ -compressAndInstallCargoArtifactsDir() { +compressAndInstallCargoArtifactsDirFull() { local dir="${1:?destination directory not defined}" local cargoTargetDir="${2:?cargoTargetDir not defined}" mkdir -p "${dir}" local dest="${dir}/target.tar.zst" - echo "compressing ${cargoTargetDir} to ${dest}" + echo "compressing full content of ${cargoTargetDir} to ${dest}" ( export SOURCE_DATE_EPOCH=1 tar --sort=name \ @@ -19,14 +19,14 @@ compressAndInstallCargoArtifactsDir() { ) } -compressAndInstallCargoArtifactsDirIncremental() { +compressAndInstallCargoArtifactsDirDiff() { local dir="${1:?destination directory not defined}" local cargoTargetDir="${2:?cargoTargetDir not defined}" mkdir -p "${dir}" local dest="${dir}/target.tar.zst" - echo "compressing ${cargoTargetDir} to ${dest}" + echo "compressing new content of ${cargoTargetDir} to ${dest}" ( export SOURCE_DATE_EPOCH=1 touch -d @${SOURCE_DATE_EPOCH} "${TMPDIR}/.crane.source-date-epoch" @@ -92,15 +92,15 @@ prepareAndInstallCargoArtifactsDir() { # If no artifcats were inherited in the first place, # it's both faster and safer (mtime handlings bugs), to use # a full snapshot. - if [ -n "${cargoArtifacts}" ];then - compressAndInstallCargoArtifactsDir "${dir}" "${cargoTargetDir}" + if [ -z "${cargoArtifacts}" ];then + compressAndInstallCargoArtifactsDirFull "${dir}" "${cargoTargetDir}" else - compressAndInstallCargoArtifactsDirIncremental "${dir}" "${cargoTargetDir}" + compressAndInstallCargoArtifactsDirDiff "${dir}" "${cargoTargetDir}" fi ;; "use-zstd-full") - compressAndInstallCargoArtifactsDir "${dir}" "${cargoTargetDir}" + compressAndInstallCargoArtifactsDirFull "${dir}" "${cargoTargetDir}" ;; "use-symlink")