Commit 57399278 authored by Brad King's avatar Brad King

Port SourceTarball.bash to run on OS X

Create a compute_MD5 function to abstract the differences between
the Linux "md5sum" tool and the OS X "md5" tool.

Change-Id: I79fdb8347f99a17643a73179bb98dc8c671442b9
parent 360d6c73
......@@ -46,8 +46,20 @@ find_data_objects() {
return_pipe_status
}
if md5sum_type=$(type -p md5sum); then
compute_MD5() {
md5sum "$1" | sed 's/ .*//'
}
elif md5_type=$(type -p md5); then
compute_MD5() {
md5 "$1" | sed 's/.*= //'
}
else
die 'Neither "md5sum" nor "md5" tool is available.'
fi
validate_MD5() {
md5sum=$(md5sum "$1" | sed 's/ .*//') &&
md5sum=$(compute_MD5 "$1") &&
if test "$md5sum" != "$2"; then
die "Object MD5/$2 is corrupt: $1"
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