# HG changeset patch # User Juan Francisco Cantero Hurtado # Date 1558459394 -7200 # Node ID f221313157917b8e3304689a165c8f05db9b8111 # Parent 1bc7d4cb41825016525d8f6d4cb78e218b3ea08f tests: make the grep pattern in remotefilelog-gcrepack portable (issue6122) test-remotefilelog-gcrepack was using "\" to escape "|" in the grep pattern. The most of implementations ignore "\" when it is followed by "|", so the regex works. However, OpenBSD doesn't ignore "\" and considers "|" part of the text instead of create two branches. Neither of both behaviors violate POSIX. This change removes the unnecessary escape character and changes grep to egrep, so the extended regular expression works on every unix. This is part of the bug 6122. Tested on OpenBSD, GNU, FreeBSD, NetBSD, Solaris 11 and BusyBox. Credits to Todd C. Miller, Paul de Weerd and Ingo Schwarze for helping me with it. diff -r 1bc7d4cb4182 -r f22131315791 tests/test-remotefilelog-gcrepack.t --- a/tests/test-remotefilelog-gcrepack.t Mon May 20 16:12:27 2019 -0700 +++ b/tests/test-remotefilelog-gcrepack.t Tue May 21 19:23:14 2019 +0200 @@ -43,7 +43,7 @@ $ sleep 0.5 $ hg debugwaitonrepack >/dev/null 2>%1 - $ find $CACHEDIR | sort | grep ".datapack\|.histpack" + $ find $CACHEDIR | sort | egrep ".datapack|.histpack" $TESTTMP/hgcache/master/packs/7bcd2d90b99395ca43172a0dd24e18860b2902f9.histpack $TESTTMP/hgcache/master/packs/dc8f8fdc76690ce27791ce9f53a18da379e50d37.datapack @@ -76,7 +76,7 @@ $ sleep 0.5 $ hg debugwaitonrepack >/dev/null 2>%1 - $ find $CACHEDIR | sort | grep ".datapack\|.histpack" + $ find $CACHEDIR | sort | egrep ".datapack|.histpack" $TESTTMP/hgcache/master/packs/7bcd2d90b99395ca43172a0dd24e18860b2902f9.histpack $TESTTMP/hgcache/master/packs/a4e1d094ec2aee8a08a4d6d95a13c634cc7d7394.datapack @@ -104,7 +104,7 @@ $ sleep 0.5 $ hg debugwaitonrepack >/dev/null 2>%1 - $ find $CACHEDIR | sort | grep ".datapack\|.histpack" + $ find $CACHEDIR | sort | egrep ".datapack|.histpack" $TESTTMP/hgcache/master/packs/7bcd2d90b99395ca43172a0dd24e18860b2902f9.histpack $TESTTMP/hgcache/master/packs/dc8f8fdc76690ce27791ce9f53a18da379e50d37.datapack @@ -138,7 +138,7 @@ $ sleep 0.5 $ hg debugwaitonrepack >/dev/null 2>%1 - $ find $CACHEDIR | sort | grep ".datapack\|.histpack" + $ find $CACHEDIR | sort | egrep ".datapack|.histpack" $TESTTMP/hgcache/master/packs/7bcd2d90b99395ca43172a0dd24e18860b2902f9.histpack $TESTTMP/hgcache/master/packs/dc8f8fdc76690ce27791ce9f53a18da379e50d37.datapack