Skip to content

Commit

Permalink
makesure_stable should not be changed before the release #60
Browse files Browse the repository at this point in the history
  • Loading branch information
xonixx committed Sep 29, 2021
1 parent ddc8bd1 commit ecdee4a
Show file tree
Hide file tree
Showing 4 changed files with 625 additions and 26 deletions.
43 changes: 22 additions & 21 deletions Makesurefile
Original file line number Diff line number Diff line change
Expand Up @@ -99,45 +99,46 @@
@goal @glob tests/*.tush @private
@depends_on prepared4tests
@use_lib testing_tush
MAKESURE=makesure \
MAKESURE=makesure_dev \
run_tush_file "$ITEM"

@goal tested_candidate @glob tests/*.tush @private
@depends_on prepared4tests
@depends_on candidate_version_prepared
@use_lib testing_tush
MAKESURE=makesure_candidate \
run_tush_file "$ITEM"

@goal candidate
@doc rebuilds makesure_candidate & README.md for release
@depends_on makesure_candidate
@doc compiles makesure_candidate
@depends_on tested_candidate

@goal README.md @private
@doc compiles release version of README.md
awk '
/^\$ \.\/makesure -h$/ { print; stop=1; system("./makesure_candidate -h") }
/^\$ \.\/makesure -h$/ { print; stop=1; system("./makesure -h") }
/^```$/ { stop=0 }
!stop' README.md > README.md.1
mv README.md.1 README.md

@goal makesure_candidate @private
@doc compiles makesure_candidate
@depends_on tested
@depends_on candidate_version_prepared
@depends_on tested_candidate

#TODO ^V this should be more pure
@goal candidate_version_prepared @private
@depends_on tested
F=makesure_candidate
{
echo '#!/bin/sh'
echo "if command -v gawk >/dev/null;then AWK='gawk -ltime -v Gawk=1'; X='';else AWK=awk; X='function gettimeofday(){}';fi"
echo "exec \$AWK -v \"Version=$NEXT_VERSION\" -v \"Prog=\$0\" '"
# We use A, not AWK because otherwise it clashes with AWK set for tests
echo "if command -v gawk >/dev/null;then A='gawk -ltime -v Gawk=1'; X='';else A=awk; X='function gettimeofday(){}';fi"
echo 'exec $A -v "Version='$NEXT_VERSION'" -v "Prog=$0" "$X"'\'
awk -v Q=\' '
function trim(s) { sub(/^[ \t\r\n]+/, "", s); sub(/[ \t\r\n]+$/, "", s); return s }
/^BEGIN/ { in_begin=1 }
in_begin && /^}/ { in_begin=0 }
in_begin && $1 ~ /^split/ { next }
/^function gettimeofday/ { next }
{ gsub("\\s*#.+$", ""); gsub(Q, Q "\\" Q Q); if (trim($0)) print}' makesure.awk
echo \''"$X" Makesurefile "$@"'
} > makesure_candidate
echo \'' Makesurefile "$@"'
} > "$F"
chmod +x "$F"

@goal default
@doc calls 'tested' goal
Expand All @@ -154,30 +155,30 @@ in_begin && $1 ~ /^split/ { next }

@goal tested_bwk @private
@depends_on installed_bwk
AWK="$(pwd)/soft/bwk" ./makesure tested
AWK="$(pwd)/soft/bwk" ./makesure_dev tested

@goal tested_mawk134 @private
@depends_on installed_mawk134
AWK="$(pwd)/soft/mawk134" ./makesure tested
AWK="$(pwd)/soft/mawk134" ./makesure_dev tested

@goal tested_gawk51 @private
@depends_on installed_gawk51
AWK="$(pwd)/soft/gawk51" ./makesure tested
AWK="$(pwd)/soft/gawk51" ./makesure_dev tested

@goal tested_goawk @private
@depends_on installed_goawk
AWK="$(pwd)/soft/$GOAWK" ./makesure tested
AWK="$(pwd)/soft/$GOAWK" ./makesure_dev tested

@goal tested_mawk @private
if [[ -x /usr/bin/mawk ]]
then
AWK="/usr/bin/mawk" ./makesure tested
AWK="/usr/bin/mawk" ./makesure_dev tested
else
echo "No default mawk... Skipped testing it."
fi

#@goal tested_busybox
# AWK="busybox awk" ./makesure tested
# AWK="busybox awk" ./makesure_dev tested

@goal installed_awks
@doc installs all awks into ./soft
Expand Down
Loading

0 comments on commit ecdee4a

Please sign in to comment.