commit b467608409a4d13280330af54d6d4432c6cc31eb
parent 75fbb89c079525429202de5e0be61c1304c65c6a
Author: Georges Dupéron <georges.duperon@gmail.com>
Date: Sat, 21 Jul 2018 16:00:50 +0200
macos does not have readlink command, but has realpath
Diffstat:
4 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/test/virtualbox.sh b/test/virtualbox.sh
@@ -9,7 +9,7 @@ os_filename="$1"
vbox_dir="$(./utils/mktemp.sh -d)"
vmname="automatic-os-test-$(date +%s)-$$"
-ln -sf "$(readlink -f "$os_filename")" "build/virtualbox.img"
+ln -sf "$(./utils/absolute-path.sh "$os_filename")" "build/virtualbox.img"
VBoxManage createvm --name "$vmname" --register --basefolder "$vbox_dir"
VBoxManage modifyvm "$vmname" --hwvirtex off
VBoxManage modifyvm "$vmname" --nestedpaging off
diff --git a/utils/absolute-path.sh b/utils/absolute-path.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+set -e
+
+if test $# -ne 1 || test "$1" = "-h" -o "$1" = "--help"; then
+ echo "Usage: $0 [/]absolute/or/relative/path"
+fi
+
+case "$1" in
+ /*) echo "$1";;
+ *) echo "$PWD/$1";;
+esac
diff --git a/utils/auto-push.sh b/utils/auto-push.sh
@@ -65,7 +65,7 @@ else
eval `ssh-agent -s`
ssh-add ~/.ssh/travis-deploy-key-id_rsa
- travis_known_hosts="$(realpath "$(dirname "$0")/travis_known_hosts")"
+ travis_known_hosts="$("$(dirname "$0")/absolute-path.sh" "$(dirname "$0")/travis_known_hosts")"
chmod 600 "$travis_known_hosts"
echo "$travis_known_hosts"
cat "$travis_known_hosts"
diff --git a/utils/gui-wrapper-mac.sh b/utils/gui-wrapper-mac.sh
@@ -5,7 +5,7 @@ set -e
resolution="$1" # e.g. 800x600x24 (width x height x bits_per_pixel)
shift # the following arguments are the program to execute and its arguments
-bg="$(realpath "build/checkerboard_$(echo "$resolution" | cut -d 'x' -f1-2).png")"
+bg="$(./utils/absolute-path.sh "build/checkerboard_$(echo "$resolution" | cut -d 'x' -f1-2).png")"
anim="$(./utils/mktemp.sh -d)"
echo "$anim $resolution $@"