Skip to content

Commit

Permalink
chore: better names and messages to tell diff from full
Browse files Browse the repository at this point in the history
  • Loading branch information
dpc committed Sep 19, 2023
1 parent 91f63b0 commit 77091ad
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/setupHooks/installCargoArtifactsHook.sh
Original file line number Diff line number Diff line change
@@ -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 \
Expand All @@ -18,14 +18,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"
Expand Down Expand Up @@ -92,14 +92,14 @@ prepareAndInstallCargoArtifactsDir() {
# it's both faster and safer (mtime handlings bugs), to use
# a full snapshot.
if [ -n "${cargoArtifacts}" ];then
compressAndInstallCargoArtifactsDir "${dir}" "${cargoTargetDir}"
compressAndInstallCargoArtifactsDirFull "${dir}" "${cargoTargetDir}"
else
compressAndInstallCargoArtifactsDirIncremental "${dir}" "${cargoTargetDir}"
compressAndInstallCargoArtifactsDirDiff "${dir}" "${cargoTargetDir}"
fi
;;

"use-zstd-full")
compressAndInstallCargoArtifactsDir "${dir}" "${cargoTargetDir}"
compressAndInstallCargoArtifactsDirFull "${dir}" "${cargoTargetDir}"
;;

"use-symlink")
Expand Down

0 comments on commit 77091ad

Please sign in to comment.