From 6e40891a6679bc0dd87af32d5e672180751987b9 Mon Sep 17 00:00:00 2001 From: Clayton Shotwell Date: Thu, 10 Feb 2022 17:23:27 -0600 Subject: [PATCH] support/download/helpers: adjust for older coreutils versions The -z option for head was only added in coreutils 8.25, but some older enterprise-grade distributions (e.g. the oldest still maintained RHEL 7) only have nothing more recent than coreutils 8.22. We fix that by using sed to remove everything that starts with the first NULL byte, \x00. Signed-off-by: Clayton Shotwell [yann.morin.1998@free.fr: hex is \xHH, not \xH, reword commit log] Signed-off-by: Yann E. MORIN --- support/download/helpers | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/support/download/helpers b/support/download/helpers index ab31e27a69..90a7d6c1ec 100755 --- a/support/download/helpers +++ b/support/download/helpers @@ -79,7 +79,7 @@ post_process_unpack() { mkdir "${dest}" tar -C "${dest}" --strip-components=1 -xzf "${tarball}" - one_file="$(find "${dest}" -type f -print0 |LC_ALL=C sort -z |head -z -n1 |tr -d "\0")" + one_file="$(find "${dest}" -type f -print0 |LC_ALL=C sort -z |sed 's/\x0.*//')" touch -r "${one_file}" "${dest}.timestamp" }