git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Ben Walton <bdwalton@gmail.com>
To: gitster@pobox.com
Cc: git@vger.kernel.org, sunshine@sunshineco.com, j6t@kdbg.org,
	johannes.schindelin@gmx.de, Ben Walton <bdwalton@gmail.com>
Subject: [PATCH 3/3] Fix sed usage in tests to work around broken xpg4/sed on Solaris
Date: Sun, 19 Jul 2015 19:00:36 +0100	[thread overview]
Message-ID: <1437328836-19156-4-git-send-email-bdwalton@gmail.com> (raw)
In-Reply-To: <1437328836-19156-1-git-send-email-bdwalton@gmail.com>

In 99094a7a, a trivial && breakage was fixed. This exposed a problem
with the test when run on Solaris with xpg4/sed that had gone silently
undetected since its introduction in e4bd10b2. Solaris' sed executes
the requested substitution but prints a warning about the missing
newline at the end of the file and exits with status 2.

% echo "CHANGE_ME" | \
tr -d "\\012" | /usr/xpg4/bin/sed -e 's/CHANGE_ME/change_me/'
sed: Missing newline at end of file standard input.
change_me
% echo $?
2

To work around this, use perl to perform the substitution instead.

Signed-off-by: Ben Walton <bdwalton@gmail.com>
---
 t/t9500-gitweb-standalone-no-errors.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb-standalone-no-errors.sh
index e94b2f1..a7383fa 100755
--- a/t/t9500-gitweb-standalone-no-errors.sh
+++ b/t/t9500-gitweb-standalone-no-errors.sh
@@ -290,7 +290,7 @@ test_expect_success 'setup incomplete lines' '
 	echo "incomplete" | tr -d "\\012" >>file &&
 	git commit -a -m "Add incomplete line" &&
 	git tag incomplete_lines_add &&
-	sed -e s/CHANGE_ME/change_me/ <file >file+ &&
+	perl -pne "s/CHANGE_ME/change_me/" file >file+ &&
 	mv -f file+ file &&
 	git commit -a -m "Incomplete context line" &&
 	git tag incomplete_lines_ctx &&
-- 
2.1.4

  parent reply	other threads:[~2015-07-19 17:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-19 18:00 Adapt some tests to work around broken Solaris tools Ben Walton
2015-07-19 18:00 ` [PATCH 1/3] Modify tr expressions so that xpg4/tr handles it on Solaris Ben Walton
2015-07-19 21:49   ` Eric Sunshine
2015-07-19 18:00 ` [PATCH 2/3] Fix sed usage in tests to work around broken xpg4/sed " Ben Walton
2015-07-19 18:00 ` Ben Walton [this message]
2015-07-19 20:22   ` [PATCH 3/3] " Johannes Sixt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1437328836-19156-4-git-send-email-bdwalton@gmail.com \
    --to=bdwalton@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=j6t@kdbg.org \
    --cc=johannes.schindelin@gmx.de \
    --cc=sunshine@sunshineco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).