From 5e54fa72c66ea5b4ed5149ba64fa408784f7cf4f Mon Sep 17 00:00:00 2001 From: Ryan Hitchman Date: Wed, 26 Oct 2016 16:13:37 -0700 Subject: [PATCH] Prefer sha1sum (C) to shasum (Perl). This should avoid spamming build-log.txt with messages like: perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = (unset), LC_ALL = (unset), LANG = "en_US.UTF-8" are supported and installed on your system. perl: warning: Falling back to the standard locale ("C"). OSX has shasum but not sha1sum, which is part of GNU coreutils. --- build-tools/lib/release.sh | 6 +++--- cluster/common.sh | 6 +++--- cluster/get-kube-binaries.sh | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/build-tools/lib/release.sh b/build-tools/lib/release.sh index 35e3a28d231..280e248715c 100644 --- a/build-tools/lib/release.sh +++ b/build-tools/lib/release.sh @@ -187,10 +187,10 @@ function kube::release::md5() { } function kube::release::sha1() { - if which shasum >/dev/null 2>&1; then - shasum -a1 "$1" | awk '{ print $1 }' - else + if which sha1sum >/dev/null 2>&1; then sha1sum "$1" | awk '{ print $1 }' + else + shasum -a1 "$1" | awk '{ print $1 }' fi } diff --git a/cluster/common.sh b/cluster/common.sh index 3df52867fa3..c4be510641b 100755 --- a/cluster/common.sh +++ b/cluster/common.sh @@ -817,10 +817,10 @@ EOF } function sha1sum-file() { - if which shasum >/dev/null 2>&1; then - shasum -a1 "$1" | awk '{ print $1 }' - else + if which sha1sum >/dev/null 2>&1; then sha1sum "$1" | awk '{ print $1 }' + else + shasum -a1 "$1" | awk '{ print $1 }' fi } diff --git a/cluster/get-kube-binaries.sh b/cluster/get-kube-binaries.sh index 92acb286572..7fa7dd3c80f 100755 --- a/cluster/get-kube-binaries.sh +++ b/cluster/get-kube-binaries.sh @@ -104,10 +104,10 @@ function md5sum_file() { } function sha1sum_file() { - if which shasum >/dev/null 2>&1; then - shasum -a1 "$1" | awk '{ print $1 }' - else + if which sha1sum >/dev/null 2>&1; then sha1sum "$1" | awk '{ print $1 }' + else + shasum -a1 "$1" | awk '{ print $1 }' fi }