From 39a00ab7d5e11144329450a677b4e6940601e83b Mon Sep 17 00:00:00 2001 From: "Steffen \"Daode\" Nurpmeso" Date: Sat, 4 Jan 2014 17:57:05 +0100 Subject: [PATCH] conf.rc,mk-conf.sh+: NetBSD sh(1) can't 'command -pv' (Ypnose) --- cc-test.sh | 17 ++++++++++------- conf.rc | 2 +- mk-conf.sh | 26 +++++++++++++------------- 3 files changed, 24 insertions(+), 21 deletions(-) diff --git a/cc-test.sh b/cc-test.sh index fd292b95..2031a121 100755 --- a/cc-test.sh +++ b/cc-test.sh @@ -6,14 +6,17 @@ CONF=./conf.rc BODY=./.cc-body.txt MBOX=./.cc-test.mbox -awk=`command -pv awk` -cat=`command -pv cat` -cksum=`command -pv cksum` -MAKE="${MAKE:-`command -pv make`}" -rm=`command -pv rm` +awk=`command -v awk` +cat=`command -v cat` +cksum=`command -v cksum` +MAKE="${MAKE:-`command -v make`}" +rm=`command -v rm` +sed=`command -v sed` ## -- >8 -- 8< -- ## +export NAIL CONF BODY MBOX awk cat cksum MAKE rm sed + # NOTE! UnixWare 7.1.4 gives ISO-10646-Minimum-European-Subset for # nl_langinfo(CODESET), then, so also overwrite ttycharset. # (In addition this setup allows us to succeed on TinyCore 4.4 that has no @@ -77,8 +80,8 @@ cc_all_configs() { cksum_test() { tid=$1 f=$2 s=$3 printf "${tid}: " - csum="`sed -e '/^From /d' -e '/^Date: /d' \ - -e '/^ boundary=/d' -e '/^--=_/d' < \"${f}\" | cksum`"; + csum="`${sed} -e '/^From /d' -e '/^Date: /d' \ + -e '/^ boundary=/d' -e '/^--=_/d' < \"${f}\" | ${cksum}`"; if [ "${csum}" = "${s}" ]; then printf 'ok\n' else diff --git a/conf.rc b/conf.rc index 4ab7f8aa..1b36caa1 100644 --- a/conf.rc +++ b/conf.rc @@ -190,7 +190,7 @@ XLISTER=ls # $PAGER, which would effectively cause this setting to be ignored) XPAGER=more -# The following tools may be provided a.k.a. overwritten, `command -pv NAME` +# The following tools may be provided a.k.a. overwritten, `command -v NAME` # is used to query the utility otherwise: # MAKE=, STRIP=, awk=, cat=, chmod=, cp=, cmp=, grep=, mkdir=, mv=, tee= # rm=, sed= diff --git a/mk-conf.sh b/mk-conf.sh index f9a9d1a9..d011ccf7 100644 --- a/mk-conf.sh +++ b/mk-conf.sh @@ -179,8 +179,8 @@ check_tool() { } # Check those tools right now that we need before including ${conf} -check_tool rm "${rm:-`command -pv rm`}" -check_tool sed "${sed:-`command -pv sed`}" +check_tool rm "${rm:-`command -v rm`}" +check_tool sed "${sed:-`command -v sed`}" # Only incorporate what wasn't overwritten from command line / CONFIG trap "${rm} -f ${tmp}; exit" 1 2 15 @@ -198,19 +198,19 @@ while read line; do done > ${tmp} . ./${tmp} -check_tool awk "${awk:-`command -pv awk`}" -check_tool cat "${cat:-`command -pv cat`}" -check_tool chmod "${chmod:-`command -pv chmod`}" -check_tool cp "${cp:-`command -pv cp`}" -check_tool cmp "${cmp:-`command -pv cmp`}" -check_tool grep "${grep:-`command -pv grep`}" -check_tool mkdir "${mkdir:-`command -pv mkdir`}" -check_tool mv "${mv:-`command -pv mv`}" +check_tool awk "${awk:-`command -v awk`}" +check_tool cat "${cat:-`command -v cat`}" +check_tool chmod "${chmod:-`command -v chmod`}" +check_tool cp "${cp:-`command -v cp`}" +check_tool cmp "${cmp:-`command -v cmp`}" +check_tool grep "${grep:-`command -v grep`}" +check_tool mkdir "${mkdir:-`command -v mkdir`}" +check_tool mv "${mv:-`command -v mv`}" # rm(1), sed(1) above -check_tool tee "${tee:-`command -pv tee`}" +check_tool tee "${tee:-`command -v tee`}" -check_tool make "${MAKE:-`command -pv make`}" -check_tool strip "${STRIP:-`command -pv strip`}" 1 +check_tool make "${MAKE:-`command -v make`}" +check_tool strip "${STRIP:-`command -v strip`}" 1 HAVE_STRIP=${?} wantfeat() { -- 2.11.4.GIT