[Zope-Coders] silly windows request

Tim Peters tim@zope.com
Tue, 8 Oct 2002 21:44:36 -0400


[Chris McDonough]
> If anybody has Win98/ME (not NT, I have that) with VC++ installed, do
> you think you might be able to spare a second to do me a favor and do
> perform the following commands:
>
>  cvs -d :ext:cvs.zope.org:/cvs-repository -d InstallBranch \
>    -r chrism-install-branch Zope

Win98SE here.  I had to fiddle that like so:

cvs -d :ext:tim_one@cvs.zope.org:/cvs-repository co \
    -d InstallBranch -r chrism-install-branch Zope

That is, it needed a checkout cmd, and for whatever reason it's impossible
for me to check out anything from a Zope machine on Win98 unless I stuff a
user name in the first -d thingie.

>  cd InstallBranch

Even I could handle that one <wink>.

>  vcvars32

Not normally on the PATH under Win9x; a user has to remember where they
installed MSVC (no problem for me).

>  configure

No joy:

C:\Code\InstallBranch>configure
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name    [and a long pause here]
Syntax error
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
Bad command or file name
C:\Code\InstallBranch>

The line endings appear to be all wrong for a Windows file, but not in a way
"the usual" tools can fix(!).

>>> f = open('configure.bat', 'rb')
>>> guts = f.read()
>>> f.close()
>>> guts
'@echo off\r\r\nrem Zope source configure script for win32\r\r\nrem Ass...

So each line ends with \r\r\n.  This is "as if" you checked in a .bat file
with normal Windows \r\n line ends but did so from a Linux box.  Then \r\n
ends up in the CVS repository.  When checking that out from a Windows box,
then, CVS goes "ah, OK, it's a text file, and the target is Windows, so I'll
change every \n into \r\n".  The result is \r\r\n line endings, and
command.com (the Win9x shell) has no idea what to do with those.

So let's fix that:

>>> guts = guts.replace('\r\r\n', '\r\n')
>>> guts
'@echo off\r\nrem Zope source configure script for win32\r\nrem Ass ...

Much better.

>>> f = open('configure.bat', 'wb')
>>> f.write(guts)
>>> f.close()

Some progress:

C:\Code\InstallBranch>configure

Finding a Python interpreter
Syntax error
A Python interpreter was found at

!! ERROR !!
The version of Python you've installed on your computer at
 is not capable of running Zope.  Use Python
version  instead.  Download and install it
from http://www.python.org.

configure [--prefix=target_dir] [--ignore-largefile] [--ignore-zlib]

Creates a Makefile suitable for building and installing Zope with Visual C++

  Options:
    --prefix            the directory in which you wish to install Zope
                        (e.g. --prefix=c:\Program Files\Zope)
                        defaults to c:\Zope
    --ignore-largefile  ignore large file support warnings
    --ignore-zlib       ignore warnings about zlib

  Special:
    To specify a Python interpreter to use, issue the command
    "set PYTHON=\path\to\your\python\executable" before running
    this script.

Label not found

C:\Code\InstallBranch>

python-for-zope.reg does exist, and the "Syntax error" comes from the

    for /F "tokens=1* delims==" %%A IN ('TYPE %Temp%\py ...

loop, which uses a bunch of stuff unique to cmd.exe (the WinNT+ shell);
command.com doesn't know what to do with this (neither do I -- I don't read
cmd.exe either <wink>).

So it goes to :badpython, and from there to :usage, and from there gets a
"Label not found" due to "goto :EOF" (EOF is not a magic label under
command.com; at least that one is easily fixed by adding an explicit EOF
label to the end of the script).

Part of the output is garbled here:

 echo version %TARGET_PYTHON_VER% instead.  Download and install it

TARGET_PYTHON_VER was never set, so it's an empty string.  I believe this
was intended to be PYTHON_TARGET_VER, which was set, right?

>  nmake build

You wish <wink>.  Let's stick to 8 steps at time.

> ...
> It works ok on NT (or at least it did a couple of days ago ;-) but I
> have no 98 machines to test it out on though.

I'm afraid command.com is much harder to live with, and its "for" loop in
particular *just* loops; no parsing, no magic.

Happy to help more, but I can only do this from home (I don't have Win98 at
the office).