@@ -104,12 +104,19 @@ if [[ ! ${maven_repo_id} =~ ${STAGING_REGEX} ]]; then
104104fi
105105maven_repo_id=" ${BASH_REMATCH[1]} "
106106
107+ fatal_reported=0
108+ finished=0
109+
107110run_id=" polaris-release-verify-$( date " +%Y-%m-%d-%k-%M-%S" ) "
108111temp_dir=" $( mktemp --tmpdir --directory " ${run_id} -XXXXXXXXX" ) "
109112function purge_temp_dir {
110113 if [[ $keep_temp_dir -eq 0 ]] ; then
111- echo " Purging ${temp_dir} ..."
112- rm -rf " ${temp_dir} "
114+ if [[ $fatal_reported -eq 0 && $finished -eq 1 ]] ; then
115+ echo " Purging ${temp_dir} ..."
116+ rm -rf " ${temp_dir} "
117+ else
118+ echo " ⚠ NOT purging temporary directory ${temp_dir} - errors were reported!"
119+ fi
113120 else
114121 echo " Leaving ${temp_dir} around, you may want to purge it."
115122 fi
@@ -173,7 +180,8 @@ function log_part_end {
173180}
174181
175182function log_fatal {
176- echo -n -e " ${RED} "
183+ fatal_reported=1
184+ echo -n -e " ❌ ${RED} "
177185 echo -n " $1 "
178186 echo -e " ${RESET} "
179187 echo " " >> " ${failures_file} "
@@ -183,7 +191,7 @@ function log_fatal {
183191}
184192
185193function log_warn {
186- echo -ne " ${ORANGE} "
194+ echo -ne " ⚠ ${ORANGE} "
187195 echo -n " $1 "
188196 echo -e " ${RESET} "
189197}
@@ -311,16 +319,22 @@ function report_mismatch {
311319 * .tar.gz | * .tgz | * .tar)
312320 mkdir " ${local_file} .extracted" " ${repo_file} .extracted"
313321 tar --warning=no-timestamp -xf " ${local_file} " --directory " ${local_file} .extracted" || true
322+ log_info " extracted to ${local_file} .extracted"
314323 tar --warning=no-timestamp -xf " ${repo_file} " --directory " ${repo_file} .extracted" || true
324+ log_info " extracted to ${repo_file} .extracted"
315325 if proc_exec " ${title} " diff --recursive " ${local_file} .extracted" " ${repo_file} .extracted" ; then
316326 # Dump tar listing only when the contents are equal (to inspect mtime and posix attributes)
317327 log_warn " ${title} "
318328 (
319329 echo " ${title} " # log_warn above prints ANSI escape sequences
330+ tar --warning=no-timestamp -tvf " ${local_file} " > " ${local_file} .contents-listing" || true
331+ tar --warning=no-timestamp -tvf " ${repo_file} " > " ${repo_file} .contents-listing" || true
332+ echo " Diff of archives contents:"
333+ diff " ${local_file} .contents-listing" " ${repo_file} .contents-listing"
320334 echo " >>>>>>>>>>>>>>> tar tvf ${local_file} "
321- tar --warning=no-timestamp -tvf " ${local_file} " || true
335+ cat " ${local_file} .contents-listing "
322336 echo " >>>>>>>>>>>>>>> tar tvf ${repo_file} "
323- tar --warning=no-timestamp -tvf " ${repo_file} " || true
337+ cat " ${repo_file} .contents-listing "
324338 echo " "
325339 ) >> " ${failures_file} "
326340 fi
@@ -484,7 +498,7 @@ log_part_start "Comparing helm chart artifacts"
484498mkdir -p " ${helm_work_dir} /local" " ${helm_work_dir} /staged"
485499# Prerequisite for reproducible helm packages: file modification time must be deterministic
486500# Works with helm since version 4.0.0
487- exec_process find " ${worktree_dir} /helm/polaris" -exec touch -d " 1980-01-01 00:00:00" {} +
501+ find " ${worktree_dir} /helm/polaris" -exec touch -d " 1980-01-01 00:00:00" {} +
488502proc_exec " Helm packaging failed" helm package --destination " ${helm_work_dir} " " ${worktree_dir} /helm/polaris"
489503helm_package_file=" polaris-${version} .tgz"
490504tar --warning=no-timestamp -xf " ${helm_dir} /${helm_package_file} " --directory " ${helm_work_dir} /staged" || true
@@ -544,3 +558,5 @@ The contents of all LICENSE and NOTICE files however MUST be verified manually.
544558
545559!
546560fi
561+
562+ finished=1
0 commit comments