From: Tomi Ollila Date: Tue, 20 Aug 2013 16:16:43 +0000 (+0300) Subject: [PATCH 1/1] test: unset 'xpg_echo' bash shell option X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7b2b174546b7c5339b56779c0c8be527b560e5b9;p=notmuch-archives.git [PATCH 1/1] test: unset 'xpg_echo' bash shell option --- diff --git a/f4/6d41d3db0a31ad4b7abb489131a8ebd998a184 b/f4/6d41d3db0a31ad4b7abb489131a8ebd998a184 new file mode 100644 index 000000000..7344cfed4 --- /dev/null +++ b/f4/6d41d3db0a31ad4b7abb489131a8ebd998a184 @@ -0,0 +1,71 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 207D5431E62 + for ; Tue, 20 Aug 2013 09:16:54 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id P+x7spOiOjvY for ; + Tue, 20 Aug 2013 09:16:49 -0700 (PDT) +Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) + by olra.theworths.org (Postfix) with ESMTP id 9701D431FB6 + for ; Tue, 20 Aug 2013 09:16:49 -0700 (PDT) +Received: by guru.guru-group.fi (Postfix, from userid 501) + id 465F210009D; Tue, 20 Aug 2013 19:16:45 +0300 (EEST) +From: Tomi Ollila +To: notmuch@notmuchmail.org +Subject: [PATCH 1/1] test: unset 'xpg_echo' bash shell option +Date: Tue, 20 Aug 2013 19:16:43 +0300 +Message-Id: <1377015403-12457-1-git-send-email-tomi.ollila@iki.fi> +X-Mailer: git-send-email 1.8.0 +Cc: tomi.ollila@iki.fi +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Tue, 20 Aug 2013 16:16:54 -0000 + +When 'xpg_echo' bash shell option is unset (usually the default) +echo builtin does not expand backslash-escape sequences by default +(i.e. '\n' is echoed as '\n' instead of newline). Not all bash +installations have this feature we depend on activated by default. + +Note that the feature is bash (and GNU /bin/echo) specific. It is used +as it is convenient. If portability is needed (elsewhere) use printf(1) +(also often available as a shell builtin). +--- + test/test-lib.sh | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/test/test-lib.sh b/test/test-lib.sh +index ffab1bb..d3a8c58 100644 +--- a/test/test-lib.sh ++++ b/test/test-lib.sh +@@ -22,6 +22,9 @@ if [ ${BASH_VERSINFO[0]} -lt 4 ]; then + exit 1 + fi + ++# Make sure echo builtin does not expand backslash-escape sequences by default. ++shopt -u xpg_echo ++ + # if --tee was passed, write the output not only to the terminal, but + # additionally to the file test-results/$BASENAME.out, too. + case "$GIT_TEST_TEE_STARTED, $* " in +-- +1.8.0 +