]> git.ipfire.org Git - thirdparty/make.git/commitdiff
Convert [ ... ] to test ... in scripting.
authorPaul Smith <psmith@gnu.org>
Sun, 3 May 2020 17:39:55 +0000 (13:39 -0400)
committerPaul Smith <psmith@gnu.org>
Sun, 3 May 2020 18:23:56 +0000 (14:23 -0400)
The "[" link may be missing during OS boostrapping.

* build.sh: Convert "[ ... ]" to "test ..."
* maintMakefile: Ditto.
* scripts/copyright-update: Ditto
* tests/scripts/features/reinvoke: Ditto
* tests/scripts/features/targetvars: Ditto

build.sh
maintMakefile
scripts/copyright-update
tests/scripts/features/reinvoke
tests/scripts/features/targetvars

index 4c88b53473ad9e8c15b27cfc07453f411eb197cf..cc1c7909ebfd852470ce55b5d1dea05ed249139e 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -103,7 +103,7 @@ convert ()
     esac
 
     fn="$top_srcdir/lib/${fn##*/}"
-    [ -f "$fn" ] || { echo "Missing file: $fn"; exit 1; }
+    test -f "$fn" || { echo "Missing file: $fn"; exit 1; }
 
     sed "/definitions* of $inc/r $fn" "$int" > "${int}_"
     int=${int}_
index 119a901ca6d4d0b328d6ed71cc4fb9d8d2c3ab5d..dc4616db6f04f0a250b3234640c4949c50e051f5 100644 (file)
@@ -140,7 +140,7 @@ ChangeLog: .check-git-HEAD
 .PHONY: .check-git-HEAD
 .check-git-HEAD:
        sha="`git rev-parse HEAD`"; \
-       [ -f '$@' ] && [ "`cat '$@' 2>/dev/null`" = "$$sha" ] \
+       test -f '$@' && [ "`cat '$@' 2>/dev/null`" = "$$sha" ] \
            || echo "$$sha" > '$@'
 
 
@@ -187,7 +187,7 @@ do-po-update:
        $(MAKE) po-check
 
 po-update:
-       [ -d "po" ] && $(MAKE) do-po-update
+       test -d "po" && $(MAKE) do-po-update
 
 # -------------------------- #
 # Updating GNU build files.  #
@@ -385,16 +385,16 @@ gnuweb-dir = www/server/standards
 
 # Get the GNU make web page boilerplate etc.
 update-makeweb:
-       [ -d '$(MAKEWEBDIR)' ] || mkdir -p '$(MAKEWEBDIR)'
-       [ -d '$(MAKEWEBDIR)'/CVS ] \
+       test -d '$(MAKEWEBDIR)' || mkdir -p '$(MAKEWEBDIR)'
+       test -d '$(MAKEWEBDIR)'/CVS \
            && { cd '$(MAKEWEBDIR)' && $(CVS) update; } \
            || { mkdir -p '$(dir $(MAKEWEBDIR))' && cd '$(dir $(MAKEWEBDIR))' \
                 && $(CVS) -d $(makeweb-repo) co -d '$(notdir $(MAKEWEBDIR))' make; }
 
 # Get the GNU web page boilerplate etc.
 update-gnuweb:
-       [ -d '$(GNUWEBDIR)' ] || mkdir -p '$(GNUWEBDIR)'
-       [ -d '$(GNUWEBDIR)/$(gnuweb-dir)'/CVS ] \
+       test -d '$(GNUWEBDIR)' || mkdir -p '$(GNUWEBDIR)'
+       test -d '$(GNUWEBDIR)/$(gnuweb-dir)'/CVS \
            && { cd '$(GNUWEBDIR)/$(gnuweb-dir)' && $(CVS) update; } \
            || { cd '$(GNUWEBDIR)' && $(CVS) -d $(gnuweb-repo) co '$(gnuweb-dir)'; }
 
@@ -446,8 +446,8 @@ $(COV_BUILD_FILE): $(filter %.c %.h,$(DISTFILES))
 cov-submit: $(COV_BUILD_FILE)-submitted
 
 $(COV_BUILD_FILE)-submitted: $(COV_BUILD_FILE)
-       @[ -n "$(COVERITY_TOKEN)" ] || { echo 'COVERITY_TOKEN not set'; exit 1; }
-       @[ -n "$(COVERITY_EMAIL)" ] || { echo 'COVERITY_EMAIL not set'; exit 1; }
+       @test -n "$(COVERITY_TOKEN)" || { echo 'COVERITY_TOKEN not set'; exit 1; }
+       @test -n "$(COVERITY_EMAIL)" || { echo 'COVERITY_EMAIL not set'; exit 1; }
        rm -f '$@'
        case '$(VERSION)' in \
            (*.*.9*) type="daily build"; ext=".$$(date +%Y%m%d)" ;; \
index 6728fd9fd3c7572372c8e2b681f25942e4ef7111..5a0ddd2c85db86041081a495618f05ef537aa1a2 100755 (executable)
@@ -17,7 +17,7 @@ getfiles () {
 
 run () {
     cmd=$(command -v "$update") || die "Cannot locate update-copyright ($update)"
-    [ -x "$cmd" ] || die "Cannot locate update-copyright ($update)"
+    test -x "$cmd" || die "Cannot locate update-copyright ($update)"
 
     force=false
 
@@ -30,9 +30,9 @@ run () {
 
     if $force; then
         : just do it
-    elif [ ! -f src/makeint.h ]; then
+    elif test ! -f src/makeint.h; then
         die "Run in the root of the GNU make workspace"
-    elif [ -f configure ]; then
+    elif test -f configure; then
         die "Run in a clean workspace (git clean -fdX)"
     fi
 
index d2a1f50ca78229005e85e7f12e149854a592bf8b..657f6c9b57c4f99188f6b748acaa7c7e816c5df8 100644 (file)
@@ -45,17 +45,17 @@ all: ; @echo hello
 
 a : b ; echo >> $@
 
-b : c ; [ -f $@ ] || echo >> $@
+b : c ; test -f $@ || echo >> $@
 
 c: ; echo >> $@
 
 include $(F)',
-              'F=a', "[ -f b ] || echo >> b\nhello\n");
+              'F=a', "test -f b || echo >> b\nhello\n");
 
 # Now try with the file we're not updating being the actual file we're
 # including: this and the previous one test different parts of the code.
 
-run_make_test(undef, 'F=b', "[ -f b ] || echo >> b\nhello\n");
+run_make_test(undef, 'F=b', "test -f b || echo >> b\nhello\n");
 
 &rmfiles('a','b','c');
 
index edc90b81381b9b078b8ce81e44fe1c823b490157..66c7ce2d3bcb0f430ba2d79e13a5638f8d72924f 100644 (file)
@@ -183,7 +183,7 @@ run_make_test(undef, 'foo PATTERN=yes', "ok ok foo pat\nok ok foo pat\n");
 # (> make default buffer length)
 
 run_make_test('
-base_metals_fmd_reports.sun5 base_metals_fmd_reports CreateRealPositions        CreateMarginFunds deals_changed_since : BUILD_OBJ=$(shell if [ -f               "build_information.generate" ]; then echo "$(OBJ_DIR)/build_information.o"; else echo "no build information"; fi  )
+base_metals_fmd_reports.sun5 base_metals_fmd_reports CreateRealPositions        CreateMarginFunds deals_changed_since : BUILD_OBJ=$(shell if test -f               "build_information.generate"   ; then echo "$(OBJ_DIR)/build_information.o"; else echo "no build information"; fi  )
 
 deals_changed_since: ; @echo $(BUILD_OBJ)
 ',