2002-06-17 21:30:22 +04:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Stupid wrapper to avoid win32 dospath/cygdrive issues
|
|
|
|
#
|
|
|
|
prog=$1
|
|
|
|
shift
|
|
|
|
if test -z "$prog"; then
|
|
|
|
exit 0
|
|
|
|
fi
|
2003-08-15 01:32:11 +04:00
|
|
|
|
|
|
|
mountpoint=$CYGDRIVE_MOUNT
|
2003-04-02 10:22:59 +04:00
|
|
|
if test -z "$mountpoint"; then
|
2003-08-15 01:32:11 +04:00
|
|
|
mountpoint=`mount -p`
|
|
|
|
if test -z "$mountpoint"; then
|
|
|
|
print "Cannot determine cygwin mount points. Exiting"
|
|
|
|
exit 1
|
|
|
|
fi
|
2003-04-02 10:22:59 +04:00
|
|
|
fi
|
2003-08-15 01:32:11 +04:00
|
|
|
|
|
|
|
mountpoint=${mountpoint#*/}
|
|
|
|
mountpoint=/${mountpoint%%[!A-Za-z0-9_]*}
|
|
|
|
mountpoint=${mountpoint%/}
|
|
|
|
|
|
|
|
args=""
|
|
|
|
up=""
|
|
|
|
if test "${prog}" = "-up"; then
|
|
|
|
up=1
|
|
|
|
prog=${1}
|
|
|
|
shift
|
2002-06-17 21:30:22 +04:00
|
|
|
fi
|
2003-08-15 01:32:11 +04:00
|
|
|
|
2003-10-31 00:05:56 +03:00
|
|
|
process=1
|
|
|
|
|
2003-08-15 01:32:11 +04:00
|
|
|
for i in "${@}"
|
|
|
|
do
|
2003-10-31 00:05:56 +03:00
|
|
|
if test "${i}" = "-wrap"; then
|
|
|
|
process=1
|
2003-08-15 01:32:11 +04:00
|
|
|
else
|
2003-10-31 00:05:56 +03:00
|
|
|
if test "${i}" = "-nowrap"; then
|
|
|
|
process=
|
|
|
|
else
|
|
|
|
if test -n "${process}"; then
|
|
|
|
if test -n "${up}"; then
|
|
|
|
pathname=${i#-I[a-zA-Z]:/}
|
|
|
|
if ! test "${pathname}" = "${i}"; then
|
|
|
|
no_i=${i#-I}
|
|
|
|
driveletter=${no_i%%:*}
|
|
|
|
i=-I${mountpoint}/${driveletter}/${pathname}
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
eval 'leader=${i%%'${mountpoint}'/[a-zA-Z]/*}'
|
|
|
|
if ! test "${leader}" = "${i}"; then
|
|
|
|
eval 'pathname=${i#'${leader}${mountpoint}'/[a-zA-Z]/}'
|
|
|
|
eval 'no_mountpoint=${i#'${leader}${mountpoint}'/}'
|
|
|
|
driveletter=${no_mountpoint%%/*}
|
|
|
|
i=${leader}${driveletter}:/${pathname}
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
args="${args} ${i}"
|
2003-08-15 01:32:11 +04:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
2002-06-17 21:30:22 +04:00
|
|
|
exec $prog $args
|