From 29c1d26497ac1b723a9ee6eb000f28403deb24ea Mon Sep 17 00:00:00 2001 From: Neil McGill Date: Wed, 8 Jan 2025 19:52:07 +0000 Subject: [PATCH] prefer gnu coreutils --- build/build.sh | 4 ++++ build/format.sh | 5 +++++ build/shell_source.sh | 6 +++++- build/tidy_source.sh | 4 ++++ 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/build/build.sh b/build/build.sh index c3c40e2..6b652cc 100755 --- a/build/build.sh +++ b/build/build.sh @@ -50,6 +50,10 @@ fi [ "$DISTRO" == "" ] && export DISTRO=$UNAME unset UNAME +# Prefer gnu over freebsd coreutils +PATH=/opt/local/libexec/gnubin/head:$PATH + +export PATH log_info "Distro : $DISTRO" help_full() diff --git a/build/format.sh b/build/format.sh index 1da4a4f..10b30ef 100755 --- a/build/format.sh +++ b/build/format.sh @@ -1,4 +1,9 @@ #!/bin/bash + +# Prefer gnu over freebsd coreutils +PATH=/opt/local/libexec/gnubin/head:$PATH +export PATH + for i in *.cpp *.hpp do case $i in diff --git a/build/shell_source.sh b/build/shell_source.sh index dcb9f36..152ce56 100755 --- a/build/shell_source.sh +++ b/build/shell_source.sh @@ -5,6 +5,10 @@ # Use "do" as the first arg if the output looks sane. # +# Prefer gnu over freebsd coreutils +PATH=/opt/local/libexec/gnubin/head:$PATH +export PATH + PRE=$(mktemp) || exit 1 PAYLOAD=$(mktemp) || exit 1 SHELL=$(mktemp) || exit 1 @@ -26,7 +30,7 @@ do continue fi - sed "1,/begin shell marker${WHICH}/!d" $IN | head -n -1 - > $PRE + sed "1,/begin shell marker${WHICH}/!d" $IN | head -n -1 > $PRE sed "/begin shell marker${WHICH}/,/end shell marker${WHICH}/!d" $IN | grep "\* shell" | sed -e 's/\/\* shell //g' -e 's/\*\/$//g' > $PAYLOAD sed "/begin shell marker${WHICH}/,/end shell marker${WHICH}/!d" $IN | grep "shell" | grep -v "end shell marker${WHICH}" > $SHELL sed "/end shell marker${WHICH}/,\$!d" $IN | tail -n +2 > $POST diff --git a/build/tidy_source.sh b/build/tidy_source.sh index 370d6aa..b453a41 100755 --- a/build/tidy_source.sh +++ b/build/tidy_source.sh @@ -5,6 +5,10 @@ # Use "do" as the first arg if the output looks sane. # +# Prefer gnu over freebsd coreutils +PATH=/opt/local/libexec/gnubin/head:$PATH +export PATH + PRE=$(mktemp) || exit 1 PAYLOAD=$(mktemp) || exit 1 POST=$(mktemp) || exit 1