[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Problems with ViewCVS

From: Benjamin Pflugmann <benjamin-svn-dev_at_pflugmann.de>
Date: 2003-09-25 09:08:09 CEST

Note that I have never set up or used ViewCVS, so take my comments
with appropriate caution. :-) That said...

On Wed 2003-09-24 at 18:54:36 +0200, Steffen wrote:
[...]
> Now I´m trying to use ViewCVS, and have some questions. Should I change
> apache cgi-bin to the ViewCVS dir?

That's the usual way to set up new CGI programs. Don't know if the
ViewCVS docs demand something different.

> Or copy the .cgi files to the apache cgi-bin? At least I have to
> somehow set up Apache to use python for the viewcvs cgi files..but
> how?

Not necessarily. Skripts can contain a line at the start which tells
the system which interpreter to start (at least on UNIX, not sure
about Windows, but I presume there is a similar mechanism). What you
have in mind is probably the fact, that for using something like
mod_perl, one has to teach Apache that certain files (e.g. ending on
.pl) should be handled by that module.

But this is really only a module-specific thing and has nothing to do
with normal CGI programs (executed by mod_cgi). Btw, the reason
mod_perl is usually preferred over mod_cgi for executing perl scripts
is that mod_cgi has to load the interpreter every time, while mod_perl
does not.

> Best thing would be if Apache still could execute perl
> cgi´s.

Shouldn't be a problem.

> And I´ve read something about bindings..?
>
> >Actually, you might be surprised at how many folks don't realize that
> >they need Python 2 (ViewCVS without Subversion needs only 1.5.2) and
> >that they need to build bindings. :-(
>
> Well, I don´t have any idea what bindings are, so I'm not surprised about
> this fact. Is there anyone who would still try to explain it?

"bindings" refers to an API (application programming interface).
Subversion exists of a lot of libraries, i.e. instead of reinventing
the wheel, one can use the existing Subversion functionality in his
own programs. That's how ViewCVS is writting.

The Subversion libraries are written in C. In order to enable other
languages, like Python to access these libraries (and pass paramters
forward and back), you need a mapping from how Python sees the world
(variables, types, ...) to how they are expressed in C. This is called
a Python "binding" for the libraries.

Hope I could explain it well enough. It's not my strength. ;)

Oh, btw, these bindings already come with Subversion. Don't know if
they have to compiled / installed separately or not.

> I set the svn paths in viewcvs.conf, but was not sure how to set them on
> windows. Normal slashes? Backslashes? Beginning with file:/// ?
> Currently it looks like this: svn_parent_path = d:/svn/
>
> Then i created a new scriptalias "viewsvn" for Apache, pointing to
> "C:/ViewCVS/www/cgi/viewcvs.cgi", but executing http://localhost/viewsvn/
> gives an internal server error. Server log is:
>
> Premature end of script headers: viewcvs.cgi
> Traceback (most recent call last):
> File "C:/ViewCVS/www/cgi/viewcvs.cgi", line 56, in ?
> import viewcvs
> File "C:\ViewCVS\lib\viewcvs.py", line 63, in ?
> import config
> File "C:\ViewCVS\lib\config.py", line 212
> self.options.cvsgraph_conf = os.path.join(r"C:\ViewCVS\", "cvsgraph.conf")
> SyntaxError: invalid syntax
>
> I'm sure if Apache even calls Python here, as I didn't fill in any python
> information into httpd.conf.

AFAICT, this error produced by Python. So you set everything up
correctly to at least the point, where the ViewCVS script gets
executed. Congrats!

> Everything's complicated.. I could need a step by step tutorial.

The error above is due to a typo, IMHO:

  File "C:\ViewCVS\lib\config.py", line 212
  self.options.cvsgraph_conf = os.path.join(r"C:\ViewCVS\", "cvsgraph.conf")

The first parameter to os.path.join is no valid Python expression, I
guess:

  r"C:\ViewCVS\"

Remove the "r" and make it

  self.options.cvsgraph_conf = os.path.join("C:\ViewCVS\", "cvsgraph.conf")

and it should work (or error out at a different place - the next typo? ;-)

Bye,

        Benjamin.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Sep 25 09:09:09 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.