/js/lib/Socket.IO-node/support/expresso/deps/jscoverage/js/build/cygwin-wrapper
Shell | 75 lines | 55 code | 8 blank | 12 comment | 11 complexity | 2799f4759d9e3e480293124309a84573 MD5 | raw file
1#!/bin/sh 2# 3# Stupid wrapper to avoid win32 dospath/cygdrive issues 4# Try not to spawn programs from within this file. If the stuff in here looks royally 5# confusing, see bug: http://bugzilla.mozilla.org/show_bug.cgi?id=206643 6# and look at the older versions of this file that are easier to read, but 7# do basically the same thing 8# 9 10prog=$1 11shift 12if test -z "$prog"; then 13 exit 0 14fi 15 16# If $CYGDRIVE_MOUNT was not set in configure, give $mountpoint the results of mount -p 17mountpoint=$CYGDRIVE_MOUNT 18if test -z "$mountpoint"; then 19 mountpoint=`mount -p` 20 if test -z "$mountpoint"; then 21 print "Cannot determine cygwin mount points. Exiting" 22 exit 1 23 fi 24fi 25 26# Delete everything but "/cygdrive" (or other mountpoint) from mount=`mount -p` 27mountpoint=${mountpoint#*/} 28mountpoint=/${mountpoint%%[!A-Za-z0-9_]*} 29mountpoint=${mountpoint%/} 30 31args="" 32up="" 33if test "${prog}" = "-up"; then 34 up=1 35 prog=${1} 36 shift 37fi 38 39process=1 40 41# Convert the mountpoint in parameters to Win32 filenames 42# For instance: /cygdrive/c/foo -> c:/foo 43for i in "${@}" 44do 45 if test "${i}" = "-wrap"; then 46 process=1 47 else 48 if test "${i}" = "-nowrap"; then 49 process= 50 else 51 if test -n "${process}"; then 52 if test -n "${up}"; then 53 pathname=${i#-I[a-zA-Z]:/} 54 if ! test "${pathname}" = "${i}"; then 55 no_i=${i#-I} 56 driveletter=${no_i%%:*} 57 i=-I${mountpoint}/${driveletter}/${pathname} 58 fi 59 else 60 eval 'leader=${i%%'${mountpoint}'/[a-zA-Z]/*}' 61 if ! test "${leader}" = "${i}"; then 62 eval 'pathname=${i#'${leader}${mountpoint}'/[a-zA-Z]/}' 63 eval 'no_mountpoint=${i#'${leader}${mountpoint}'/}' 64 driveletter=${no_mountpoint%%/*} 65 i=${leader}${driveletter}:/${pathname} 66 fi 67 fi 68 fi 69 70 args="${args} ${i}" 71 fi 72 fi 73done 74 75exec $prog $args