Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] support/download/post-process-helpers: adjust for older coreutils versions
@ 2022-02-10 23:23 Clayton Shotwell
  2022-02-11 17:12 ` Yann E. MORIN
  0 siblings, 1 reply; 2+ messages in thread
From: Clayton Shotwell @ 2022-02-10 23:23 UTC (permalink / raw)
  To: buildroot; +Cc: Clayton Shotwell, Yann E . MORIN, Thomas Petazzoni, Matt Weber

From: Clayton Shotwell <clayton.shotwell@collins.com>

Ran into an issue with the post_process_unpack function using "head -z"
on a RHEL box which is using an older version or coreutils. The "-z"
flag was added in coreutils v8.25 but my IT managed RHEL box is only
using v8.22. The fix I have implemented relies on the null terminated
list and sed to remove the first null character and everthing
afterwards.

Signed-off-by: Clayton Shotwell <clayton.shotwell@collins.com>
---
 support/download/helpers | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/support/download/helpers b/support/download/helpers
index ab31e27..90a7d6c 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"
 }
 
-- 
1.8.3.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-02-11 17:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-10 23:23 [Buildroot] [PATCH] support/download/post-process-helpers: adjust for older coreutils versions Clayton Shotwell
2022-02-11 17:12 ` Yann E. MORIN

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox