From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id SHCvEBmqEmKeGQAAgWs5BA (envelope-from ) for ; Sun, 20 Feb 2022 21:52:41 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id uGdzDRmqEmLDhAEAauVa8A (envelope-from ) for ; Sun, 20 Feb 2022 21:52:41 +0100 Received: from mail.notmuchmail.org (yantan.tethera.net [135.181.149.255]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id C00D53F50B for ; Sun, 20 Feb 2022 21:52:40 +0100 (CET) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 875B75E022; Sun, 20 Feb 2022 20:52:38 +0000 (UTC) Received: from lahtoruutu.iki.fi (lahtoruutu.iki.fi [IPv6:2a0b:5c81:1c1::37]) by mail.notmuchmail.org (Postfix) with ESMTPS id 6631F5E00C for ; Sun, 20 Feb 2022 20:52:35 +0000 (UTC) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: too) by lahtoruutu.iki.fi (Postfix) with ESMTPSA id 099811B0029D; Sun, 20 Feb 2022 22:52:34 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1645390354; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=t5zNSj91A3CJMen6H3wSwnqD7kA0QbfOUOUOfxkAb5I=; b=RNKK+2RBEmKC5r9r/GC202idHgByclcLsmHVkwIs433fnzTNZSN04boMVL5WDfR1YlLtd4 vo4OPDrFuVc3i1YUNs5gE6rec+DsdZTgYRlLYhak+HOW0DVzeXEUpFkN8a7yqmSZ6ftQI1 6MGYXmpNfRDX2tIX41ifJtuwKme4GHoPvTUrlvLQfKJYsCckr71CpAqmQuuzH7nTtqfZpk LIqeUveM7gcyCVCRuAEGBEnoTOTRWlTQhCkgBuy6kYwyMRuT/KJyDKDOXr8PDAvuN5a5DB kJKMkN6cKNx2RRJ2EQrf3uXTB5xVH4311/MqeeWnBiCwviUtcxcehnCKeUZG4w== From: Tomi Ollila To: notmuch@notmuchmail.org Subject: [PATCH 1/5] removed use of 'echo -n' (and echo -n -e ...) Date: Sun, 20 Feb 2022 22:52:30 +0200 Message-Id: <20220220205230.17446-1-tomi.ollila@iki.fi> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=too smtp.mailfrom=tomi.ollila@iki.fi ARC-Seal: i=1; s=lahtoruutu; d=iki.fi; t=1645390354; a=rsa-sha256; cv=none; b=UD0J0fcS5Ft8J8DikptrM8w3tqVc4TI5OW6tPuhn1TJe5aoNWtir8cH8NbnFOjJPLrHAQq JuDhwXjx/7vDobPb0bzkRLT7zuBzqdvU1FnwqtNAazuQhxN1Cv2P3F+yhUNTwtFmVJ3Cid 9i8tJzp4//WshAGsDp/a+MvVwiQ430BKgOICrCWDgD9xX2e2Ba79UscyWrawEiuK1I4akL MavZojYXwe5B/T2isX6KGgwsK5h30mmLVUvRN5+EoMuu7KprRQ4sRXwtV6YSWOs26xeC1Q u608nSOiY4kRqJ+fEJTlmJad/KR/vZ1IcHFfjfnidAnMhziONOaMiWZbHsa3Gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1645390354; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=t5zNSj91A3CJMen6H3wSwnqD7kA0QbfOUOUOfxkAb5I=; b=Odap7gCIHR4z+YEIj+5DyQarVGFFcxeLKBCXzDPY8908CIUdF/hhExwhD+Y1U60aQBqO08 BsMmayIipZihQSI4Dipnu63xKvi+SJ91kvcETu+x80HGekys/tbrUI445C/VBAUw/OaWpd zHfF2G2haoRnlhLZjNeT089+9y7IesGnU7wQ2KMQrUb23csXOV3w9b93TAXsJ68e6R+Otw z89VkJ3uqjEZcq/w+h/r8KTHlDz2wqUZ/vukSe56+Y5jmLHmqUM6Oi3++xD/RnAw0IRdY9 cXRxtGMGijN3ZGghy2QlTBvIXJljON+mt1ExsyAhqd/5AGJAIDSlQooHDRP8Ew== Message-ID-Hash: W7XYXJDDF5USWOT5IPTFTW7REOQSDK6T X-Message-ID-Hash: W7XYXJDDF5USWOT5IPTFTW7REOQSDK6T X-MailFrom: tomi.ollila@iki.fi X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN X-Migadu-Country: DE ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1645390361; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=OtVzh12jy5+FMLKV4lAqvUl6vpaR8BfaUc6Xe/g8y8E=; b=pQa/ZPOI4d5o8hcuDy4lKwZlTC6GWO8kHvOaiBNy+GKgcIIuQt3pQ4dQT21QGDIMIwBAEn yW80z40N1JC0wZJeAgBWFgjgAAtDtHQj+RmBfFXxLyOqof8vaTv8Irhg62YpOBAJCDrxuO tjeY1vz6fxIT/rDt8LYKsjok2xfd16YbvH+DOr5gr0RJYgbWV5Rdu2Oio0wxfnfIe9ddvD qhlttna2vEeMhqgC1sQ9Y+xxTBHF9UtPhYlCCEbHVfjQdnyJGucdUKMcaQqC019ayT8NAJ uE45mitKDUFeUJ5dChMa4p7xEKyrFKkJvN+Xl44rdOHyWJA3/AsJStj8Mr1lfA== ARC-Seal: i=2; s=key1; d=yhetil.org; t=1645390361; a=rsa-sha256; cv=fail; b=h7jJaL08KI1fP2R85bOZrU7J+avw6u/Pxq+csX56PxKDRPyhS1/spBcWOkAZiIZexTSN0t NFyuBFZcjdSsezs0x1ydLHd2K60P7miaWcgCB2RbdX4f63tKqnc9jIYne50pxyaX/bjEQt LGYF/XB0IGxtD4RKkjWB52xqn6q8Kd/3/CI4wjQpxtoHfMnZ71ZuDRC/zm+Pzogcb45L1X T9OneuwsF021k5cTFU3hf7Fo26yaCbphZue04Geg5BuaEADXP/ix42+VQ1UPL3xGHVZ7/L knkkDwDdVusJFtNPUILhNkcHQlmzDBntGzSbyxiqqxYhVZfI3DEfiZybEImbEw== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=iki.fi header.s=lahtoruutu header.b=RNKK+2RB; arc=reject ("signature check failed: fail, {[1] = sig:iki.fi:reject}"); dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: 0.65 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=iki.fi header.s=lahtoruutu header.b=RNKK+2RB; arc=reject ("signature check failed: fail, {[1] = sig:iki.fi:reject}"); dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: C00D53F50B X-Spam-Score: 0.65 X-Migadu-Scanner: scn1.migadu.com X-TUID: pxlZABdyPMvq 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 " " just merged to echo in previous line. --- Most of the changes went to release-checks.sh -- the one I've mostly written ;/ For anyone interested, dash printf "\xEF\x0D\x0A" would not work as expected (it can only output octal escapes). Initially I had that as printf %s $'\xEF\x0D\x0A' but it is as less portable (and it was hard to explain in commit message). Makefile.local | 5 ++--- devel/release-checks.sh | 20 ++++++++++---------- test/T090-search-output.sh | 2 +- test/T190-multipart.sh | 2 +- test/T380-atomicity.sh | 4 ++-- 5 files changed, 16 insertions(+), 17 deletions(-) diff --git a/Makefile.local b/Makefile.local index 10fb9908..abda9ff3 100644 --- a/Makefile.local +++ b/Makefile.local @@ -119,8 +119,7 @@ release-message: @echo "" @echo "Which can be verified with:" @echo "" - @echo " $(RELEASE_URL)/$(SHA256_FILE)" - @echo -n " " + @echo " $(RELEASE_URL)/$(SHA256_FILE) " @cat releases/$(SHA256_FILE) @echo "" @echo " $(RELEASE_URL)/$(DETACHED_SIG_FILE)" @@ -169,7 +168,7 @@ release-checks: .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." ;; \ diff --git a/devel/release-checks.sh b/devel/release-checks.sh index 23c29eaa..c0accf78 100755 --- a/devel/release-checks.sh +++ b/devel/release-checks.sh @@ -59,7 +59,7 @@ readonly VERSION # 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 @@ -77,7 +77,7 @@ verfail () 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" ;; @@ -88,7 +88,7 @@ case $VERSION in *) 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 @@ -98,7 +98,7 @@ else 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 @@ -108,7 +108,7 @@ else 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 @@ -118,7 +118,7 @@ else 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. @@ -132,7 +132,7 @@ else 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 @@ -142,7 +142,7 @@ else 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. @@ -154,7 +154,7 @@ fi #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` @@ -176,7 +176,7 @@ case $news_date in 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 diff --git a/test/T090-search-output.sh b/test/T090-search-output.sh index bf28d220..0d85c609 100755 --- a/test/T090-search-output.sh +++ b/test/T090-search-output.sh @@ -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 -echo -n >EXPECTED +: >EXPECTED test_expect_equal_file EXPECTED OUTPUT test_begin_subtest "search --format=json for non-existent message prints proper empty json" diff --git a/test/T190-multipart.sh b/test/T190-multipart.sh index 3545a599..d3b7f87c 100755 --- a/test/T190-multipart.sh +++ b/test/T190-multipart.sh @@ -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 -echo -n -e "\xEF\x0D\x0A" > crlf.expected +printf "\xEF\x0D\x0A" > crlf.expected test_expect_equal_file crlf.out crlf.expected diff --git a/test/T380-atomicity.sh b/test/T380-atomicity.sh index afe49d93..0f9e6d2e 100755 --- a/test/T380-atomicity.sh +++ b/test/T380-atomicity.sh @@ -71,8 +71,8 @@ if test_require_external_prereq gdb; then # 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 -- 2.34.1