]> git.cworth.org Git - notmuch/commitdiff
removed use of 'echo -n' (and echo -n -e ...)
authorTomi Ollila <tomi.ollila@iki.fi>
Sun, 20 Feb 2022 22:30:45 +0000 (00:30 +0200)
committerDavid Bremner <david@tethera.net>
Mon, 21 Feb 2022 13:36:39 +0000 (09:36 -0400)
In most cases used printf %s ... instead.

echo -n > file  lines to create empty / truncate files were
changed to : > file lines, like done in in test-lib-emacs.sh

And one echo -n "  " replaced with use of sed "s/^/  /" in next line.

Makefile.local
devel/release-checks.sh
test/T090-search-output.sh
test/T190-multipart.sh
test/T380-atomicity.sh

index 10fb99085f54ff9f4f6fef73ae3e41e69dbcf6a4..8fb94b58689545faca793f6a69e105c88d23fcdd 100644 (file)
@@ -120,8 +120,7 @@ release-message:
        @echo "Which can be verified with:"
        @echo ""
        @echo "  $(RELEASE_URL)/$(SHA256_FILE)"
        @echo "Which can be verified with:"
        @echo ""
        @echo "  $(RELEASE_URL)/$(SHA256_FILE)"
-       @echo -n "  "
-       @cat releases/$(SHA256_FILE)
+       @sed "s/^/  /" releases/$(SHA256_FILE)
        @echo ""
        @echo "  $(RELEASE_URL)/$(DETACHED_SIG_FILE)"
        @echo "  (signed by `getent passwd "$$USER" | cut -d: -f 5 | cut -d, -f 1`)"
        @echo ""
        @echo "  $(RELEASE_URL)/$(DETACHED_SIG_FILE)"
        @echo "  (signed by `getent passwd "$$USER" | cut -d: -f 5 | cut -d, -f 1`)"
@@ -169,7 +168,7 @@ release-checks:
 
 .PHONY: verify-newer
 verify-newer:
 
 .PHONY: verify-newer
 verify-newer:
-       @echo -n "Checking that no $(VERSION) release already exists..."
+       @printf %s "Checking that no $(VERSION) release already exists..."
        @wget -q --no-check-certificate -O /dev/null $(RELEASE_URL)/$(TAR_FILE) ; \
        case $$? in \
           8) echo "Good." ;; \
        @wget -q --no-check-certificate -O /dev/null $(RELEASE_URL)/$(TAR_FILE) ; \
        case $$? in \
           8) echo "Good." ;; \
index 23c29eaafcdba5b37098cd4058fe53262be7b8da..c0accf78bf1fa3ae86ac2586c122dab9c1663499 100755 (executable)
@@ -59,7 +59,7 @@ readonly VERSION
 
 # In the rest of this file, tests collect list of errors to be fixed
 
 
 # In the rest of this file, tests collect list of errors to be fixed
 
-echo -n "Checking that git working directory is clean... "
+printf %s "Checking that git working directory is clean... "
 git_status=`git status --porcelain`
 if [ "$git_status" = '' ]
 then
 git_status=`git status --porcelain`
 if [ "$git_status" = '' ]
 then
@@ -77,7 +77,7 @@ verfail ()
        append_emsg "  Please follow the instructions in RELEASING to choose a version"
 }
 
        append_emsg "  Please follow the instructions in RELEASING to choose a version"
 }
 
-echo -n "Checking that '$VERSION' is good with digits and periods... "
+printf %s "Checking that '$VERSION' is good with digits and periods... "
 case $VERSION in
        *[!0-9.]*)
                verfail "'$VERSION' contains other characters than digits and periods" ;;
 case $VERSION in
        *[!0-9.]*)
                verfail "'$VERSION' contains other characters than digits and periods" ;;
@@ -88,7 +88,7 @@ case $VERSION in
        *)      verfail "'$VERSION' is a single number" ;;
 esac
 
        *)      verfail "'$VERSION' is a single number" ;;
 esac
 
-echo -n "Checking that this is Debian package for notmuch... "
+printf %s "Checking that this is Debian package for notmuch... "
 read deb_notmuch deb_version rest < debian/changelog
 if [ "$deb_notmuch" = 'notmuch' ]
 then
 read deb_notmuch deb_version rest < debian/changelog
 if [ "$deb_notmuch" = 'notmuch' ]
 then
@@ -98,7 +98,7 @@ else
        append_emsg "Package name '$deb_notmuch' is not 'notmuch' in debian/changelog"
 fi
 
        append_emsg "Package name '$deb_notmuch' is not 'notmuch' in debian/changelog"
 fi
 
-echo -n "Checking that Debian package version is $VERSION-1... "
+printf %s "Checking that Debian package version is $VERSION-1... "
 
 if [ "$deb_version" = "($VERSION-1)" ]
 then
 
 if [ "$deb_version" = "($VERSION-1)" ]
 then
@@ -108,7 +108,7 @@ else
        append_emsg "Version '$deb_version' is not '($VERSION-1)' in debian/changelog"
 fi
 
        append_emsg "Version '$deb_version' is not '($VERSION-1)' in debian/changelog"
 fi
 
-echo -n "Checking that python bindings version is $VERSION... "
+printf %s "Checking that python bindings version is $VERSION... "
 py_version=`python3 -c "with open('$PV_FILE') as vf: exec(vf.read()); print(__VERSION__)"`
 if [ "$py_version" = "$VERSION" ]
 then
 py_version=`python3 -c "with open('$PV_FILE') as vf: exec(vf.read()); print(__VERSION__)"`
 if [ "$py_version" = "$VERSION" ]
 then
@@ -118,7 +118,7 @@ else
        append_emsg "Version '$py_version' is not '$VERSION' in $PV_FILE"
 fi
 
        append_emsg "Version '$py_version' is not '$VERSION' in $PV_FILE"
 fi
 
-echo -n "Checking that NEWS header is tidy... "
+printf %s "Checking that NEWS header is tidy... "
 if [ "`exec sed 's/./=/g; 1q' NEWS`" = "`exec sed '1d; 2q' NEWS`" ]
 then
        echo Yes.
 if [ "`exec sed 's/./=/g; 1q' NEWS`" = "`exec sed '1d; 2q' NEWS`" ]
 then
        echo Yes.
@@ -132,7 +132,7 @@ else
        fi
 fi
 
        fi
 fi
 
-echo -n "Checking that this is Notmuch NEWS... "
+printf %s "Checking that this is Notmuch NEWS... "
 read news_notmuch news_version news_date < NEWS
 if [ "$news_notmuch" = "Notmuch" ]
 then
 read news_notmuch news_version news_date < NEWS
 if [ "$news_notmuch" = "Notmuch" ]
 then
@@ -142,7 +142,7 @@ else
        append_emsg "First word '$news_notmuch' is not 'Notmuch' in NEWS file"
 fi
 
        append_emsg "First word '$news_notmuch' is not 'Notmuch' in NEWS file"
 fi
 
-echo -n "Checking that NEWS version is $VERSION... "
+printf %s "Checking that NEWS version is $VERSION... "
 if [ "$news_version" = "$VERSION" ]
 then
        echo Yes.
 if [ "$news_version" = "$VERSION" ]
 then
        echo Yes.
@@ -154,7 +154,7 @@ fi
 #eval `date '+year=%Y mon=%m day=%d'`
 today0utc=`date --date=0Z +%s` # gnu date feature
 
 #eval `date '+year=%Y mon=%m day=%d'`
 today0utc=`date --date=0Z +%s` # gnu date feature
 
-echo -n "Checking that NEWS date is right... "
+printf %s "Checking that NEWS date is right... "
 case $news_date in
  '('[2-9][0-9][0-9][0-9]-[01][0-9]-[0123][0-9]')')
        newsdate0utc=`nd=${news_date#\\(}; date --date="${nd%)} 0Z" +%s`
 case $news_date in
  '('[2-9][0-9][0-9][0-9]-[01][0-9]-[0123][0-9]')')
        newsdate0utc=`nd=${news_date#\\(}; date --date="${nd%)} 0Z" +%s`
@@ -176,7 +176,7 @@ case $news_date in
 esac
 
 year=`exec date +%Y`
 esac
 
 year=`exec date +%Y`
-echo -n "Checking that copyright in documentation contains 2009-$year... "
+printf %s "Checking that copyright in documentation contains 2009-$year... "
 # Read the value of variable `copyright' defined in 'doc/conf.py'.
 copyrightline=$(grep ^copyright doc/conf.py)
 case $copyrightline in
 # Read the value of variable `copyright' defined in 'doc/conf.py'.
 copyrightline=$(grep ^copyright doc/conf.py)
 case $copyrightline in
index bf28d220a760515bfeeba06a7e2fa92d389ad42b..0d85c6097f31c4f5e7bdcce048e036d2a025ec06 100755 (executable)
@@ -435,7 +435,7 @@ test_expect_equal_file EXPECTED OUTPUT
 
 test_begin_subtest "search for non-existent message prints nothing"
 notmuch search "no-message-matches-this" > OUTPUT
 
 test_begin_subtest "search for non-existent message prints nothing"
 notmuch search "no-message-matches-this" > OUTPUT
-echo -n >EXPECTED
+: >EXPECTED
 test_expect_equal_file EXPECTED OUTPUT
 
 test_begin_subtest "search --format=json for non-existent message prints proper empty json"
 test_expect_equal_file EXPECTED OUTPUT
 
 test_begin_subtest "search --format=json for non-existent message prints proper empty json"
index 3545a59998e91ef5537ef0473eb876d860260072..d3b7f87cc32ea321f03fc520b9eb02fc3e278e90 100755 (executable)
@@ -683,7 +683,7 @@ test_expect_equal_json "$(cat OUTPUT)" "$(cat EXPECTED)"
 
 test_begin_subtest "'notmuch show --part' does not corrupt a part with CRLF pair"
 notmuch show --format=raw --part=3 id:base64-part-with-crlf > crlf.out
 
 test_begin_subtest "'notmuch show --part' does not corrupt a part with CRLF pair"
 notmuch show --format=raw --part=3 id:base64-part-with-crlf > crlf.out
-echo -n -e "\xEF\x0D\x0A" > crlf.expected
+printf "\xEF\x0D\x0A" > crlf.expected
 test_expect_equal_file crlf.out crlf.expected
 
 
 test_expect_equal_file crlf.out crlf.expected
 
 
index afe49d93d5f005fc57a76cb076814783e895ec6f..0f9e6d2e2bc4169127304d75669adabf2f557e2f 100755 (executable)
@@ -71,8 +71,8 @@ if test_require_external_prereq gdb; then
 
     # Check output against golden output
     outcount=$(cat outcount)
 
     # Check output against golden output
     outcount=$(cat outcount)
-    echo -n > searchall
-    echo -n > expectall
+    : > searchall
+    : > expectall
     for ((i = 0; i < $outcount; i++)); do
        if ! cmp -s search.$i expected; then
            # Find the range of interruptions that match this output
     for ((i = 0; i < $outcount; i++)); do
        if ! cmp -s search.$i expected; then
            # Find the range of interruptions that match this output