From: Jeff King Date: Sat, 15 Mar 2008 00:32:33 +0000 (-0400) Subject: t6000lib: re-fix tr portability X-Git-Tag: v1.5.5-rc0~5^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=aab0abf7ef2c7636e3b37d4a939ae68784b08e06;p=git.git t6000lib: re-fix tr portability It seems that some implementations of tr don't like a replacement string of '-----...'; they try to find the double-dash option "---...". Instead of this pipeline of tr and sed invocations, just use a single perl invocation. Signed-off-by: Jeff King --- diff --git a/t/t6000lib.sh b/t/t6000lib.sh index b69f7c4d1..c0baaa536 100755 --- a/t/t6000lib.sh +++ b/t/t6000lib.sh @@ -97,10 +97,13 @@ check_output() # from front and back. name_from_description() { - tr "'" '-' | - tr '~`!@#$%^&*()_+={}[]|\;:"<>,/? ' \ - '------------------------------' | - tr -s '-' | tr '[A-Z]' '[a-z]' | sed "s/^-*//;s/-*\$//" + perl -pe ' + s/[^A-Za-z0-9.]/-/g; + s/-+/-/g; + s/-$//; + s/^-//; + y/A-Z/a-z/; + ' }