Skip to content

Commit f4e9fef

Browse files
committed
use tar's auto-compress option
1 parent 0ba48f7 commit f4e9fef

File tree

1 file changed

+1
-21
lines changed

1 file changed

+1
-21
lines changed

create_tarball.sh

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -115,27 +115,7 @@ fi
115115
topdir=${cvmfs_repo}/versions/
116116

117117
echo ">> Creating tarball ${target_tarball} from ${topdir}..."
118-
target_tarball_ext="${target_tarball##*.}"
119-
if [ "${target_tarball_ext}" = "zst" ]; then
120-
if [ -x "$(command -v zstd)" ]; then
121-
tar -cvf - -C ${topdir} --files-from=${files_list} | zstd -T0 > ${target_tarball}
122-
else
123-
echo "Zstd compression requested, but zstd command is not available." >&2
124-
exit 4
125-
fi
126-
elif [ "${target_tarball_ext}" = "gz" ]; then
127-
if [[ -x "$(command -v gzip)" ]]; then
128-
tar -czvf ${target_tarball} -C ${topdir} --files-from=${files_list}
129-
else
130-
echo "Gzip compression requested, but gzip command is not available." >&2
131-
exit 4
132-
fi
133-
elif [ "${target_tarball_ext}" = "tar" ]; then
134-
tar -cfv ${target_tarball} -C ${topdir} --files-from=${files_list}
135-
else
136-
echo "Unknown tarball type (${target_tarball_ext}) requested."
137-
exit 4
138-
fi
118+
tar cavf ${target_tgz} -C ${topdir} --files-from=${files_list}
139119
echo ${target_tarball} created!
140120

141121
echo ">> Cleaning up tmpdir ${tmpdir}..."

0 commit comments

Comments
 (0)