Merge pull request #35656 from rmmh/sha1sum

Automatic merge from submit-queue

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.
This commit is contained in:
Kubernetes Submit Queue 2016-10-26 22:32:36 -07:00 committed by GitHub
commit e233f14ad5
3 changed files with 9 additions and 9 deletions

View File

@ -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
}

View File

@ -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
}

View File

@ -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
}