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.
pull/6/head
Ryan Hitchman 2016-10-26 16:13:37 -07:00
parent e09fc6d5b9
commit 5e54fa72c6
3 changed files with 9 additions and 9 deletions

View File

@ -187,10 +187,10 @@ function kube::release::md5() {
} }
function kube::release::sha1() { function kube::release::sha1() {
if which shasum >/dev/null 2>&1; then if which sha1sum >/dev/null 2>&1; then
shasum -a1 "$1" | awk '{ print $1 }'
else
sha1sum "$1" | awk '{ print $1 }' sha1sum "$1" | awk '{ print $1 }'
else
shasum -a1 "$1" | awk '{ print $1 }'
fi fi
} }

View File

@ -817,10 +817,10 @@ EOF
} }
function sha1sum-file() { function sha1sum-file() {
if which shasum >/dev/null 2>&1; then if which sha1sum >/dev/null 2>&1; then
shasum -a1 "$1" | awk '{ print $1 }'
else
sha1sum "$1" | awk '{ print $1 }' sha1sum "$1" | awk '{ print $1 }'
else
shasum -a1 "$1" | awk '{ print $1 }'
fi fi
} }

View File

@ -104,10 +104,10 @@ function md5sum_file() {
} }
function sha1sum_file() { function sha1sum_file() {
if which shasum >/dev/null 2>&1; then if which sha1sum >/dev/null 2>&1; then
shasum -a1 "$1" | awk '{ print $1 }'
else
sha1sum "$1" | awk '{ print $1 }' sha1sum "$1" | awk '{ print $1 }'
else
shasum -a1 "$1" | awk '{ print $1 }'
fi fi
} }