Skip to content

Commit

Permalink
prefer gnu coreutils
Browse files Browse the repository at this point in the history
  • Loading branch information
goblinhack committed Jan 8, 2025
1 parent 29c1d26 commit fb87724
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ fi
unset UNAME

# Prefer gnu over freebsd coreutils
PATH=/opt/local/libexec/gnubin/head:$PATH
PATH=/opt/local/libexec/gnubin:$PATH

export PATH
log_info "Distro : $DISTRO"
Expand Down
2 changes: 1 addition & 1 deletion build/format.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# Prefer gnu over freebsd coreutils
PATH=/opt/local/libexec/gnubin/head:$PATH
PATH=/opt/local/libexec/gnubin:$PATH
export PATH

for i in *.cpp *.hpp
Expand Down
6 changes: 3 additions & 3 deletions build/shell_source.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#

# Prefer gnu over freebsd coreutils
PATH=/opt/local/libexec/gnubin/head:$PATH
PATH=/opt/local/libexec/gnubin:$PATH
export PATH

PRE=$(mktemp) || exit 1
Expand All @@ -30,10 +30,10 @@ 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
sed "/end shell marker${WHICH}/,\$!d" $IN | tail -n +2 - > $POST
cat $PRE > $OUT
cat $SHELL >> $OUT
sh $PAYLOAD >> $OUT
Expand Down
6 changes: 3 additions & 3 deletions build/tidy_source.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#

# Prefer gnu over freebsd coreutils
PATH=/opt/local/libexec/gnubin/head:$PATH
PATH=/opt/local/libexec/gnubin:$PATH
export PATH

PRE=$(mktemp) || exit 1
Expand All @@ -25,8 +25,8 @@ do
for WHICH in 1 2 3 4 5 6 7 8 9
do
sed "1,/begin sort marker${WHICH}/!d" $IN > $PRE
sed "/begin sort marker${WHICH}/,/end sort marker${WHICH}/!d" $IN | tail -n +1 | grep -v "sort marker" | sort > $PAYLOAD
sed "/end sort marker${WHICH}/,\$!d" $IN | tail -n +1 > $POST
sed "/begin sort marker${WHICH}/,/end sort marker${WHICH}/!d" $IN | tail -n +1 - | grep -v "sort marker" | sort > $PAYLOAD
sed "/end sort marker${WHICH}/,\$!d" $IN | tail -n +1 - > $POST
sort $PAYLOAD | uniq > $PAYLOAD.tmp
mv $PAYLOAD.tmp $PAYLOAD
cat $PRE $PAYLOAD $POST > $OUT
Expand Down

0 comments on commit fb87724

Please sign in to comment.