lxr-commits Mailing List for LXR Cross Referencer (Page 13)
Brought to you by:
ajlittoz
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(11) |
Sep
(13) |
Oct
(11) |
Nov
(19) |
Dec
(1) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(11) |
Feb
(14) |
Mar
(10) |
Apr
|
May
|
Jun
|
Jul
(8) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2003 |
Jan
|
Feb
|
Mar
(10) |
Apr
|
May
(2) |
Jun
(4) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2004 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
|
Jun
(26) |
Jul
(83) |
Aug
(4) |
Sep
(4) |
Oct
(9) |
Nov
|
Dec
(17) |
2005 |
Jan
(1) |
Feb
(71) |
Mar
(1) |
Apr
(3) |
May
(9) |
Jun
|
Jul
|
Aug
|
Sep
(4) |
Oct
(1) |
Nov
(6) |
Dec
|
2006 |
Jan
|
Feb
|
Mar
|
Apr
(35) |
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(12) |
2007 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
|
Mar
(30) |
Apr
(55) |
May
(28) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
(5) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(5) |
2013 |
Jan
(35) |
Feb
|
Mar
(7) |
Apr
(12) |
May
(1) |
Jun
(2) |
Jul
|
Aug
(1) |
Sep
(32) |
Oct
|
Nov
(45) |
Dec
(18) |
2014 |
Jan
(9) |
Feb
|
Mar
(10) |
Apr
(2) |
May
(4) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(7) |
Nov
(4) |
Dec
|
From: Malcolm B. <mb...@us...> - 2009-03-23 23:26:05
|
Update of /cvsroot/lxr/lxr-tools In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv11063 Log Message: LXR tools Status: Vendor Tag: mbox Release Tags: lxr-tools N lxr-tools/test-data/bk-test-repository.tgz No conflicts created by this import ***** Bogus filespec: - Imported sources |
From: Malcolm B. <mb...@us...> - 2009-03-23 23:06:53
|
Update of /cvsroot/lxr/lxr/tests In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv8705 Removed Files: bk-test-repository.tgz Log Message: Remove BitKeeper test repository - moving to the lxr-tools module with other test data --- bk-test-repository.tgz DELETED --- |
From: Malcolm B. <mb...@us...> - 2009-03-23 23:02:28
|
Update of /cvsroot/lxr/lxr-tools In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv8208 Log Message: LXR tools Status: Vendor Tag: mbox Release Tags: lxr-tools No conflicts created by this import ***** Bogus filespec: - Imported sources |
From: Malcolm B. <mb...@us...> - 2009-03-23 16:51:24
|
Update of /cvsroot/lxr/lxr In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv369 Modified Files: genxref Log Message: Fix bug [ 1691391 ] genxref/swish-e/binary files is VERY inefficient Patched as per bug report - use filehandle to determine binary-ness, not the whole contents. Index: genxref =================================================================== RCS file: /cvsroot/lxr/lxr/genxref,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- genxref 2 Nov 2005 23:39:55 -0000 1.37 +++ genxref 23 Mar 2009 16:51:19 -0000 1.38 @@ -131,10 +131,11 @@ $files->getdir($pathname, $release); } else { print $filelist "$pathname\n"; - my $contents = $files->getfile($pathname, $release); - if ($filetype->checktype_contents($contents) =~ m%(text|message)/% - and length($contents) > 0) + my $fh = $files->getfilehandle($pathname, $release); + if ($files->getfilesize($pathname, $release) > 0 + && $filetype->checktype_filehandle($fh) =~ m%(text|message)/%) { + my $contents = $files->getfile($pathname, $release); $swish->print( "Path-Name: $pathname\n", "Content-Length: " . length($contents) . "\n", @@ -144,6 +145,7 @@ } else { $binaryfiles{$pathname} = 1; } + close($fh); } } |
From: Malcolm B. <mb...@us...> - 2009-03-23 16:43:21
|
Update of /cvsroot/lxr/lxr/lib/LXR In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv28725/lib/LXR Modified Files: Common.pm Log Message: Fix bug [ 1720862 ] Filename with space reports does not exist Add whitespace to allowed list of characters in pathname. Index: Common.pm =================================================================== RCS file: /cvsroot/lxr/lxr/lib/LXR/Common.pm,v retrieving revision 1.58 retrieving revision 1.59 diff -u -d -r1.58 -r1.59 --- Common.pm 20 Dec 2006 19:57:56 -0000 1.58 +++ Common.pm 23 Mar 2009 16:43:08 -0000 1.59 @@ -538,7 +538,8 @@ if(defined $path) { # First suppress anything after a dodgy character - $path =~ s!(^[\w_+\-,\.%\^/\!]+).*!$1!; + # Match good chars from start of string, then replace entire string with only good chars + $path =~ s!(^[\w\s_+\-,\.%\^/\!]+).*!$1!; # Clean out /../ while ($path =~ m!/\.\.?/!) { $path =~ s!/\.\.?/!/!g; @@ -820,7 +821,7 @@ $template = <TEMPL>; close(TEMPL); } else { - warning("Template " . $config->value($tmplname) . " does not exist."); + warning("Template " . $config->value($tmplname) . " does not exist in ".`pwd`); } } @@ -865,7 +866,7 @@ $template = <TEMPL>; close(TEMPL); } else { - warning("Template " . $config->value($tmplname) . " does not exist."); + warning("Template " . $config->value($tmplname) . " does not exist in ".`pwd`); } } |
From: Malcolm B. <mb...@us...> - 2009-03-23 16:41:34
|
Update of /cvsroot/lxr/lxr In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv28065 Modified Files: .htaccess-apache2 Log Message: Remove DirectoryIndex command as this caused problems Index: .htaccess-apache2 =================================================================== RCS file: /cvsroot/lxr/lxr/.htaccess-apache2,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- .htaccess-apache2 23 Mar 2009 15:25:33 -0000 1.1 +++ .htaccess-apache2 23 Mar 2009 16:41:25 -0000 1.2 @@ -1,7 +1,5 @@ Options Indexes ExecCGI FollowSymlinks -DirectoryIndex source - order deny,allow <Files lxr.conf> |
From: Malcolm B. <mb...@us...> - 2009-03-23 15:49:19
|
Update of /cvsroot/lxr/lxr In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv7742 Modified Files: INSTALL Added Files: .htaccess-apache1 Removed Files: .htaccess Log Message: Created Apache 1.x version of .htaccess for use with ModPerl1 Modified install instructions to match --- NEW FILE: .htaccess-apache1 --- Options Indexes ExecCGI FollowSymlinks order deny,allow <Files lxr.conf> deny from all </Files> <Files lib> deny from all </Files> <Files ~ (find|search|source|ident|diff|cgi-bin)$> SetHandler perl-script PerlHandler Apache::Registry PerlSetEnv PERL5LIB lib ForceType text/html PerlSendHeader On </Files> Index: INSTALL =================================================================== RCS file: /cvsroot/lxr/lxr/INSTALL,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- INSTALL 23 Mar 2009 12:32:36 -0000 1.24 +++ INSTALL 23 Mar 2009 15:49:12 -0000 1.25 @@ -11,7 +11,7 @@ usually available from CPAN. 3) A webserver - Apache httpd (http://httpd.apache.org/) with mod_perl - (http://perl.apache.org/) is recommended + (http://perl.apache.org/) is recommended. LXR works with Apache 1 and Apache 2. 4) For freetext searching, either Glimpse (http://glimpse.cs.arizona.edu) or Swish-e (http://swish-e.org) version 2.1 or later. @@ -53,7 +53,8 @@ For MySQL: -Run 'mysql' and then read in the initdb-mysql file using +Run 'mysql' as a user that has the right to create new databases +(often root) and then read in the initdb-mysql file using '\. initdb-mysql'. This will create the database and a user called lxr with access rights to the database. @@ -100,6 +101,7 @@ 'swishbin' => '/path/to/your/swishe-e/executable' Comment out the variables for the indexer you are not using. + Set 'htmlsearch' to either 'html-search-swish.html' or 'html-search-glimpse.html' depending on which indexer you are using. @@ -157,23 +159,6 @@ 'sourceroot' => 'cvs:/path/to/cvs/repository/lxr' 'sourcerootname' => 'A Friendly Name For Your Repository' -Apache2, modperl2 and LXR -------------------------- -Edit the .htaccess file and change "Apache::Registry" to -"ModPerl::Registry". You also need to let modperl2 know about -where to find LXR perl modules. You can add a line like this -to your Apache2 config: - - PerlRequire /usr/local/lxr/require.pl - -with about this contents: -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -#!/usr/bin/env perl -w -@INC=(@INC, "/usr/local/lxr", - "/usr/local/lxr/lib", - "/usr/local/lxr/lib/Files"); -1; -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Using Swish-e with LXR ---------------------- @@ -224,8 +209,14 @@ AllowOverride All </Directory> -The distribution contains a .htaccess file set up to ensure that lxr -will work. Edit it if you have special local policies. +The distribution contains a .htaccess file for both Apache 1.x and +Apache 2.x (.htaccess-apache1 and .htaccess-apache2 respectively). +Rename the appropriate one to .htaccess: + + mv .htaccess-apache2 .htaccess + +The supplied files should enable LXR to work out-of-the-box. Edit it +if you have special local policies. If you are using Apache without mod_perl (running scripts as CGI), instead of 'Alias' in httpd.conf use 'ScriptAlias'. Also, delete --- .htaccess DELETED --- |
From: Malcolm B. <mb...@us...> - 2009-03-23 15:25:38
|
Update of /cvsroot/lxr/lxr In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4008 Added Files: .htaccess-apache2 Log Message: Updated to fix issues when running under Modperl2 & Apache2: - Change to RegistryPrefork so that working directory is the same as the script directory rather than /. This makes the template inclusion work properly - Add DirectoryIndex to hide default directory listing - Remove old mod_perl1 directives --- NEW FILE: .htaccess-apache2 --- Options Indexes ExecCGI FollowSymlinks DirectoryIndex source order deny,allow <Files lxr.conf> deny from all </Files> <Files lib> deny from all </Files> <Files ~ (find|search|source|ident|diff|cgi-bin)$> SetHandler perl-script PerlHandler ModPerl::RegistryPrefork ForceType text/html PerlOptions +ParseHeaders </Files> |
From: Malcolm B. <mb...@us...> - 2009-03-23 14:34:35
|
Update of /cvsroot/lxr/lxr In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv28479 Modified Files: .htaccess_cgi Log Message: Set the handler for lxr.css to be the default rather than a script. Before this change, lxr.css was interpreted as a script due to the ScriptAlias directive in httpd.conf.ew Index: .htaccess_cgi =================================================================== RCS file: /cvsroot/lxr/lxr/.htaccess_cgi,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- .htaccess_cgi 19 Jul 2004 18:16:35 -0000 1.1 +++ .htaccess_cgi 23 Mar 2009 14:34:22 -0000 1.2 @@ -10,6 +10,10 @@ deny from all </Files> +<Files lxr.css> +SetHandler default-handler +</Files> + <Files ~ (find|search|source|ident|diff|cgi-bin)$> SetHandler cgi-script ForceType text/html |
From: Malcolm B. <mb...@us...> - 2009-03-23 13:29:24
|
Update of /cvsroot/lxr/lxr/lib/LXR/Index In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv14065/lib/LXR/Index Modified Files: Mysql.pm Log Message: Fix bug [ 1645267 ] problem with MySQL syntax in delete statement Change MySQL delete statements as per bug report Index: Mysql.pm =================================================================== RCS file: /cvsroot/lxr/lxr/lib/LXR/Index/Mysql.pm,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- Mysql.pm 23 Mar 2009 12:27:18 -0000 1.21 +++ Mysql.pm 23 Mar 2009 13:29:15 -0000 1.22 @@ -112,24 +112,24 @@ "insert into ${prefix}declarations (declid, langid, declaration) values (NULL, ?, ?)"); $self->{delete_indexes} = - $self->{dbh}->prepare("delete from ${prefix}indexes " + $self->{dbh}->prepare("delete from i " . "using ${prefix}indexes i, ${prefix}releases r " . "where i.fileid = r.fileid " . "and r.rel = ?"); $self->{delete_useage} = - $self->{dbh}->prepare("delete from ${prefix}useage " + $self->{dbh}->prepare("delete from u " . "using ${prefix}useage u, ${prefix}releases r " . "where u.fileid = r.fileid " . "and r.rel = ?"); $self->{delete_status} = - $self->{dbh}->prepare("delete from ${prefix}status " + $self->{dbh}->prepare("delete from s " . "using ${prefix}status s, ${prefix}releases r " . "where s.fileid = r.fileid " . "and r.rel = ?"); $self->{delete_releases} = $self->{dbh}->prepare("delete from ${prefix}releases " . "where rel = ?"); $self->{delete_files} = - $self->{dbh}->prepare("delete from ${prefix}files " + $self->{dbh}->prepare("delete from f " . "using ${prefix}files f, ${prefix}releases r " . "where f.fileid = r.fileid " . "and r.rel = ?"); |
From: Malcolm B. <mb...@us...> - 2009-03-23 12:32:49
|
Update of /cvsroot/lxr/lxr In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4945 Modified Files: INSTALL Log Message: Fix bug 1716172: Typo in INSTALL Corrected the path information on line 112. Index: INSTALL =================================================================== RCS file: /cvsroot/lxr/lxr/INSTALL,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- INSTALL 20 Dec 2006 19:53:49 -0000 1.23 +++ INSTALL 23 Mar 2009 12:32:36 -0000 1.24 @@ -109,7 +109,7 @@ /usr/lib/perl5/site_perl which is also needed in lxr.conf 'genericconf' => '/usr/lib/perl5/site_perl/LXR/Lang/generic.conf' - 'ectagsconf' => '/usr/lib/perl5/site_perl/Lang/ectags.conf', + 'ectagsconf' => '/usr/lib/perl5/site_perl/LXR/Lang/ectags.conf', Next set your base URL and virtual root for LXR by setting |
From: Malcolm B. <mb...@us...> - 2009-03-23 12:27:32
|
Update of /cvsroot/lxr/lxr/lib/LXR/Index In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv3894/lib/LXR/Index Modified Files: Mysql.pm Log Message: Fix for bug 1209273: release a reserved word in MySQL 5.x Rename the releases.release column in the database to releases.rel, avoiding the problem. Index: Mysql.pm =================================================================== RCS file: /cvsroot/lxr/lxr/lib/LXR/Index/Mysql.pm,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- Mysql.pm 18 Oct 2004 20:45:37 -0000 1.20 +++ Mysql.pm 23 Mar 2009 12:27:18 -0000 1.21 @@ -71,16 +71,16 @@ . "where s.symid = i.symid and i.fileid = f.fileid " . "and f.fileid = r.fileid " . "and i.langid = d.langid and i.type = d.declid " - . "and s.symname = ? and r.release = ?"); + . "and s.symname = ? and r.rel = ?"); $self->{indexes_insert} = $self->{dbh}->prepare( "insert into ${prefix}indexes (symid, fileid, line, langid, type, relsym) values (?, ?, ?, ?, ?, ?)" ); $self->{releases_select} = - $self->{dbh}->prepare("select * from ${prefix}releases where fileid = ? and release = ?"); + $self->{dbh}->prepare("select * from ${prefix}releases where fileid = ? and rel = ?"); $self->{releases_insert} = - $self->{dbh}->prepare("insert into ${prefix}releases (fileid, release) values (?, ?)"); + $self->{dbh}->prepare("insert into ${prefix}releases (fileid, rel) values (?, ?)"); $self->{status_get} = $self->{dbh}->prepare("select status from ${prefix}status where fileid = ?"); @@ -102,7 +102,7 @@ . "where s.symid = u.symid " . "and f.fileid = u.fileid " . "and u.fileid = r.fileid " - . "and s.symname = ? and r.release = ? " + . "and s.symname = ? and r.rel = ? " . "order by f.filename"); $self->{decl_select} = $self->{dbh}->prepare( @@ -115,24 +115,24 @@ $self->{dbh}->prepare("delete from ${prefix}indexes " . "using ${prefix}indexes i, ${prefix}releases r " . "where i.fileid = r.fileid " - . "and r.release = ?"); + . "and r.rel = ?"); $self->{delete_useage} = $self->{dbh}->prepare("delete from ${prefix}useage " . "using ${prefix}useage u, ${prefix}releases r " . "where u.fileid = r.fileid " - . "and r.release = ?"); + . "and r.rel = ?"); $self->{delete_status} = $self->{dbh}->prepare("delete from ${prefix}status " . "using ${prefix}status s, ${prefix}releases r " . "where s.fileid = r.fileid " - . "and r.release = ?"); + . "and r.rel = ?"); $self->{delete_releases} = - $self->{dbh}->prepare("delete from ${prefix}releases " . "where release = ?"); + $self->{dbh}->prepare("delete from ${prefix}releases " . "where rel = ?"); $self->{delete_files} = $self->{dbh}->prepare("delete from ${prefix}files " . "using ${prefix}files f, ${prefix}releases r " . "where f.fileid = r.fileid " - . "and r.release = ?"); + . "and r.rel = ?"); return $self; } |
From: Malcolm B. <mb...@us...> - 2009-03-23 12:27:31
|
Update of /cvsroot/lxr/lxr In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv3894 Modified Files: initdb-mysql Log Message: Fix for bug 1209273: release a reserved word in MySQL 5.x Rename the releases.release column in the database to releases.rel, avoiding the problem. Index: initdb-mysql =================================================================== RCS file: /cvsroot/lxr/lxr/initdb-mysql,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- initdb-mysql 5 Jun 2006 10:15:02 -0000 1.11 +++ initdb-mysql 23 Mar 2009 12:27:18 -0000 1.12 @@ -34,8 +34,8 @@ create table lxr_releases (fileid int not null references lxr_files, - `release` char(255) binary not null, - primary key (fileid,release) + rel char(255) binary not null, + primary key (fileid,rel) ); create table lxr_useage |
From: Malcolm B. <mb...@us...> - 2007-04-14 22:33:06
|
Update of /cvsroot/lxr/lxr/tests In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv9819/tests Modified Files: AllTests.pm Log Message: Disable the CVS tests as these don't work yet. Update the RELEASING document Index: AllTests.pm =================================================================== RCS file: /cvsroot/lxr/lxr/tests/AllTests.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- AllTests.pm 2 Nov 2005 23:39:55 -0000 1.3 +++ AllTests.pm 14 Apr 2007 22:33:01 -0000 1.4 @@ -15,7 +15,7 @@ my $suite = Test::Unit::TestSuite->empty_new("LXR Tests"); $suite->add_test(Test::Unit::TestSuite->new("ConfigTest")); $suite->add_test(Test::Unit::TestSuite->new("SecurityTest")); - $suite->add_test(Test::Unit::TestSuite->new("CVSTest")); +# $suite->add_test(Test::Unit::TestSuite->new("CVSTest")); $suite->add_test(Test::Unit::TestSuite->new("PlainTest")); # $suite->add_test(Test::Unit::TestSuite->new("BKTest")); return $suite; |
From: Malcolm B. <mb...@us...> - 2007-04-14 22:33:04
|
Update of /cvsroot/lxr/lxr In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv9819 Modified Files: RELEASING Log Message: Disable the CVS tests as these don't work yet. Update the RELEASING document Index: RELEASING =================================================================== RCS file: /cvsroot/lxr/lxr/RELEASING,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- RELEASING 4 Apr 2006 22:23:46 -0000 1.1 +++ RELEASING 14 Apr 2007 22:33:01 -0000 1.2 @@ -8,3 +8,4 @@ - upload to SF servers - upload new changelog - send release notification +- Update the tracker version numbers (bugs etc) so defects can be reported |
From: Jan-Benedict G. <jb...@us...> - 2006-12-21 09:33:39
|
Update of /cvsroot/lxr/lxr/lib/LXR/Files In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv25681/lib/LXR/Files Modified Files: GIT.pm Log Message: Fix isdir()/isfile() for some cases. Hyperref'ed header files work now. Index: GIT.pm =================================================================== RCS file: /cvsroot/lxr/lxr/lib/LXR/Files/GIT.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- GIT.pm 20 Dec 2006 19:51:13 -0000 1.2 +++ GIT.pm 21 Dec 2006 09:33:36 -0000 1.3 @@ -54,7 +54,7 @@ return 1 == 1; } else { my $repo = Git->repository (Directory => "$self->{'rootpath'}"); - my $line = $repo->command_oneline ("ls-tree", "-d", "$release", "$pathname"); + my $line = $repo->command_oneline ("ls-tree", "$release", "$pathname"); return $line =~ m/^\d+ tree .*$/; } } @@ -67,7 +67,7 @@ return 1 == 0; } else { my $repo = Git->repository (Directory => "$self->{'rootpath'}"); - my $line = $repo->command_oneline ("ls-tree", "-d", "$release", "$pathname"); + my $line = $repo->command_oneline ("ls-tree", "$release", "$pathname"); return $line =~ m/^\d+ blob .*$/; } } |
From: Jan-Benedict G. <jb...@us...> - 2006-12-20 19:58:01
|
Update of /cvsroot/lxr/lxr/lib/LXR In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv3335/lib/LXR Modified Files: Common.pm Log Message: </html> is already inside the html template files, no need to output another one hardcoded from within the Perl files. Index: Common.pm =================================================================== RCS file: /cvsroot/lxr/lxr/lib/LXR/Common.pm,v retrieving revision 1.57 retrieving revision 1.58 diff -u -d -r1.57 -r1.58 --- Common.pm 20 Dec 2006 19:48:11 -0000 1.57 +++ Common.pm 20 Dec 2006 19:57:56 -0000 1.58 @@ -879,8 +879,7 @@ 'variables' => sub { varexpand(@_, $who) }, 'devinfo' => sub { devinfo(@_) } ) - ), - "</html>\n" + ) ); } |
From: Jan-Benedict G. <jb...@us...> - 2006-12-20 19:56:47
|
Update of /cvsroot/lxr/lxr/templates In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv2930/templates Modified Files: lxr.conf Log Message: Place two examples about how to get the tags out of a GIT repository as versions vor the `v' variable. Index: lxr.conf =================================================================== RCS file: /cvsroot/lxr/lxr/templates/lxr.conf,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- lxr.conf 20 Dec 2006 19:55:32 -0000 1.29 +++ lxr.conf 20 Dec 2006 19:56:43 -0000 1.30 @@ -60,6 +60,45 @@ # ($files->allreleases($LXR::Common::pathname), # $files->allrevisions($LXR::Common::pathname)) # }, # deferred function call. + # + # When using a GIT repo, you can use its tags + # to create a list of versions. As an extra + # bonus, with the Linux::KernelSort Perl module, + # you can properly sort kernel versions. Just + # leave it off for generic projects. + # + # Simple example for any GIT repo: + # 'range' => sub { + # my $some_dir = "/path/to/project/.git/refs/tags"; + # opendir (DIR, $some_dir) || die "cannot opendir $some_dir: $!"; + # my @files = grep { -f "$some_dir/$_" } readdir (DIR); + # closedir DIR; + # return sort @files; + # }, + # + # Advanced example for Linus's upstream + # linux-2.6 kernel repository: + # 'range' => sub { + # use Linux::KernelSort; + # my $kernel = new Linux::KernelSort; + # + # my $some_dir = "/path/to/linux-2.6/.git/refs/tags"; + # opendir (DIR, $some_dir) || die "cannot opendir $some_dir: $!"; + # my @files = grep { -f "$some_dir/$_" } readdir (DIR); + # closedir DIR; + # # Linus's tags all have a leading "v" + # # which we must cut off for sorting + # # add again afterwards. + # for (my $i = 0; $i < scalar (@files); $i++) { + # $files[$i] =~ s/^v//; + # } + # @files = $kernel->sort (@files); + # for (my $i = 0; $i < scalar (@files); $i++) { + # $files[$i] =~ s/^/v/; + # } + # + # return @files; + # }, # The default version to display 'default' => '1.0.6' |
From: Jan-Benedict G. <jb...@us...> - 2006-12-20 19:55:37
|
Update of /cvsroot/lxr/lxr/templates In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv2526/templates Modified Files: lxr.conf Log Message: Remove redundant whitespace from our lxr.conf template. Index: lxr.conf =================================================================== RCS file: /cvsroot/lxr/lxr/templates/lxr.conf,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- lxr.conf 20 Dec 2006 19:52:26 -0000 1.28 +++ lxr.conf 20 Dec 2006 19:55:32 -0000 1.29 @@ -3,7 +3,6 @@ # ( { - # Global configuration # Path to glimpse executables. @@ -25,10 +24,9 @@ # Location of the ectags.conf file 'ectagsconf' => '/path/to/lib/LXR/Lang/ectags.conf', - - # Paths for CVS module - 'cvspath' => '/bin:/usr/local/bin:/usr/bin:/usr/sbin', + # Paths for CVS module + 'cvspath' => '/bin:/usr/local/bin:/usr/bin:/usr/sbin', }, { @@ -81,17 +79,17 @@ }, # Templates used for headers and footers - 'htmlhead' => 'html-head.html', - 'htmltail' => 'html-tail.html', - 'htmldir' => 'html-dir.html', - 'htmlident' => 'html-ident.html', + 'htmlhead' => 'html-head.html', + 'htmltail' => 'html-tail.html', + 'htmldir' => 'html-dir.html', + 'htmlident' => 'html-ident.html', 'htmlident_refs' => 'html-ident-refs.html', - 'htmlfind' => 'html-find.html', - 'htmlsearch' => 'html-search-swish.html', + 'htmlfind' => 'html-find.html', + 'htmlsearch' => 'html-search-swish.html', - 'sourcehead' => 'html-head.html', - 'sourcedirhead' => 'html-head.html', - 'stylesheet' => 'lxr.css', + 'sourcehead' => 'html-head.html', + 'sourcedirhead' => 'html-head.html', + 'stylesheet' => 'lxr.css', # sourceroot - where to get the source files from @@ -108,9 +106,9 @@ # server access does NOT work. # 'sourceroot' => 'cvs:/hom/karsk/a/CVSROOT/linux', - # For a BitKeeper repository, specify bk: followed by the path to the + # For a BitKeeper repository, specify bk: followed by the path to the # repository. For BK it is also necessary to specify a 'cachepath' parameter in - # the 'sourceparams' value below. This should point to a directory where the + # the 'sourceparams' value below. This should point to a directory where the # code can write and read files. # 'sourceroot' => 'bk:/some/repository/here', @@ -130,16 +128,16 @@ # # BK: 'cachepath' is used for temporary files # GIT: if `do_annotations' is non-zero, the file revision that - # introduced each line is displayed. - # `do_blame' will add the author of each line to the - # output. Keep in mind that the core LXR code - # will only request author information if - # annotations are switched on, too! + # introduced each line is displayed. + # `do_blame' will add the author of each line to the + # output. Keep in mind that the core LXR code + # will only request author information if + # annotations are switched on, too! # 'sourceparams' => { - 'cachepath' => '/a/path/here', - 'do_annotate' => 1, - 'do_blame' => 1, + 'cachepath' => '/a/path/here', + 'do_annotate' => 1, + 'do_blame' => 1, }, # The DBI identifier for the database to use @@ -204,7 +202,7 @@ 'Java' => [ 'Java', '(?i)\.java$', 'LXR::Lang::Java', '4' ], # 'Lisp' => [ - # 'Lisp', '(?i)\.cl$|\.clisp$|\.el$|\.l$|\.lisp$|\.lsp$|\.ml$', 'LXR::Lang::Generic' + # 'Lisp', '(?i)\.cl$|\.clisp$|\.el$|\.l$|\.lisp$|\.lsp$|\.ml$', 'LXR::Lang::Generic' # ], # No tabwidth specified here as an example |
From: Jan-Benedict G. <jb...@us...> - 2006-12-20 19:54:34
|
Update of /cvsroot/lxr/lxr In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv2122 Modified Files: initdb-postgres Log Message: Cleanly indent the initdb-postgres SQL script. Index: initdb-postgres =================================================================== RCS file: /cvsroot/lxr/lxr/initdb-postgres,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- initdb-postgres 20 Jul 2004 15:31:24 -0000 1.6 +++ initdb-postgres 20 Dec 2006 19:54:31 -0000 1.7 @@ -19,7 +19,6 @@ fileid int, primary key (fileid), unique (filename, revision) - ); create table lxr_symbols ( @@ -27,15 +26,14 @@ symid int, primary key (symid), unique (symname) - ); create table lxr_declarations ( - declid smallint not null, + declid smallint not null, langid smallint not null, declaration char(255) not null, - primary key (declid, langid) -); + primary key (declid, langid) +); create table lxr_indexes ( symid int references lxr_symbols, @@ -44,10 +42,10 @@ langid smallint not null, type smallint not null, relsym int references lxr_symbols, - foreign key (langid, type) references lxr_declarations (langid, declid) + foreign key (langid, type) references lxr_declarations (langid, declid) ); -create table lxr_releases +create table lxr_releases (fileid int references lxr_files, release varchar, primary key (fileid,release) @@ -76,4 +74,4 @@ grant select on lxr_releases to public; grant select on lxr_usage to public; grant select on lxr_status to public; -grant select on lxr_declarations to public; \ No newline at end of file +grant select on lxr_declarations to public; |
From: Jan-Benedict G. <jb...@us...> - 2006-12-20 19:53:52
|
Update of /cvsroot/lxr/lxr In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv1720 Modified Files: INSTALL Log Message: Update installation instructions wrt. Apache2. Index: INSTALL =================================================================== RCS file: /cvsroot/lxr/lxr/INSTALL,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- INSTALL 6 Jun 2006 21:33:57 -0000 1.22 +++ INSTALL 20 Dec 2006 19:53:49 -0000 1.23 @@ -74,11 +74,15 @@ Now you have to put the perl modules that LXR uses into a directory on your system that will be searched by mod_perl when the LXR scripts are -executed. Execute: +executed. Being an Apache 1.x user, execute: cp /usr/local/lxr/Local.pm /usr/lib/perl5/site_perl/ cp -r /usr/local/lxr/lib/LXR /usr/lib/perl5/site_perl +For Apache2, there's a clever variant to not clobber your system's +Perl installation with foreign modules documented below in the Apache2 +section. + Now you should copy the template files for LXR to your installation mv /usr/local/lxr/templates/* /usr/local/lxr/ @@ -90,7 +94,7 @@ 'glimpsebin' => '/path/to/your/glimpse/executable' 'glimpseindex' => '/path/to/your/glimpseindex/executable' - + If you have swish-e installed, you should set 'swishbin' => '/path/to/your/swishe-e/executable' @@ -153,6 +157,24 @@ 'sourceroot' => 'cvs:/path/to/cvs/repository/lxr' 'sourcerootname' => 'A Friendly Name For Your Repository' +Apache2, modperl2 and LXR +------------------------- +Edit the .htaccess file and change "Apache::Registry" to +"ModPerl::Registry". You also need to let modperl2 know about +where to find LXR perl modules. You can add a line like this +to your Apache2 config: + + PerlRequire /usr/local/lxr/require.pl + +with about this contents: +- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +#!/usr/bin/env perl -w +@INC=(@INC, "/usr/local/lxr", + "/usr/local/lxr/lib", + "/usr/local/lxr/lib/Files"); +1; +- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + Using Swish-e with LXR ---------------------- Create a directory for the swish index files to go in, and put the |
From: Jan-Benedict G. <jb...@us...> - 2006-12-20 19:52:29
|
Update of /cvsroot/lxr/lxr/templates In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv1252/templates Modified Files: lxr.conf Log Message: Update sourceparams documentation. Index: lxr.conf =================================================================== RCS file: /cvsroot/lxr/lxr/templates/lxr.conf,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- lxr.conf 8 Apr 2006 13:37:58 -0000 1.27 +++ lxr.conf 20 Dec 2006 19:52:26 -0000 1.28 @@ -124,9 +124,23 @@ # The name to display for this source tree 'sourcerootname' => 'Example', - - # Any parameters to the source access method should be specified below - 'sourceparams' => {'cachepath' => '/a/path/here'}, + + # + # Any parameters to the source access method should be specified below. + # + # BK: 'cachepath' is used for temporary files + # GIT: if `do_annotations' is non-zero, the file revision that + # introduced each line is displayed. + # `do_blame' will add the author of each line to the + # output. Keep in mind that the core LXR code + # will only request author information if + # annotations are switched on, too! + # + 'sourceparams' => { + 'cachepath' => '/a/path/here', + 'do_annotate' => 1, + 'do_blame' => 1, + }, # The DBI identifier for the database to use # For mysql, the format is dbi:mysql:dbname=<name> |
From: Jan-Benedict G. <jb...@us...> - 2006-12-20 19:51:20
|
Update of /cvsroot/lxr/lxr/lib/LXR/Files In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv792/lib/LXR/Files Modified Files: GIT.pm Log Message: Rework the GIT backend. Index: GIT.pm =================================================================== RCS file: /cvsroot/lxr/lxr/lib/LXR/Files/GIT.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- GIT.pm 8 Apr 2006 13:37:58 -0000 1.1 +++ GIT.pm 20 Dec 2006 19:51:13 -0000 1.2 @@ -1,7 +1,9 @@ -# -*- tab-width: 4 -*- ############################################### # -# $Id$ - +# GIT.pm - A file backend for LXR based on GIT. +# +# © 2006 by Jan-Benedict Glaw <jb...@lu...> +# © 2006 by Maximilian Wilhelm <ma...@rf...> +# # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or @@ -13,8 +15,9 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# along with this program; if not, write to the Free Software Foundation +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA +# package LXR::Files::GIT; @@ -22,400 +25,230 @@ use strict; use FileHandle; +use Time::Local; use LXR::Common; -use LXR::Author; +use Git; -# -# We're adding ".git" to the path since we're only dealing with -# low-level stuff and _never_ ever deal with checked-out files. -# sub new { my ($self, $rootpath, $params) = @_; $self = bless({}, $self); $self->{'rootpath'} = $rootpath; + $self->{'do_blame'} = $$params{'do_blame'}; + $self->{'do_annotations'} = $$params{'do_annotations'}; + + if ($self->{'do_blame'}) { + # Blame support will only work when commit IDs are available, + # called annotations here... + $self->{'do_annotations'} = 1; + } - $ENV{'GIT_DIR'} = $self->{'rootpath'}; return $self; } -sub filerev { - my ($self, $filename, $release) = @_; - - $filename = $self->sanitizePath ($filename); - $release = $self->get_treehash_for_branchhead_or_tag ($release); - - my $pid = open(my $F, '-|'); - die $! unless defined $pid; - if (!$pid) { - exec ("git-ls-tree", $release, $filename) - or die "filerev: Cannot exec git-ls-tree"; - } - - my $git_line=<$F>; - chomp $git_line; - close($F); +sub isdir { + my ($self, $pathname, $release) = @_; - if ($git_line =~ m/(\d+)\s(\w+)\s([[:xdigit:]]+)\t(.*)/ ) { - return $3; - + $pathname =~ s/^\///; + if ($pathname eq "") { + return 1 == 1; } else { - die "filerev( $filename, $release ): No entry found.\n"; + my $repo = Git->repository (Directory => "$self->{'rootpath'}"); + my $line = $repo->command_oneline ("ls-tree", "-d", "$release", "$pathname"); + return $line =~ m/^\d+ tree .*$/; } } -sub getfiletime { - my ($self, $filename, $release) = @_; - $filename = $self->sanitizePath ($filename); - - if ($filename =~ m/\/\.\.$/ ) - return undef; -# if ($filename =~ /\/\.\.\$/) -# return undef; - - my $pid1 = open(my $R, '-|' ); - die $! unless defined $pid1; - if(!$pid1) { - exec("git-rev-list", "--max-count=1", "$release", "--", $filename ) or die "getfiletime ($filename, $release): Cannot exec git-rev-list\n"; - } - my $commit = <$R>; - chomp $commit; - close($R); - - my $pid = open(my $F, '-|'); - die $! unless defined $pid; - if(!$pid) { - exec("git-cat-file", "commit", $commit) or die "getfiletime ($filename, $release): Cannot exec git-cat-file\n"; - } +sub isfile { + my ($self, $pathname, $release) = @_; - while(<$F>) { - chomp; - if ( m/^author .*<.*> (\d+)\s.*$/ ) { - close($F); - return $1; - } + $pathname =~ s/^\///; + if ($pathname eq "") { + return 1 == 0; + } else { + my $repo = Git->repository (Directory => "$self->{'rootpath'}"); + my $line = $repo->command_oneline ("ls-tree", "-d", "$release", "$pathname"); + return $line =~ m/^\d+ blob .*$/; } - - close($F); - - die "getfiletime ($filename, $release) : Did not find GIT entry.\n"; } -sub getfilesize { - my ($self, $filename, $release) = @_; +sub getdir { + my ($self, $pathname, $release) = @_; + my ($dir, $node, @dirs, @files); + my $repo = Git->repository (Directory => "$self->{'rootpath'}"); - $filename = $self->sanitizePath ($filename); - my $object_hash = $self->filerev ($filename, $release); + $pathname =~ s/^\///; - print STDERR "getfilesize ($filename, $release)\n"; + my ($fh, $c) = $repo->command_output_pipe ("ls-tree", "$release", "$pathname"); + while (<$fh>) { + if (m/(\d+) (\w+) ([[:xdigit:]]+)\t(.*)/) { + my ($entrymode, $entrytype, $objectid, $entryname) = ($1, $2, $3, $4); - # return `git-cat-file -s $blobhash`; - my $pid = open (my $F, '-|'); - die $! unless defined $pid; - if(!$pid) { - exec ("git-cat-file", "-s", $object_hash) or die "getfilesize ($filename, $release): Cannot exec git-cat-file\n"; - } + # Only get the filename part of the full path + my @array = split (/\//, $entryname); + my $num = @array - 1; + $entryname = @array[$num]; - my $size = <$F>; - close ($F); - chomp $size; - if ( $size ) { - return $size; - } else { - return undef; - } + # Weed out things to ignore + foreach my $ignoredir ($config->{ignoredirs}) { + next if $entryname eq $ignoredir; + } - close ($F); - return undef; -} + next if $entryname =~ /^\.$/; + next if $entryname =~ /^\.\.$/; -sub getfile { - my ($self, $filename, $release) = @_; - my ($buffer); + if ($entrytype eq "blob") { + push (@files, $entryname); + } elsif ($entrytype eq "tree") { + push (@dirs, "$entryname/"); + } + } + } -# my $blobhash = open( "git-ls-tree $release $filename | cut -f 3 -d ' ' | cut -f 1 -d \$'\t' |") or die "Cannot open git-ls-tree $release $filename in getfile\n"; - my $blobhash = $self->filerev( $filename, $release ); -# local ($/) = undef; + $repo->command_close_pipe ($fh, $c); - open(FILE, "git-cat-file blob $blobhash|") || return undef; - $buffer = <FILE>; - close(FILE); - return $buffer; + return sort (@dirs), sort (@files); } -sub getfilehandle { +sub getfilesize { my ($self, $filename, $release) = @_; - my ($fileh); - $filename = $self->sanitizePath ($filename); + my $repo = Git->repository (Directory => "$self->{'rootpath'}"); - my $treeid = $self->get_treehash_for_branchhead_or_tag ($release); + $filename =~ s/^\///; - $filename = $self->sanitizePath ($filename); - my $objectid = $self->getBlobOrTreeOfPathAndTree ($filename, $treeid); + my $sha1hashline = $repo->command_oneline ("ls-tree", "$release", "$filename"); - $fileh = new IO::File; - $fileh->open ("git-cat-file blob $objectid |") or die "Cannot execute git-cat-file blob $objectid"; + if ($sha1hashline =~ m/\d+ blob ([[:xdigit:]]+)\t.*/) { + return $repo->command_oneline ("cat-file", "-s", "$1"); + } - return $fileh; + return undef; } sub tmpfile { my ($self, $filename, $release) = @_; my ($tmp, $fileh); - local ($/) = undef; $tmp = $config->tmpdir . '/lxrtmp.' . time . '.' . $$ . '.' . &LXR::Common::tmpcounter; - open(TMP, "> $tmp") || return undef; - $fileh = $self->getfilehandle( $filename, $release ); - print(TMP <$fileh>); - close($fileh); - close(TMP); + open (TMP, "> $tmp") || return undef; + $fileh = $self->getfilehandle ($filename, $release); + print (TMP <$fileh>); + close ($fileh); + close (TMP); return $tmp; } -sub getannotations { +sub filerev { + my ($self, $filename, $release) = @_; + my $repo = Git->repository (Directory => "$self->{'rootpath'}"); - return (); - my ($self, $pathname, $release) = @_; - my @authors = (); + $filename =~ s/^\///; - if ( $pathname =~ m#^/(.*)$# ) { - $pathname = $1; - } - - open( BLAME, "git-blame -l $pathname $release |"); - while( <BLAME> ) { - if ( m/(^[[:xdigit:]]+)\s.*$/ ) { - my $linehash = $1; - my $authorline = `git-cat-file commit $linehash`; - if ($authorline =~ m/^author ([^<]+)<(([^@])\@[^>]+)>.*$/ ) { - my ($authorname, $authoruser, $authoremail) = ($1, $2, $3); - push(@authors, LXR::Author->new(chomp $authorname, - $authoruser, $authoremail)); - } else { - push(@authors, LXR::Author->new("", "", "")); - } - } else { - print STDERR "getannotations: JB HAT DOOFE OHREN: $_\n"; - } + my $sha1hashline = $repo->command_oneline ("ls-tree", "$release", "$filename"); + + if ($sha1hashline =~ m/\d+ blob ([[:xdigit:]]+)\t.*/) { + return $1; } - close(BLAME); - print STDERR "authors: " . join(" ", @authors) . "\n"; - - return @authors; + return undef; } -sub getauthor { - - return (); - +sub getfiletime { my ($self, $filename, $release) = @_; - $filename = $self->sanitizePath ($filename); - print STDERR "getauthr( $filename, $release )\n"; - my $commit = `git-rev-list --max-count=1 $release -- $filename | tr -d \$'\n'`; - my $authorline = `git-cat-file commit $commit | grep '^author' | head -n1 | tr -d \$'\n'`; - if ($authorline =~ m/^author ([^<]+)<(([^@])\@[^>]+)>.*$/ ) { - my ($authorname, $authoruser, $authoremail) = ($1, $2, $3); - return LXR::Author->new(chomp $authorname, $authoruser, $authoremail); - } else { - return LXR::Author->new("", "", ""); - } -} + $filename =~ s/^\///; -sub getdir { - my ($self, $pathname, $release) = @_; - my ($dir, $node, @dirs, @files); - - my $treeid = $self->get_treehash_for_branchhead_or_tag ($release); - - $pathname = $self->sanitizePath( $pathname ); - if ( $pathname !~ m#..*/# ) { - $pathname = $pathname . '/'; + if ($filename eq "") { + return undef; + } + if ($filename =~ m/\/$/) { + return undef; } - open(DIRLIST, "git-ls-tree $treeid $pathname |") or die "Cannot open git-ls-tree $treeid $pathname"; - while( <DIRLIST> ) { - if ( m/(\d+)\s(\w+)\s([[:xdigit:]]+)\t(.*)/ ) { - my ($entrymode, $entrytype, $objectid, $entryname) = ($1,$2,$3,$4); - - # Weed out things to ignore - foreach my $ignoredir ($config->{ignoredirs}) { - next if $entryname eq $ignoredir; - } - - next if $entryname =~ /^\.$/; - next if $entryname =~ /^\.\.$/; + my $repo = Git->repository (Directory => "$self->{'rootpath'}"); + my $lastcommitline = $repo->command_oneline ("log", "--max-count=1", "--pretty=oneline", "$release", "--", "$filename"); + if ($lastcommitline =~ m/([[:xdigit:]]+) /) { + my $commithash = $1; - if ($entrytype eq "blob") { - push(@files, $entryname); - - } elsif ($entrytype eq "tree") { - push(@dirs, "$entryname/"); - #push(@dirs, "$entryname"); + my (@fh, $c) = $repo->command ("cat-file", "commit", "$commithash"); + foreach my $line (@fh) { + if ($line =~ m/^author .* <.*> (\d+) .[0-9]{4}$/) { + return $1; } } + return undef; } - close(DIRLIST); - - return sort(@dirs), sort(@files); -} -# This function should not be used outside this module -# except for printing error messages -# (I'm not sure even that is legitimate use, considering -# other possible File classes.) - -##sub toreal { -## my ($self, $pathname, $release) = @_; -## -## nearly all (if not all) method calls eventually call toreal(), so this is a good place to block file access -## foreach my $ignoredir ($config->ignoredirs) { -## return undef if $pathname =~ m|/$ignoredir/|; -## } -## -## return ($self->{'rootpath'} . $release . $pathname); -##} - -sub isdir { - my ($self, $pathname, $release) = @_; - - $pathname = $self->sanitizePath ($pathname); - $release = $self->get_newest_commit_from_branchhead_or_tag ($release); - - print STDERR "isdir ($pathname, $release)\n"; - - my $treeid = $self->get_treehash_for_branchhead_or_tag ($release); - - return $self->getObjectType ($pathname, $treeid) eq "tree"; -} - -sub isfile { - my ($self, $pathname, $release) = @_; - - $pathname = $self->sanitizePath ($pathname); - $release = $self->get_newest_commit_from_branchhead_or_tag ($release); - - print STDERR "isfile($pathname, $release)\n"; - - my $treeid = $self->get_treehash_for_branchhead_or_tag ($release); - - return $self->getObjectType ($pathname, $treeid) eq "blob"; -} - -# -# For a given commit (that is, the latest commit on a named branch or -# a tag's name) return the tree object's hash corresponding to it. -# -sub get_treehash_for_branchhead_or_tag () { - my ($self, $release) = @_; - $release = $self->get_newest_commit_from_branchhead_or_tag ($release); - - return `git-cat-file commit $release | grep '^tree' | head -n1 | cut -f 2 -d ' ' | tr -d \$'\n'`; + return undef; } -sub getObjectType() { - my ($self, $pathname, $treeid) = @_; - - open (DIRLIST, "git-ls-tree $treeid $pathname |") or die "Cannot open git-ls-tree $treeid $pathname"; - while (<DIRLIST>) { - if (m/(\d+)\s(\w+)\s([[:xdigit:]]+)\t(.*)/) { - my ($entrymode, $entrytype, $objectid, $entryname) = ($1, $2, $3, $4); - - # Weed out things to ignore -# # This should only be needed in the getdir function. -# foreach my $ignoredir ($config->{ignoredirs}) { -# next if $entryname eq $ignoredir; -# } +sub getfilehandle { + my ($self, $filename, $release) = @_; + my $repo = Git->repository (Directory => "$self->{'rootpath'}"); - $entryname = $self->sanitizePath ($entryname); + $filename =~ s/^\///; -# print STDERR "getBlobOrTreeOfPathAndTree: pathname: \"$pathname\" :: entryname: \"$entryname\"\n"; - next if ( ! $pathname eq $entryname ); + my $sha1hashline = $repo->command_oneline ("ls-tree", "$release", "$filename"); - close (DIRLIST); -# print STDERR "Juhu, wir haben $pathname gefunden :: $objectid\n"; - return $entrytype; - } + if ($sha1hashline =~ m/^\d+ blob ([[:xdigit:]]+)\t.*/) { + my ($fh, $c) = $repo->command_output_pipe ("cat-file", "blob", "$1"); + return $fh; } - close (DIRLIST); return undef; } -sub getBlobOrTreeOfPathAndTree() { - my ($self, $pathname, $treeid ) = @_; - - open (DIRLIST, "git-ls-tree $treeid $pathname |") or die "Cannot open git-ls-tree $treeid $pathname"; - while (<DIRLIST>) { - if (m/(\d+)\s(\w+)\s([[:xdigit:]]+)\t(.*)/) { - my ($entrymode, $entrytype, $objectid, $entryname) = ($1, $2, $3, $4); +sub getannotations { + my ($self, $filename, $release) = @_; - # Weed out things to ignore - foreach my $ignoredir ($config->{ignoredirs}) { - next if $entryname eq $ignoredir; - } + if ($self->{'do_annotations'}) { + my $repo = Git->repository (Directory => "$self->{'rootpath'}"); + my @revlist = (); + $filename =~ s/^\///; - $entryname = $self->sanitizePath( $entryname ); - next if (! $pathname eq $entryname ); + my (@lines, $c) = $repo->command ("blame", "-l", "$release", "--", "$filename"); - close (DIRLIST); - return $objectid; + foreach my $line (@lines) { + if ($line =~ m/^([[:xdigit:]]+) .*/) { + push (@revlist, $1); + } else { + push (@revlist, ""); + } } - } - close (DIRLIST); - - return undef; -} - -# -# This function will take a branch name ("master") or a tag name -# (like "v2.6.15") and return either the branch commit object ID, -# or descend from the tag object into the referenced commit object -# and return its commit ID. XXX -# -sub get_newest_commit_from_branchhead_or_tag ($$) { - my ($self, $head_or_tag) = @_; - my $objtype = `git-cat-file -t $head_or_tag | tr -d \$'\n'`; - if ($objtype eq "commit") { - return $head_or_tag; - } elsif ($objtype eq "tag") { - return `git-cat-file tag $head_or_tag | grep '^object' | head -n1 | cut -f 2 -d ' ' | tr -d \$'\n'`; + return @revlist; } else { - die ("get_newest_commit_from_branchhead_or_tag: Unrecognized object type $objtype for $head_or_tag\n"); + return (); } } -sub sanitizePath() { - my ($self, $pathname) = @_; +sub getauthor { + my ($self, $pathname, $release) = @_; - if ( $pathname eq "" ) { - # Empty? Just beam the client to the root. - $pathname = "."; - } elsif ( $pathname =~ m#^/# ) { - # Absolute? We want them to be relative! - $pathname = ".$pathname"; - } else { - # Filename incurrent directory? Add "./" to - # make them truly relative. - $pathname = "./$pathname"; - } + # + # Note that $release is a real commit this time + # (returned by getannotations() above). This is + # _not_ a tag name! + # - # Don't let them exploit us easily. -# if ( $pathname =~ m#/../# ) { -# die("You are now dead because of $pathname\n"); -# } + if ($self->{'do_blame'}) { + my $repo = Git->repository (Directory => "$self->{'rootpath'}"); + my @authorlist = (); - # Doubled slashes? We remove them. - $pathname =~ s#//#/#g; + $pathname =~ s/^\///; - # Delete leading slashes. - $pathname =~ s#/*$##g; + my (@lines, $c) = $repo->command ("cat-file", "commit", "$release"); + foreach my $line (@lines) { + if ($line =~ m/^author (.*) </) { + return $1 + } + } - return $pathname; + return undef; + } + + return undef; } 1; |
From: Jan-Benedict G. <jb...@us...> - 2006-12-20 19:49:34
|
Update of /cvsroot/lxr/lxr/lib/LXR/Files In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv32478/lib/LXR/Files Modified Files: BK.pm Log Message: Fix some more whitespace. Index: BK.pm =================================================================== RCS file: /cvsroot/lxr/lxr/lib/LXR/Files/BK.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- BK.pm 20 Dec 2006 19:48:52 -0000 1.3 +++ BK.pm 20 Dec 2006 19:49:29 -0000 1.4 @@ -149,7 +149,7 @@ sub openbkcommand { my ($self, $command) = @_; - my $dir = getcwd(); + my $dir = getcwd(); chdir($self->{'rootpath'}); my $fileh = new IO::File; $fileh->open($command) or die "Can't execute $command"; @@ -238,12 +238,12 @@ sub get_tree { my ($self, $release) = @_; - + # Return entire tree as provided by 'bk rset' # First, check if cache exists - + my $fileh = new IO::File; - + if (-r $self->cachename($release)) { $fileh->open($self->cachename($release)) or die "Whoops, can't open cached version"; } else { @@ -261,7 +261,7 @@ $fileh->open($self->cachename($release)) or die "Couldn't open cached version!"; } } - + my @files = <$fileh>; close $fileh; chomp @files; @@ -276,7 +276,7 @@ my ($self, $release) = @_; return $self->{'cache'}."/treecache-".$release; } - + sub canonise { my $path = shift; $path =~ s!^/!!; |
From: Jan-Benedict G. <jb...@us...> - 2006-12-20 19:48:55
|
Update of /cvsroot/lxr/lxr/lib/LXR/Files In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv32097/lib/LXR/Files Modified Files: BK.pm Log Message: Add \n to the end of the last line. Index: BK.pm =================================================================== RCS file: /cvsroot/lxr/lxr/lib/LXR/Files/BK.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- BK.pm 2 Nov 2005 23:39:55 -0000 1.2 +++ BK.pm 20 Dec 2006 19:48:52 -0000 1.3 @@ -302,4 +302,4 @@ return $tree_cache{$release}{$path}{$file}; } -1; \ No newline at end of file +1; |