From 2ff0ed504d48ac1f17cca489f187d9399d9402df Mon Sep 17 00:00:00 2001 From: John Zhao Date: Wed, 16 May 2018 16:56:02 +0800 Subject: [PATCH] Update md5sum.sh --- tools/checksum/md5sum.sh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/tools/checksum/md5sum.sh b/tools/checksum/md5sum.sh index 2e2a2d7..99ec4e4 100755 --- a/tools/checksum/md5sum.sh +++ b/tools/checksum/md5sum.sh @@ -21,16 +21,24 @@ source "$SCRIPTS_DIR/common/echo.sh" source "$SCRIPTS_DIR/common/host.sh" if [ "$HOST_OS" = "Linux" ]; then - MD5SUM="md5sum" + _md5sum() { md5sum "$1"; } elif [ "$HOST_OS" = "Mac" ]; then - MD5SUM="md5 -q" + _md5sum() { md5 -q "$1"; } +elif [ "$HOST_OS" = "Win" ]; then + _md5sum() { certutil -hashfile "$1" MD5; } else # unexpected _echo_e "Unknown host os :(" exit 1 fi +PYTHON="python" +if [ "$HOST_OS" = "Win" ]; then + # default python on MSYS + PYTHON="python2" +fi + _get_size() { -PYTHON_ARG="$1" python - <