ViewCvsWithEnscript

I've managed to get enscrpt to work with ViewCVS on Windows 2000 Server with IIS and CVSNT. [WWW] Enscript will [WWW] colorize the CVS files.

The following packages were downloaded from [WWW] http://sourceforge.net/project/showfiles.php?group_id=23617 and installed in e:\program files\gnuwin32 (program files live on e:\, I know it's weird...)

I have no idea why there are two version of libintl.dll and libiconv.dll, but renaming or copying one to the other failed. Enscript.exe requires libintl.dll and libiconv.dll; States.exe (called by enscript, I think) requires libintl-2.dll and libiconv-2.dll.

The bug in the enscript 1.6.3-1 documented in the ViewCVS 1.0-dev for Windows Release 3 distribution appears to be fixed in enscript 1.6.3-3, so I didn't use the patched version.

Edit the file E:\Program Files\gnuwin32\etc\enscript.cfg, and changed all instances of c:/progra~1/enscript to e:/progra~1/gnuwin32 (there were four). If enscript cannot find it's enscript.cfg, you'll need to set the environment variable ENSCRIPT_LIBRARY to point to it. Mine seemed to work right out of the box, so I didn't worry about it.

Now let's consider ling 615 of viewcvs.py (found in the libs folder under the path where you installed viewcvs). The 'sed' command is issued with no path specifier, so you need to make sure the sed you just installed is in your path. 'enscript' is called from the path set in viewcvs.conf in the 'enscript_path' variable, but since I already placed e:\program files\gnuwin32\bin in my PATH, I didn't need to worry about it. Also, viewcvs is calling enscript with two "-"'s as the final two parameters - according to the enscript docs, passing '-o -' will write to stdout, but to read from stdin, you just don't pass an input file name, so I eliminated one of the "-"'s.

Finally, set use_enscript = 1 in your viewcvs.conf

That should be all. [WWW] http://your-server/viewcvs.asp/your/file/path/and.ext?rev=1.2&content-type=text/vnd.viewcvs-markup

Errors encountered and overcome during this process...

Problem: enscript was failing. Ran viewcvs in debug mode, found the exact command line, and ran it from the console.

  1. dll's not found, twice. Once from enscript.exe, once from states.exe. Fixed by installing the packages above.

  2. enscript still failed, saying "File not found". If I eliminated the '--language=html' parameter, it worked. This was caused by the incorrect entries in enscript.cfg. Changed the entries, restored the '--language=html', and all was well.

  3. Tried running a different version of enscript, but it also failed, saying it couldn't find the enscript.cfg file. This was fixed by setting ENSCRIPT_LIBRARY.

  4. Both versions of enscript now seemed to be working ok on the console, but still failing inside IIS, with a message saing CreateProcess failed, file or path not found. This was when I noticed the call to sed, and installed sed, and all was well.

I have also managed to get line number support in the html output of enscript. It required a new enscript output format. To use it, replace "--language=html" in your viewcvs.py with "--language=html_linenumbers", then copy my lang_html_linenumbers.st file to your "\Program Files\gnuwin32\share\enscript\hl\" directory, restart IIS, and viola - line numbers, complete with little anchor tags :-?

16/08/03 - Cristian Ferretti - The abobe "lang_html_linenumbers.st" file has several problems. First, it states files as one line longer than they really are. Also, the font options for the line n - 1affects the display of the line numbering of line n. This lang_html_linenumbers2.st fixes those issues. It also adds href's for ease of reference.

16/07/03 - John Davies - I followed the above insructions with ViewCVS-1.0-dev-r5 on Windoz 2000, I also downloaded and installed the above libraries with the exception enscript which is now V1.6.3-8 and installed them all into into c:\gnuwin32 rather than the c:\Program Files\... I had a lot of problems with enscript not being found and spent a number of hours making changes. The final solution was a reboot (this was a production development server) and everything worked beautifully. So, as with anything on Windoz reboot, reboot, reboot. I would highly recommend running this on Linux, it takes just minutes to get working!

last edited 2003-08-16 21:37:29 by wwwgate1