Commit 5e54fa72 authored by Ryan Hitchman's avatar Ryan Hitchman

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.
parent e09fc6d5
...@@ -187,10 +187,10 @@ function kube::release::md5() { ...@@ -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
} }
......
...@@ -817,10 +817,10 @@ EOF ...@@ -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
} }
......
...@@ -104,10 +104,10 @@ function md5sum_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
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment