git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Avoid problem with xpg4 grep in Solaris that broke t9400

From
Ben Walton <bwalton@artsci.utoronto.ca>
Date
Apr 9, 2012, 20:13 UTC
Message-ID
<1334002409-5708-1-git-send-email-bwalton@artsci.utoronto.ca>

The grep in Solaris' /usr/xpg4/bin as found by the default SANE_TOOL_PATH was not properly handling the 'cvs co -c (shows module database)' test. The [\t ] character set selection does not properly trigger so the first grep in the test fails.

Instead of working around this issue, switch to using the standard test_cmp() shell function to perform the comparison instead.

Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
---

It's possible that the specific pair of grep statements is required. It's looking for tab or space, so maybe we get either character in some cases, depending on cvs version? This passed the test suite using cvs 1.12.13 for OpenCSW.

If there is a reason for the original construction, I'll find a more creative work around for this problem.

 t/t9400-git-cvsserver-server.sh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/t/t9400-git-cvsserver-server.sh b/t/t9400-git-cvsserver-server.sh
index 9199550..df1405f 100755
--- a/t/t9400-git-cvsserver-server.sh
+++ b/t/t9400-git-cvsserver-server.sh
@@ -500,8 +500,8 @@ test_expect_success 'cvs status (no subdirs in header)' '
 cd "$WORKDIR"
 test_expect_success 'cvs co -c (shows module database)' '
     GIT_CONFIG="$git_config" cvs co -c > out &&
-    grep "^master[	 ]\+master$" < out &&
-    ! grep -v "^master[	 ]\+master$" < out
+    echo "master	master" > out.expected &&
+    test_cmp out out.expected
 '
 
 #------------
-- 
1.7.9
Next: Ben Walton
Message 1 of 5 in “Avoid problem with xpg4 grep in Solaris that broke t9400”
  1. Avoid problem with xpg4 grep in Solaris that broke t9400Ben Walton, Apr 9, 2012
  2. Ben WaltonApr 14, 2012
  3. Junio C HamanoApr 19, 2012
  4. Ben WaltonApr 19, 2012
  5. Junio C HamanoApr 19, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.