From 635bcc83f2caf1e200081c0f7847708bd998a049 Mon Sep 17 00:00:00 2001 From: Thomas Levine <_@thomaslevine.com> Date: Thu, 31 Mar 2016 18:46:26 +0000 Subject: [PATCH] set LC_ALL for sort --- urchin | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/urchin b/urchin index 3b6b7ea..6e6003f 100755 --- a/urchin +++ b/urchin @@ -80,17 +80,6 @@ validate_test_arg() { fi } -sort_python() { - python -c 'import sys -for line in sorted(sys.stdin.readlines()): - sys.stdout.write(line) -' -} - -sort_perl() { - perl -e 'print sort (<>);' -} - # All temporary files go here urchin_tmp=$(mktemp -d) > "${urchin_tmp}/log" @@ -306,7 +295,7 @@ report_outcome() { # Use a temporary file rather than a pipe because a pipe starts a sub-shell # and thus makes the above variables local. sorted_log_file=$(mktemp) - cat "${log_file}" | "${sort}" > "${sorted_log_file}" + cat "${log_file}" | LC_ALL=POSIX sort > "${sorted_log_file}" while read line; do abspath=$(echo "${line}" | cut -f1) @@ -601,24 +590,6 @@ main() { fi fi - # Warn about strange sort commands - weird_string='@ b\n- d\n? a\n~ c\n! e\n' - sort_result="$(printf "${weird_string}" | sort | cut -d\ -f2 | tr -d '\n')" - if test "${sort_result}" = edacb; then - sort=sort - else - if which perl > /dev/null; then - sort=sort_perl - elif which python > /dev/null; then - sort=sort_python - else - echo 'Your version of sort sorts in dictionary order (-d) by default. - Depending on how you name your tests, your Urchin output may look strange. - If this is a problem, install BusyBox or BSD coreutils.' >&2 - sort=sort - fi - fi - if test -n "${urchin_timeout}"; then # Choose the timeout command if timeout -t 0 true; then