It turns out that missing features in FreeBSD sed are repeat patterns of "\? and \+. Test them in precheck.sh instead of running extractqqz.sh. Update FAQ-BUILD.txt accordingly. Signed-off-by: Akira Yokosawa <akiyks@xxxxxxxxx> --- FAQ-BUILD.txt | 2 +- utilities/precheck.sh | 18 ++++++------------ 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/FAQ-BUILD.txt b/FAQ-BUILD.txt index d9728acb0c9e..024f98bd4555 100644 --- a/FAQ-BUILD.txt +++ b/FAQ-BUILD.txt @@ -342,7 +342,7 @@ - GNU make - /usr/bin/env - date: format options of either GNU or BSD flavor - - sed: multi-line edit + - sed: repeat patterns \? and \+ - grep: -z option (optional) Among requirements above, features of date and sed are checked diff --git a/utilities/precheck.sh b/utilities/precheck.sh index 4d5c31a1d49c..7de0e9fba328 100755 --- a/utilities/precheck.sh +++ b/utilities/precheck.sh @@ -15,19 +15,15 @@ LC_TIME=C fatal="" -tmp_file_dir=$(mktemp -d) -tmp_file=$tmp_file_dir/precheck - -# test sed (multi-line edit) +# test sed (repeat pattern \? and \+) sed_result="" -sh utilities/extractqqz.sh < count/count.tex > $tmp_file 2> /dev/null -if grep -q -F "QuickQ{}" $tmp_file ; then +sed_out=`echo aaabbc | $SED -e 's/[ab]\+c\?//'` +if [ "$sed_out" = "" ] ; then sed_result="OK" else sed_result="NG" fatal="sed $fatal" fi -rm -f $tmp_file # test date (format conversion) date_result="" @@ -50,8 +46,6 @@ else fatal="date-format $fatal" fi -rm -rf $tmp_file_dir - if [ "$fatal" = "" -a "$VERBOSE" = "" ] ; then exit 0 fi @@ -63,9 +57,9 @@ echo "===========================================" if [ "$sed_result" != "OK" -o "$VERBOSE" != "" ] ; then echo - echo "------------------------------------------" - echo " testing sed (multi-line edit) " - echo "------------------------------------------" + echo '------------------------------------------' + echo ' testing sed (repeat patterns \? and \+) ' + echo '------------------------------------------' if [ "$sed_result" = "OK" ] ; then echo "OK." else -- 2.25.1