From 7fbe69bfa67ad7794d58c113be84093dc8b76d5a Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Fri, 17 Feb 2017 19:41:29 +0100 Subject: [PATCH] tests.bash: OSX compat: use "flock -n" and skip openssl build Mac OS X flock does not support "--nonblock", but does support "-n": https://github.com/discoteq/flock/blob/master/man/flock.1.ronn Skip the openssl build because it requires 1) openssl 2) fixing the import paths in gocryptfs Reported at https://github.com/rfjakob/gocryptfs/issues/15#issuecomment-280464400 --- test.bash | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test.bash b/test.bash index e1046c4..664ca42 100755 --- a/test.bash +++ b/test.bash @@ -12,7 +12,7 @@ mkdir -p $TESTDIR ( # Prevent multiple parallel test.bash instances as this causes # all kinds of mayham -if ! flock --nonblock 200 ; then +if ! flock -n 200 ; then echo "Could not acquire lock on $LOCKFILE - already running?" exit 1 fi @@ -25,7 +25,10 @@ for i in $(mount | grep $TESTDIR | cut -f3 -d" "); do done source build-without-openssl.bash -source build.bash +# Building with openssl is difficult on OSX, so only do it on Linux. +if [[ $OSTYPE == linux* ]] ; then + source build.bash +fi if go tool | grep vet > /dev/null ; then go tool vet -all -shadow .