summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2008-03-15 00:32:33 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-03-15 00:53:22 (GMT)
commitaab0abf7ef2c7636e3b37d4a939ae68784b08e06 (patch)
tree604861f31e47bd9259033851864d0287e5a0191b
parent462f8caf248178121ef705dd1b6980eb3b846833 (diff)
downloadgit-aab0abf7ef2c7636e3b37d4a939ae68784b08e06.zip
git-aab0abf7ef2c7636e3b37d4a939ae68784b08e06.tar.gz
git-aab0abf7ef2c7636e3b37d4a939ae68784b08e06.tar.bz2
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 <peff@peff.net>
-rwxr-xr-xt/t6000lib.sh11
1 files changed, 7 insertions, 4 deletions
diff --git a/t/t6000lib.sh b/t/t6000lib.sh
index b69f7c4..c0baaa5 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/;
+ '
}