From 2511a92d178a4285cd26e9eb7923a355e1c1ec2d Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Mon, 5 Dec 2016 01:32:14 -0500 Subject: [PATCH] dockcross: Check if "/proc/version" exists and fix error on MacOSX. Fixes #94 This commit will avoid the following error from being reported on MacOSX: ``` docker run --rm dockcross/linux-armv7 > ./dockcross-linux-armv7 chmod +x ./dockcross-linux-armv7 ./dockcross-linux-armv7 bash -c '$CC test/C/hello.c -o hello_arm' grep: /proc/version: No such file or directory grep: /proc/version: No such file or directory ``` Reported-by: Chris Warth --- imagefiles/dockcross | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imagefiles/dockcross b/imagefiles/dockcross index 1776c52..2dcebb5 100755 --- a/imagefiles/dockcross +++ b/imagefiles/dockcross @@ -172,9 +172,9 @@ fi FINAL_ARGS=${ARG_ARGS-${DOCKCROSS_ARGS}} # Bash on Ubuntu on Windows -UBUNTU_ON_WINDOWS=$(grep -l Microsoft /proc/version) +UBUNTU_ON_WINDOWS=$([ -e /proc/version ] && grep -l Microsoft /proc/version || echo "") # MSYS, Git Bash, etc. -MSYS=$(grep -l MINGW /proc/version) +MSYS=$([ -e /proc/version ] && grep -l MINGW /proc/version || echo "") if [ -z "$UBUNTU_ON_WINDOWS" -a -z "$MSYS" ]; then USER_IDS="-e BUILDER_UID=$( id -u ) -e BUILDER_GID=$( id -g ) -e BUILDER_USER=$( id -un ) -e BUILDER_GROUP=$( id -gn )"