@@ -408,19 +408,6 @@ else
408408 echo " Using ${EESSI_HOST_STORAGE} as tmp directory (to resume session add '--resume ${EESSI_HOST_STORAGE} ')."
409409fi
410410
411- # if ${RESUME} is a file, unpack it into ${EESSI_HOST_STORAGE}
412- if [[ ! -z ${RESUME} && -f ${RESUME} ]]; then
413- if [[ " ${RESUME} " == * .tgz ]]; then
414- tar xf ${RESUME} -C ${EESSI_HOST_STORAGE}
415- # Add support for resuming from zstd-compressed tarballs
416- elif [[ " ${RESUME} " == * .zst && -x " $( command -v zstd) " ]]; then
417- zstd -dc ${RESUME} | tar -xf - -C ${EESSI_HOST_STORAGE}
418- elif [[ " ${RESUME} " == * .zst && ! -x " $( command -v zstd) " ]]; then
419- fatal_error " Trying to resume from tarball ${RESUME} which was compressed using zstd, but zstd command not found"
420- fi
421- echo " Resuming from previous run using temporary storage ${RESUME} unpacked into ${EESSI_HOST_STORAGE} "
422- fi
423-
424411# if ${RESUME} is a file (assume a tgz), unpack it into ${EESSI_HOST_STORAGE}
425412if [[ ! -z ${RESUME} && -f ${RESUME} ]]; then
426413 tar xf ${RESUME} -C ${EESSI_HOST_STORAGE}
@@ -878,30 +865,17 @@ if [[ ! -z ${SAVE} ]]; then
878865 # ARCH which might have been used internally, eg, when software packages
879866 # were built ... we rather keep the script here "stupid" and leave the handling
880867 # of these aspects to where the script is used
881- # Compression with zlib may be quite slow. On some systems, the pipeline takes ~20 mins for a 2 min build because of this.
882- # Check if zstd is present for faster compression and decompression
883868 if [[ -d ${SAVE} ]]; then
884869 # assume SAVE is name of a directory to which tarball shall be written to
885870 # name format: tmp_storage-{TIMESTAMP}.tgz
886871 ts=$( date +%s)
887- if [[ -x " $( command -v zstd) " ]]; then
888- TARBALL=${SAVE} /tmp_storage-${ts} .zst
889- tar -cf - -C ${EESSI_TMPDIR} . | zstd -T0 > ${TARBALL}
890- else
891- TARBALL=${SAVE} /tmp_storage-${ts} .tgz
892- tar czf ${TARBALL} -C ${EESSI_TMPDIR} .
893- fi
872+ TGZ=${SAVE} /tmp_storage-${ts} .tgz
894873 else
895874 # assume SAVE is the full path to a tarball's name
896- TARBALL=${SAVE}
897- # if zstd is present and a .zst extension is asked for, use it
898- if [[ " ${SAVE} " == * .zst && -x " $( command -v zstd) " ]]; then
899- tar -cf - -C ${EESSI_TMPDIR} . | zstd -T0 > ${TARBALL}
900- else
901- tar czf ${TARBALL} -C ${EESSI_TMPDIR}
902- fi
875+ TGZ=${SAVE}
903876 fi
904- echo " Saved contents of tmp directory '${EESSI_TMPDIR} ' to tarball '${TARBALL} ' (to resume session add '--resume ${TARBALL} ')"
877+ tar czf ${TGZ} -C ${EESSI_TMPDIR} .
878+ echo " Saved contents of tmp directory '${EESSI_TMPDIR} ' to tarball '${TGZ} ' (to resume session add '--resume ${TGZ} ')"
905879fi
906880
907881# TODO clean up tmp by default? only retain if another option provided (--retain-tmp)
0 commit comments