Skip to content

Commit e5bb92d

Browse files
committed
scripts/template_dir: Add support for use on Mac OS
* On MacOS use 'md5' instead of 'md5sum' * Skip readlink check on Mac OS - it doesn't support the -m option Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
1 parent 10c58ba commit e5bb92d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

scripts/template_dir

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ verify_os () {
3333
case "$(uname -s)" in
3434

3535
Darwin)
36-
echo 'OS X is not supported!'
37-
exit 1
36+
MD5=md5
37+
os=macos
3838
;;
3939

40-
# Linux, the only supported OS
41-
4240
Linux)
41+
MD5=md5sum
42+
os=linux
4343
#echo 'Linux'
4444
;;
4545

@@ -162,9 +162,9 @@ do_cmake_package()
162162
{
163163
ZEPHYR_SDK_REGISTRY_DIR=$HOME/.cmake/packages/Zephyr-sdk
164164

165-
type md5sum
165+
type $MD5
166166
if [ $? -eq 0 ]; then
167-
reg_file=$ZEPHYR_SDK_REGISTRY_DIR/`echo -n $target_sdk_dir | md5sum | cut -d' ' -f1`
167+
reg_file=$ZEPHYR_SDK_REGISTRY_DIR/`echo -n $target_sdk_dir | $MD5 | cut -d' ' -f1`
168168

169169
if [ -e $reg_file ]; then
170170
# The install dir is already in CMake package registry so simply return.
@@ -240,7 +240,7 @@ fi
240240
eval target_sdk_dir=$(echo "$target_sdk_dir"|sed 's/ /\\ /g')
241241
if [ -d "$target_sdk_dir" ]; then
242242
target_sdk_dir=$(cd "$target_sdk_dir"; pwd)
243-
else
243+
elif [ $os = "linux" ]; then
244244
target_sdk_dir=$(readlink -m "$target_sdk_dir")
245245
fi
246246

0 commit comments

Comments
 (0)