Home > How-To > cvsweb

Configurare cvsweb con cvsgraph

Il problema era quello di attivare un CVS server utilizzando cvsweb abbinato però
al modulo cvsgraph (che è supportato direttamente da viewcvs, ma tant'è...).

Una soluzione l'ho trovata all'indirizzo http://www.akhphd.au.dk/~bertho/cvsgraph/
che però non si adattava alla versione che c'è nei ports e che ho regolarmente installato (la 2.0.6 contro la 1.100).

A questo punto dopo averci lavorato un po' ecco la mia soluzione.

File originale: /usr/local/www/cgi-bin/cvsweb.cgi
File modificato: /usr/local/www/cgi-bin/cvsweb_graph.cgi

Ecco qui le 6 differenze fra i due files:

535c535
- $where =~ m:([^/]*):;
+ $where =~ m:([^/]*)/(.*):;

536a537
+ my $pathinrepository = $2;

830c831
- $attic = " (in the Attic) " . $hideAtticToggleLink;
+ $attic = " (in the Attic) " . $hideAtticToggleLink;

954a956,964
+ #*** BS Entered graphing option
+ print "<a href=\"/CVS/cvsgraphwrapper.php" .
+ (length($query) != 0 ? "$query\&" : "?") .
+ "r=" . urlencode($cvsroot) .
+ "\&m=" . urlencode($module) .
+ "\&f=" . urlencode($pathinrepository . ($attic ? "Attic/" : "") . $file) .
+ "\">&nbsp;Graph</a>";
+ #***

3225c3235
- return "very little time";
+ return "very&nbsp;little&nbsp;time";

3249c3259
- $retval .= ", $resttime";
+ $retval .= ",&nbsp;$resttime";



Ci sono poi i seguenti due files .PHP
/path/to/repository/cvsgraphwrapper.php
/path/to/repository/mkimage.php

dove /path/to/repository è definita dalla variabile di sistema $CVSROOT (o passata tutte le volte con l'opzione -d)


Versione 0.1 - 30-11-2002



Files indicati nell'articolo
cvsweb.cgi.txt    98.05 KB
cvsweb_graph.cgi.txt    98.69 KB
cvsgraphwrapper.phps    2.56 KB
mkimage.phps    1.24 KB


Problemi di visualizzazione

07-nov-2004
Installando l'applicativo attraverso i ports, è accaduto che cliccando sull'icona della visualizzazione grafica delle revisioni, ottengo il seguente errore:

exec failed:
cvsgraph -i -c /usr/local/viewcvs-0.9.2/cvsgraph.conf -r /usr/local/www/web/cvs.snet.it -6 -7 cellcam/CC.mep,v
Content-Type: text/html
Python Exception Occurred
Traceback (most recent call last):
File "/usr/local/viewcvs-0.9.2/lib/viewcvs.py", line 2700, in run_cgi
main()
File "/usr/local/viewcvs-0.9.2/lib/viewcvs.py", line 2671, in main
view_cvsgraph(cfg, request)
File "/usr/local/viewcvs-0.9.2/lib/viewcvs.py", line 2053, in view_cvsgraph
request.where + ',v'), 'r')
File "/usr/local/viewcvs-0.9.2/lib/popen.py", line 75, in popen
os.execvp(cmd, (cmd,) + tuple(args))
File "/usr/local/lib/python2.3/os.py", line 336, in execvp
_execvpe(file, args)
File "/usr/local/lib/python2.3/os.py", line 374, in _execvpe
func(fullname, *argrest)
OSError: [Errno 2] No such file or directory

Il problema è che cvsgraph non è nel path.
Bisogna quindi andare in /usr/local/viewcvs-0.9.2
ed editare il file "viewcvs.conf" e settare la variabile cvsgraph_path con il path in cui si trova il programma viewcvs (which viewcvs)

...
# Use CvsGraph. See http://www.akhphd.au.dk/~bertho/cvsgraph/ for
# documentation and download.
use_cvsgraph = 1

#
# if the cvsgraph program is not on the path, set this value
#
#cvsgraph_path =

#--
#-- Settare correttamente questa variabile !!
#--
cvsgraph_path = /usr/local/bin/

#
# Location of the customized cvsgraph configuration file.
# You will need an absolute pathname here:
cvsgraph_conf = /usr/local/viewcvs-0.9.2/cvsgraph.conf
...


Ultimo aggiornamento: 2004/11/07 08:09 - Formato per stampante