From e5bee6a6aaa1e5be2a45b16526f65d4ed6b0d8fe Mon Sep 17 00:00:00 2001
From: Jakob Unterwurzacher
Date: Thu, 16 Feb 2017 19:09:54 +0100
Subject: tests: OSX compat: use OSX-style "stat -f"

Reported at https://github.com/rfjakob/gocryptfs/issues/15#issuecomment-279130217
---
 tests/dl-linux-tarball.bash | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tests/dl-linux-tarball.bash b/tests/dl-linux-tarball.bash
index 9fd8534..5c08b04 100755
--- a/tests/dl-linux-tarball.bash
+++ b/tests/dl-linux-tarball.bash
@@ -8,7 +8,12 @@ TGZ=/tmp/linux-3.0.tar.gz
 SIZE_WANT=96675825
 SIZE_ACTUAL=0
 if [[ -e $TGZ ]]; then
-	SIZE_ACTUAL=$(stat -c %s $TGZ)
+	if [[ $OSTYPE == linux* ]] ; then
+		SIZE_ACTUAL=$(stat -c %s $TGZ)
+	else
+		# Mac OS X
+		SIZE_ACTUAL=$(stat -f %z $TGZ)
+	fi
 fi
 
 if [[ $SIZE_ACTUAL -ne $SIZE_WANT ]]; then
-- 
cgit v1.2.3