bug-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Modifications to sanity.sh to support MSVC binary


From: Jim Hyslop
Subject: Modifications to sanity.sh to support MSVC binary
Date: Wed, 21 Jun 2006 09:54:55 -0400
User-agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello, all

One of the biggest stumbling blocks to getting the MSVC binary to work
with sanity.sh is the path convention (i.e. / vs. \).

I am considering adding a function, called posix_to_hostpath, which will
convert the posix-style path into a path understood by the underlying
operating system. For *NIX systems, this will leave the path untouched,
but on Windows systems it will use the built-in `cygpath` command to
convert POSIX-style paths (/a/b/c) to Windows-style paths
(X:\dir\dir\dir). I just want to run this implementation past the
GNUxperts to see if this looks reasonable:


# Convert a unix path into a Windows path
# This is for testing under cygwin.
posix_to_hostpath() {
  if $msvc_binary; then
    cygpath -w $1 | sed 's:/:\\\\:g'
  else
    echo $1
  fi
}

# Convert a Windows path into a regular expression
# which will ignore differences between / and \ path
# separators
posix_to_hostpath_regex() {
  echo `posix_to_hostpath $1` | sed 's/\\/;/g' | sed 's:/:;:g' | \
  sed 's:;:\[\\\\/\]:g'
}

# Echo a new CVSROOT based on $1, $remote, and $remotehost
newroot() {
  if $remote; then
    if test -n "$remotehost"; then
      echo :ext$rootoptions:$remotehost$1
    else
      echo :fork$rootoptions:$1
    fi
  else
    posix_to_hostpath $1
  fi
}

$msvc_binary will only be set to true if the user passes a new
command-line argument, and if `uname | grep CYGWIN` returns true.

Most of the usage of this will be converting
'${CVSROOT_DIRNAME}/somepath' to '`posix_to_hostpath_regex
${CVSROOT_DIRNAME}/somepath'. As an example, ere is the modified
basica-0b test:

          mkdir 1; cd 1
          dotest basica-0a "$testcvs -q co -l ."
          mkdir first-dir
          dotest basica-0b "$testcvs add first-dir" \
"Directory `posix_to_hostpath_regex ${CVSROOT_DIRNAME}`/first-dir added
to the repository"
          cd ..
          rm -r 1


Any thoughts or comments on this proposed change?

- --
Jim Hyslop
Dreampossible: Better software. Simply.     http://www.dreampossible.ca
                 Consulting * Mentoring * Training in
    C/C++ * OOD * SW Development & Practices * Version Management
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFEmU+vLdDyDwyJw+MRApZbAJ9nUl3ECOvOi3FB9u7bugIFaaUxuQCeJsoM
q6ctunxNVRSCRw1uPKrj7OI=
=ervg
-----END PGP SIGNATURE-----






reply via email to

[Prev in Thread] Current Thread [Next in Thread]