Add modifications to support Cygwin.

I don't know while FILEDIR includes "..", so I removed it...
Otherwise the changes should not affect Linux users, but please review.
 - Legacy-Id: 17486
This commit is contained in:
Valery Smyslov 2020-03-21 17:41:20 +00:00
parent 88f11669fd
commit f89dd2da7b

View file

@ -79,11 +79,17 @@ longopts=download-data,help,ietfdb-url=,mysqldata=,no-mysqldir,port=,docker-repo
# Default values
MYSQLDIR=$parent/data/mysql
FILEDIR=$parent/../data/
MYSQLDIR=$(echo $MYSQLDIR | sed -e 's/^\/cygdrive\/\(.\)/\1:/')
#FILEDIR=$parent/../data/
FILEDIR=$parent/data/
PORT=8000
REPO="ietf/datatracker-environment"
DBURL=https://www.ietf.org/lib/dt/sprint/ietf_utf8.bin.tar.bz2
WHO=$(whoami)
WHO=$(echo $WHO | sed -e 's/^.*\\//' | tr -d \\r)
WHOUID=$(id -u $WHO)
WHOGID=$(id -g $WHO)
@ -120,7 +126,9 @@ while true ; do
done
if [ -z "$TAG" ]; then
TAG=$(basename $(svn info $parent | grep ^URL | awk '{print $2}'))
# TAG=$(basename $(svn info $parent | grep ^URL | awk '{print $2}'))
TAG=$(basename $(svn info | grep ^URL | awk '{print $2}'))
TAG=$(echo $TAG | tr -d \\r)
fi
# ----------------------------------------------------------------------
@ -133,13 +141,17 @@ if [ "$(uname)" = "Darwin" ]; then
CMD="open -a"
elif [ "$(uname)" = "Linux" ]; then
echo "Running on Linux."
elif [ "$(uname)" = "CYGWIN_NT-10.0" ]; then
echo "Running on Cygwin."
HOME=$(echo $USERPROFILE | sed -e 's/\\/\//g')
echo "Using home dir $HOME"
else
die "This script does not have support for your architecture ($(uname)); sorry :-("
fi
if [ "$(uname)" = "Linux" ]; then
echo "Not trying to start a virtual docker machine on Linux"
elif [ -e "$APP" ]; then
elif [ -e "$APP" -o "$(uname)" = "CYGWIN_NT-10.0" ]; then
info=$(docker info 2>&1 || true)
if ! docker info 1> /dev/null 2>&1; then
echo -e "The docker VM doesn't seem to be running; docker info gave:\n $info"