fix bsd shell negation
[gitweb.git] / t / t6000lib.sh
index b69f7c4d1100ec7254d32665040e282a2fa97c2a..c0baaa536079b1213d83bbf234ac688567c95237 100755 (executable)
@@ -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/;
+       '
 }