diff options
author | Theo Buehler <tb@cvs.openbsd.org> | 2017-01-24 03:22:14 +0000 |
---|---|---|
committer | Theo Buehler <tb@cvs.openbsd.org> | 2017-01-24 03:22:14 +0000 |
commit | 0eea3ae7f82702b205f84f96264af26b00c26daa (patch) | |
tree | 0cd331d265ddccbfd9c2a16bf351cad50a5e7986 /share/mk | |
parent | 4ea2da54d661f05c5ef211ca79133e2c9450e205 (diff) |
Modernize and unify test idioms for the sake of readability and
consistency. Done jointly with rpe.
ok deraadt, phessler, rpe;
also looks good to guenther despite a slight change in semantics
Diffstat (limited to 'share/mk')
-rw-r--r-- | share/mk/bsd.obj.mk | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/share/mk/bsd.obj.mk b/share/mk/bsd.obj.mk index d03c74e5d4b..d2c028280ee 100644 --- a/share/mk/bsd.obj.mk +++ b/share/mk/bsd.obj.mk @@ -1,4 +1,4 @@ -# $OpenBSD: bsd.obj.mk,v 1.18 2017/01/24 02:56:50 tb Exp $ +# $OpenBSD: bsd.obj.mk,v 1.19 2017/01/24 03:22:13 tb Exp $ # $NetBSD: bsd.obj.mk,v 1.9 1996/04/10 21:08:05 thorpej Exp $ .if !target(obj) @@ -33,20 +33,19 @@ obj! _SUBDIRUSE SETOWNER=:; \ fi; \ [[ -z $$MKDIRS ]] && MKDIRS="mkdir -p"; \ - if test $$here != $$subdir ; then \ + if [[ $$here != $$subdir ]]; then \ dest=${BSDOBJDIR}/$$subdir ; \ echo "$$here/${__objdir} -> $$dest"; \ - if test ! -L ${__objdir} -o \ - X`readlink ${__objdir}` != X$$dest; \ + if [[ ! -L ${__objdir} || `readlink ${__objdir}` != $$dest ]]; \ then \ - if test -e ${__objdir}; then rm -rf ${__objdir}; fi; \ + [[ -e ${__objdir} ]] && rm -rf ${__objdir}; \ ln -sf $$dest ${__objdir}; \ $$SETOWNER ${__objdir}; \ fi; \ - if test -d ${BSDOBJDIR}; then \ - test -d $$dest || $$MKDIRS $$dest; \ + if [[ -d ${BSDOBJDIR} ]]; then \ + [[ -d $$dest ]] || $$MKDIRS $$dest; \ else \ - if test -e ${BSDOBJDIR}; then \ + if [[ -e ${BSDOBJDIR} ]]; then \ echo "${BSDOBJDIR} is not a directory"; \ else \ echo "${BSDOBJDIR} does not exist"; \ @@ -54,7 +53,7 @@ obj! _SUBDIRUSE fi; \ else \ dest=$$here/${__objdir} ; \ - if test ! -d ${__objdir} ; then \ + if [[ ! -d ${__objdir} ]]; then \ echo "making $$dest" ; \ $$MKDIRS $$dest; \ $$SETOWNER $$dest; \ |