From b670f762322a67377d49fb285ddd915eb31de4f0 Mon Sep 17 00:00:00 2001 From: Eric Paris Date: Wed, 19 Oct 2016 09:47:21 -0400 Subject: [PATCH] Use LC_ALL=C with sort In some user env LANG=C might lose: Wrong: ``` echo -e "test/images/port-forward-tester\ntest/images/porter" | LANG=C sort test/images/porter test/images/port-forward-tester ``` Right: ``` echo -e "test/images/port-forward-tester\ntest/images/porter" | LC_ALL=C sort test/images/port-forward-tester test/images/porter ``` --- hack/verify-golint.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hack/verify-golint.sh b/hack/verify-golint.sh index eb1ebe8c395..74242ac3d58 100755 --- a/hack/verify-golint.sh +++ b/hack/verify-golint.sh @@ -39,12 +39,12 @@ array_contains () { # Check that the file is in alphabetical order linted_file="${KUBE_ROOT}/hack/.linted_packages" -if ! diff -u "${linted_file}" <(LANG=C sort "${linted_file}"); then +if ! diff -u "${linted_file}" <(LC_ALL=C sort "${linted_file}"); then { echo echo "hack/.linted_packages is not in alphabetical order. Please sort it:" echo - echo " LANG=C sort -o hack/.linted_packages hack/.linted_packages" + echo " LC_ALL=C sort -o hack/.linted_packages hack/.linted_packages" echo } >&2 false @@ -104,7 +104,7 @@ else for p in "${linted[@]}"; do echo " echo $p >> hack/.linted_packages" done - echo " LANG=C sort -o hack/.linted_packages hack/.linted_packages" + echo " LC_ALL=C sort -o hack/.linted_packages hack/.linted_packages" echo echo 'You can test via this script and commit the result.' echo