lxr-commits Mailing List for LXR Cross Referencer (Page 27)
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...> - 2002-02-03 08:12:56
|
Update of /cvsroot/lxr/lxr/lib/LXR/Files
In directory usw-pr-cvs1:/tmp/cvs-serv32307
Modified Files:
Plain.pm
Log Message:
Fix bug in tmp filename generation so that if two tmpfiles are generated in
the same second they don't use the same filename.
Fix from Alexander Schuettelkopf.
Index: Plain.pm
===================================================================
RCS file: /cvsroot/lxr/lxr/lib/LXR/Files/Plain.pm,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- Plain.pm 2001/08/15 15:50:27 1.16
+++ Plain.pm 2002/02/03 08:12:53 1.17
@@ -22,6 +22,7 @@
use strict;
use FileHandle;
+use LXR::Common;
sub new {
my ($self, $rootpath) = @_;
@@ -74,10 +75,15 @@
sub tmpfile {
my ($self, $filename, $release) = @_;
- my ($tmp);
+ my ($tmp, $tries);
local ($/) = undef;
- $tmp = '/tmp/lxrtmp.'.time.'.'.$$;
+ $tmp = $config->tmpdir.'/lxrtmp.'.time.'.'.$$;
+ $tries=0;
+ while ( -e $tmp.$tries) {
+ $tries++;
+ }
+ $tmp.=$tries;
open(TMP, "> $tmp") || return undef;
open(FILE, $self->toreal($filename, $release)) || return undef;
print(TMP <FILE>);
|
|
From: Malcolm B. <mb...@us...> - 2002-02-03 07:14:29
|
Update of /cvsroot/lxr/lxr In directory usw-pr-cvs1:/tmp/cvs-serv23114 Modified Files: CHANGELOG Log Message: Index: CHANGELOG =================================================================== RCS file: /cvsroot/lxr/lxr/CHANGELOG,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- CHANGELOG 2002/01/19 07:23:26 1.1 +++ CHANGELOG 2002/02/03 07:14:26 1.2 @@ -1,77 +1,788 @@ -2001-10-23 mbox +2002-02-03 05:31 mbox - * /cvsroot/lxr/lxr/lib/LXR/Tagger.pm: Remove obsolete code + * find, search, templates/lxr.conf: Change dbdir config variable to + glimpsedir - * /cvsroot/lxr/lxr/templates/html-tail.html: - Updated valid HTML logo to point to W3C's validator and the HTML 4.01 logo +2002-01-23 15:52 mbox -2001-10-17 mbox + * INSTALL, genxref, search, templates/lxr.conf: Add ability to use + swish-e as a free-text search engine, rather than Glimpse. Swish-e + is fully free software, unlike Glimpse. + + Patch from Arne. - * /cvsroot/lxr/lxr/lib/LXR/Index/Mysql.pm: Fix typo in if() expression +2002-01-23 15:48 mbox -2001-10-17 pergj + * lib/LXR/Index/Postgres.pm: Make sure all sql statements are + undef'ed to prevent warnings from Pg.pm - * /cvsroot/lxr/lxr/source: Fix accidentially added libpath. +2002-01-23 15:14 mbox -2001-10-16 pergj + * CREDITS.txt, INSTALL: Updated INSTALL document from Guido Sohne. - * /cvsroot/lxr/lxr/diff, /cvsroot/lxr/lxr/find, /cvsroot/lxr/lxr/ident, /cvsroot/lxr/lxr/lib/LXR/Common.pm, /cvsroot/lxr/lxr/search, /cvsroot/lxr/lxr/source: - Clean up after httpinit +2002-01-23 14:59 mbox - * /cvsroot/lxr/lxr/lib/LXR/Index/Mysql.pm, /cvsroot/lxr/lxr/templates/lxr.conf: - Database password and user can now be specified in lxr.conf + * lib/LXR/Lang.pm, templates/lxr.conf: Add mapping from interpreter + names to languages. If the file extension does not select a + language, then the first line of the file is checked for a #! If + one is found, then the interpreter name is matched against the + 'interpreters' map in lxr.conf, and the relevant language module + loaded. -2001-09-28 mbox +2002-01-23 08:16 mbox - * /cvsroot/lxr/lxr/CREDITS.txt: Credit the right person :-) + * templates/lxr.conf: Fix bug #506845: Missing variable in lxr.conf + + Added $dbdir to the lxr.conf template. - * /cvsroot/lxr/lxr/templates/html-head.html: - Fix HTML to be 4.01 Transitional compliant +2002-01-23 08:12 mbox - * /cvsroot/lxr/lxr/templates/lxr.css: - Adding missing file for CSS support + * lib/LXR/Lang.pm: Fix bug 506627: Excessive memory usage. Rather + than read the whole file into memory to determine if it is a + script, get a filehandle to it and retrieve the first line. This + may still mean the whole file ends up in memory "under the hood", + depending on the implementation of the individual backends, but + with Plain.pm it doesn't. -2001-09-27 mbox +2002-01-19 07:23 mbox - * /cvsroot/lxr/lxr/templates/html-dir.html, /cvsroot/lxr/lxr/templates/html-head.html, /cvsroot/lxr/lxr/templates/html-ident.html, /cvsroot/lxr/lxr/templates/lxr.conf, /cvsroot/lxr/lxr/.cvsignore, /cvsroot/lxr/lxr/diff, /cvsroot/lxr/lxr/find, /cvsroot/lxr/lxr/ident, /cvsroot/lxr/lxr/lib/LXR/Common.pm, /cvsroot/lxr/lxr/lib/LXR/Lang.pm, /cvsroot/lxr/lxr/lib/LXR/Lang/Perl.pm, /cvsroot/lxr/lxr/search, /cvsroot/lxr/lxr/source: - Apply patch 458027 from Pavel Hlavnicka + * BUGS, CHANGELOG: [no log message] - Adds stylesheet (CSS) support to ident, source and diff. +2002-01-19 07:20 mbox - Output style is now controllable from via the lxr.css stylesheet (example - provided in templates). Ident output now generated via a template rather - than hard coded. + * lib/LXR/Lang/generic.conf: Fix emacs modeline - Minor additional fixes by me result in the output of ident & source both - validating as HTML 4.01 Transitional. +2001-12-06 14:36 mbox - * /cvsroot/lxr/lxr/lib/LXR/Lang/generic.conf: Fix typo + * lib/LXR/Lang/Generic.pm: Fix error message - * /cvsroot/lxr/lxr/lib/LXR/Lang/generic.conf: - Patched to add support for PHP (thanks to ta...@us...) +2001-11-28 13:04 mbox - * /cvsroot/lxr/lxr/CREDITS.txt: - Added a CREDITS file to acknowledge and thank all those who have helped - create the lxr. + * .htaccess, CREDITS.txt: Updated CREDITS. Added lib to the INC + path from the .htaccess file. This should solve the Can't find + errors that occur under mod_perl -2001-09-26 mbox +2001-11-28 13:01 mbox - * /cvsroot/lxr/lxr/initdb-mysql, /cvsroot/lxr/lxr/initdb-postgres: - Dramatically speed up (>50 times) the speed of incremental indexing by - creating an index to allow the fileid to be looked up fast from the filename. + * lib/LXR/Lang.pm: Add error output if require fails. - Ideally this index would include the revision as well, but this is not - possible in MySQL because of limits (500 chars) on the index key. +2001-11-28 12:59 mbox - Tested on MySQL, but not on postgres. + * lib/LXR/Lang/Generic.pm: Apply speedup patch from Arne. + + Makes Generic.pm only read the config file once, and then share the + info between instances. + +2001-11-28 12:59 mbox + + * initdb-postgres, lib/LXR/Index/Postgres.pm: Applied Postgres + fixes from Kristoffer Gleditsch <to...@pi...> + +2001-11-20 15:34 mbox + + * ident: Remove pre-CSS & template code + +2001-11-18 03:31 mbox + * ident, initdb-mysql, initdb-postgres, lib/LXR/Common.pm, + lib/LXR/Index/Mysql.pm, lib/LXR/Index/Postgres.pm, + lib/LXR/Lang/Generic.pm, lib/LXR/Lang/generic.conf, + templates/html-ident.html, templates/lxr.conf: Fix bug 476695 - + Java interfaces display as docs. Changes the type field in the + indexes table to be a (langid, typeid) tuple, and adds another + table to look up the (langid, typeid) -> string mapping. This + means that each language module can manage its own string table and + the right identifier type can easily be displayed. + + This also means that each identifier is tagged with the language it + occurs in, which could be used for filtering displayed results when + browsing. This has not been implemented. + + This change is database incompatible - you will need to drop and + recreate the lxr database. MySQL has been tested, Postgres has not + though the changes have been made. + + Also add some limited support for Makefile in generic.conf. + +2001-11-17 04:00 mbox + + * lib/LXR/Lang/Generic.pm: Fix bug with referencing files due to + omitting a parameter to SimpleParse::init + +2001-11-17 03:48 mbox + + * templates/html-head.html: Remove reference to "Cross referencing + Linux" and replaced with more generic header line. Still to do: + Create a LXR logo and replace the pengmini.gif with it + +2001-11-17 03:06 mbox + + * lib/LXR/Common.pm: Fix bug with configurable tabwidth and files + that have no language associated with them. + + Remove the stat-ing of all the included modules when generating a + Last-Modified header. This should speed up HTML generation since + there are a lot of modules and they change very rarely. + +2001-11-14 15:41 mbox + + * lib/LXR/Index/Mysql.pm: Make Mysql insert statements less fragile + if fields are moved/renamed in db. Fixes bug #426646 + +2001-11-14 15:27 mbox + + * lib/LXR/Lang/Java.pm, lib/LXR/Lang/generic.conf, + templates/lxr.conf: Adds proper import/package hyperlinking for + Java. Fixes bug #447979 + + Also fixes problem with the example lxr.conf and the new tabwidth + code + +2001-11-14 15:03 mbox + + * lib/LXR/: Common.pm, Lang.pm, SimpleParse.pm, Lang/Generic.pm, + Lang/generic.conf: Make tabwidth to use for display configurable on + a per-language basis from the lxr.conf file. As before, this is + still overridden by an emacs "tab-width" line. + +2001-10-31 13:21 mbox + + * lib/LXR/Common.pm: Quick temporary fix for bug 476695 + +2001-10-23 15:23 mbox + + * source: Restored "use lib do..." line at start. This appears to + be working properly and allows mod_perl to find the LXR files + without any other setup + +2001-10-23 14:30 mbox + + * lib/LXR/Tagger.pm: Remove obsolete code + +2001-10-23 14:05 mbox + + * templates/html-tail.html: Updated valid HTML logo to point to + W3C's validator and the HTML 4.01 logo + +2001-10-17 23:52 mbox + + * lib/LXR/Index/Mysql.pm: Fix typo in if() expression + +2001-10-17 06:52 pergj + + * source: Fix accidentially added libpath. + +2001-10-16 20:38 pergj + + * diff, find, ident, search, source, lib/LXR/Common.pm: Clean up + after httpinit + +2001-10-16 20:25 pergj + + * lib/LXR/Index/Mysql.pm, templates/lxr.conf: Database password and + user can now be specified in lxr.conf + +2001-09-28 14:31 mbox + + * CREDITS.txt: Credit the right person :-) + +2001-09-28 14:22 mbox + + * templates/html-head.html: Fix HTML to be 4.01 Transitional + compliant + +2001-09-28 13:48 mbox + + * templates/lxr.css: Adding missing file for CSS support + +2001-09-27 16:12 mbox + + * .cvsignore, diff, find, ident, search, source, lib/LXR/Common.pm, + lib/LXR/Lang.pm, lib/LXR/Lang/Perl.pm, templates/html-dir.html, + templates/html-head.html, templates/html-ident.html, + templates/lxr.conf: Apply patch 458027 from Pavel Hlavnicka + + Adds stylesheet (CSS) support to ident, source and diff. + + Output style is now controllable from via the lxr.css stylesheet + (example provided in templates). Ident output now generated via a + template rather than hard coded. + + Minor additional fixes by me result in the output of ident & source + both validating as HTML 4.01 Transitional. + +2001-09-27 15:59 mbox + + * lib/LXR/Lang/generic.conf: Fix typo + +2001-09-27 15:24 mbox + + * lib/LXR/Lang/generic.conf: Patched to add support for PHP (thanks + to ta...@us...) + +2001-09-27 15:02 mbox + + * CREDITS.txt: Added a CREDITS file to acknowledge and thank all + those who have helped create the lxr. + +2001-09-26 14:47 mbox + + * initdb-mysql, initdb-postgres: Dramatically speed up (>50 times) + the speed of incremental indexing by creating an index to allow the + fileid to be looked up fast from the filename. + + Ideally this index would include the revision as well, but this is + not possible in MySQL because of limits (500 chars) on the index + key. + + Tested on MySQL, but not on postgres. + Fixes bug 465131 - * /cvsroot/lxr/lxr/genxref: - Replace use of direct access of range variable v with the correct - varrange accessor +2001-09-26 14:42 mbox -2001-08-16 mbox + * genxref: Replace use of direct access of range variable v with + the correct varrange accessor - * /cvsroot/lxr/lxr/.cvsignore: - Ignore the template & conf files of the user +2001-08-16 00:36 mbox + + * .cvsignore: Ignore the template & conf files of the user + +2001-08-15 16:19 mbox + + * lib/LXR/Lang/: C.pm, Java.pm: Remove C.pm and Java.pm. Java.pm + was badly broken anyway, and C.pm is subsumed by Generic.pm. + Perl.pm & Python.pm left for now... + +2001-08-15 15:50 mbox + + * LICENSE, Local.pm, genxref, lib/LXR/Common.pm, lib/LXR/Config.pm, + lib/LXR/Files.pm, lib/LXR/Index.pm, lib/LXR/Lang.pm, + lib/LXR/SimpleParse.pm, lib/LXR/Tagger.pm, lib/LXR/Files/CVS.pm, + lib/LXR/Files/Plain.pm, lib/LXR/Index/DB.pm, lib/LXR/Index/DBI.pm, + lib/LXR/Index/Mysql.pm, lib/LXR/Index/Postgres.pm, + lib/LXR/Lang/C.pm, lib/LXR/Lang/Generic.pm, lib/LXR/Lang/Java.pm, + lib/LXR/Lang/Perl.pm, lib/LXR/Lang/Python.pm: Add GNU Copyright + notices to all files, and added a copy of the GPL in the LICENSE + file + +2001-08-15 15:27 mbox + + * lib/LXR/Tagger.pm: Fix memory leak in genxref by undef'ing + variables + +2001-08-14 14:44 mbox + + * lib/LXR/Lang/Generic.pm: Close filehandle for config file when + we're finished with it + +2001-08-14 14:18 mbox + + * lib/LXR/: Index/Mysql.pm, Index/Postgres.pm, Lang/C.pm: Remove + unused Index::removesymbol method + +2001-08-14 13:48 mbox + + * genxref: Fixed bug 450660: genxref locks up. Use a lexical + variable for the loop index when iterating over versions + +2001-08-04 19:09 mbox + + * lib/LXR/Index/Mysql.pm: Move the database handle and the sql + statements into member variables rather than as global (package) + variables. Add a DESTROY block to clean things up when the object + dies. This fixes the Mysql warnings bug. + +2001-08-04 18:53 mbox + + * INSTALL, lxr.conf.template, templ-lxr-dir, templ-lxr-head, + templ-lxr-search, templ-lxr-tail, template-dir, template-head, + template-source-head, template-sourcedir-head, template-tail, + templates/html-dir.html, templates/html-head.html, + templates/html-search.html, templates/html-tail.html, + templates/lxr.conf: Apply patch [ #432667 ] template usability + patch which moves all the templates to a template directory and + renames them sensibly. + +2001-08-04 18:27 mbox + + * lib/LXR/Lang/C.pm: Applied patch [ #446603 ] ectags deprecated + --lang option + +2001-08-04 17:57 mbox + + * template-head, template-source-head, template-sourcedir-head: + Update the templates to point to the sourceforge website rather + than the lxr.linux.no one. + +2001-08-04 17:54 mbox + + * Local.pm, source: Remove redundant use declaration + +2001-08-04 17:53 mbox + + * lxr.conf.template: Added configuration for which files use which + Lang module. Set to use Generic.pm for all languages, replacing + C.pm, Java.pm and Perl.pm. This fixes the C++ problems and the + Java browsing now works. Added configuration for what files are + considered an image. + +2001-08-04 17:45 mbox + + * lib/LXR/Lang.pm: Determination of the language for a particular + file is now controlled by the lxr.conf file. Added processinclude + to the class so that all languages have include processing. + +2001-08-04 17:42 mbox + + * lib/LXR/Index.pm: Improvement to the error reporting when a db + can't be found + +2001-08-04 17:41 mbox + + * lib/LXR/Common.pm: Change the determination of whether a file is + an image or not to a be configurable regexp rather than hardcoding. + +2001-08-04 17:39 mbox + + * lib/LXR/Lang/: Generic.pm, generic.conf: Update of the language + info file. Make referencefile() work - although this is currently + hardcoded as to what it assumes might be an identifier, rather than + on a per-language basis. Currently the identifier must start with + a letter and then be alphanumeric + _ No longer hyperlink a + reserved word in the current language, since with multi-language + projects a reserved word from one language can be a valid symbol in + another. + +2001-08-04 16:22 mbox + + * genxref: Fix the allversions problem. For Plain.pm, the use of + $files->getdir() in the recursive loop wasn't working, since at + that $files->point no version was specified. + + The fix is to iterate over the versions at the top level, using the + range variable from the config file to specify which versions are + to be indexed if the --allversions option (or none) is given. + Because the value of "range" can be a closure, this should allow + the CVS users to dynamically discover the set of versions in a + repository. + +2001-08-02 11:45 pok + + * lib/LXR/Files/CVS.pm: I hate global variables. %cvs was not + reset when a new file was parsed, leaving old data in the hash. + +2001-08-01 10:59 pok + + * genxref: Changed the behaviour of genxref back to prevoius + behaviour, where each file is queried for its versions. + +2001-08-01 08:08 pok + + * lib/LXR/Files/CVS.pm: typo in sub filerev. caused wrong versions + to be checked out when using a symbolic releasetag containing + digits. + +2001-07-30 21:22 pergj + + * search: Applied patch #438564: Bug fix for bug 438492 (Glimpse + returns the wrong results) + +2001-07-30 20:30 pergj + + * lib/LXR/Files/CVS.pm: Better error messages when rcs is not + installed. + +2001-07-26 10:21 pok + + * lib/LXR/Common.pm: Trivial fix to display .png images. + +2001-07-26 08:49 pok + + * initdb, initdb-mysql, initdb-postgres, lxr.conf.template, + lib/LXR/Config.pm, lib/LXR/Lang.pm, lib/LXR/Tagger.pm, + lib/LXR/Files/CVS.pm, lib/LXR/Index/Postgres.pm: Updated definition + of releases table, added new method of specifying range variables, + fixed #!-parsing, bugfixes in postgres module, and massive changes + to CVS.pm. All this in order to get indexing of CVS trees to work. + +2001-07-03 15:42 mbox + + * genxref: Patch from jdoje to make --allversions work and to + provide help. + +2001-07-03 14:46 mbox + + * lib/LXR/Lang/: Generic.pm, generic.conf: More work on the generic + language support. More things are now handled in a language + dependant way, configured from generic.conf. + +2001-06-17 08:35 mbox + + * lib/LXR/Lang/: Generic.pm, generic.conf: Initial versions of + generic language support based on ectags. The Generic.pm module + should be able to cope with any language that ectags can cope with + with only small alterations to the generic.conf file. + + This module is not yet hooked up in Lang.pm, so it's not used by + genxref. + +2001-05-31 14:45 mbox + + * INSTALL, lib/LXR/Common.pm, lib/LXR/Index.pm, + lib/LXR/Index/Mysql.pm: Removes the popup of new browsing windows + when selecting identifiers/searches. Updates for the INSTALL + guide. Make an explicit error if we can't find the right DB, + rather than trying to fall back to DBM and ending up with an + obscure message. Added more finish() statements to MySQL.pm in an + attempt to remove the warning about closing handle before + disconnect - not yet cured. + +2001-05-23 05:33 mbox + + * initdb-mysql: Fix missing ; in initdb-mysql + +2001-05-23 01:08 mbox + + * lib/LXR/Index/Mysql.pm: Changed the useage join to be more + efficient on MySQL. Also added a finish() call to close a handle + after use, which may help with mem leaks. + +2001-05-22 15:11 mbox + + * initdb-mysql: Restore indexes in MySQL schema to speed the ident + function + +2001-01-07 19:37 pergj + + * lib/LXR/Common.pm: Patch from Hendrik Ruijter, .hpp files are now + handled as C-language files + +2000-10-31 12:52 argggh + + * .htaccess, Local.pm, diff, find, genxref, ident, search, source, + lib/LXR/Common.pm, lib/LXR/Index.pm, lib/LXR/Tagger.pm, + lib/LXR/Files/Plain.pm, lib/LXR/Index/DB.pm, + lib/LXR/Index/Postgres.pm, lib/LXR/Lang/C.pm: [no log message] + +2000-09-04 19:26 pergj + + * find, genxref, ident, initdb-mysql, search, template-source-head, + lib/LXR/Common.pm, lib/LXR/Config.pm, lib/LXR/Index/Mysql.pm, + lib/LXR/Index/Postgres.pm, lib/LXR/Lang/C.pm: Reserved c-keywords + are now removed from the database Fixed a problem with error + reporting find and search will now run, but won't work correctly + mysql backend is no longer case insensitive + +2000-08-17 18:36 pergj + + * genxref, lib/LXR/SimpleParse.pm, lib/LXR/Tagger.pm, + lib/LXR/Index/Mysql.pm, lib/LXR/Lang/C.pm: Now seems to work using + the MySQL backend and plain files. + +2000-07-26 19:12 pergj + + * lib/LXR/Index/DBI.pm: Fixed typo + +2000-07-26 07:50 pergj + + * lib/LXR/: Tagger.pm, Index/DBI.pm, Index/Postgres.pm, Lang/C.pm: + Added debugging output from Garry Lawrence Murphy + +2000-01-05 07:54 pergj + + * notes, lib/LXR/Config.pm: Added a simple error check. + +1999-12-25 21:58 pergj + + * genxref, ident, initdb-mysql, initdb-postgres, lib/LXR/Lang.pm, + lib/LXR/SimpleParse.pm, lib/LXR/Tagger.pm, lib/LXR/Index/DBI.pm, + lib/LXR/Index/Mysql.pm, lib/LXR/Index/Postgres.pm, + lib/LXR/Lang/C.pm: Backends for different database systems are now + in separate files. I have mostly been working on the mysql + backend. Some memory leaks have also been fixed. I think there are + still some left. The genxref process should not grow as much as it + does now. + +1999-11-24 14:48 argggh + + * lib/LXR/Files/CVS.pm: Minor cleanup in CVS code. + +1999-09-24 20:46 pergj + + * INSTALL, genxref, lib/LXR/Files/Plain.pm: A little more docs, and + fixes for annotations in Plain.pm + +1999-09-22 10:32 argggh + + * fixhashbang, source, lib/LXR/Common.pm, lib/LXR/Lang.pm: Minor + changes. + +1999-09-18 10:27 argggh + + * lib/: SimpleParse.pm, LXR/Common.pm, LXR/SimpleParse.pm, + LXR/Lang/C.pm: Moved SimpleParse. + +1999-09-18 10:20 argggh + + * source, lib/LXR/Common.pm, lib/LXR/Lang.pm, lib/LXR/Files/CVS.pm, + lib/LXR/Lang/Perl.pm: Annotation stuff; Perl fixes. + +1999-09-17 16:33 argggh + + * fixhashbang, genxref, ident, source, lib/LXR/Files/CVS.pm: CVS + annotations. + +1999-09-17 09:37 argggh + + * genxref, ident, initdb, source, lib/SimpleParse.pm, + lib/LXR/SimpleParse.pm, lib/LXR/Common.pm, lib/LXR/Config.pm, + lib/LXR/Lang.pm, lib/LXR/Tagger.pm, lib/LXR/Index/DBI.pm, + lib/LXR/Lang/C.pm, lib/LXR/Lang/Java.pm, lib/LXR/Lang/Perl.pm, + lib/LXR/Lang/Python.pm: Various changes. Usage statistics getting + there. + +1999-08-19 22:13 argggh + + * initdb, lib/LXR/Index/DBI.pm: Some DBI fixes. + +1999-08-19 14:05 argggh + + * source, lib/LXR/Common.pm, lib/LXR/Lang.pm: Minor fixes. + +1999-08-17 18:35 argggh + + * genxref, ident, lib/LXR/Common.pm, lib/LXR/Lang.pm, + lib/LXR/Tagger.pm, lib/LXR/Index/DB.pm: More Perl changes. + +1999-08-07 18:15 argggh + + * source, lib/SimpleParse.pm, lib/LXR/SimpleParse.pm, + lib/LXR/Common.pm, lib/LXR/Config.pm, lib/LXR/Index.pm, + lib/LXR/Lang.pm: POD stuff, comment handling generalization. + +1999-08-04 09:04 argggh + + * lib/LXR/: Common.pm, Config.pm, Lang.pm, Files/CVS.pm: Perl + support stuff. + +1999-06-20 12:10 argggh + + * lib/LXR/Config.pm: Fixed LXR::Config properly. + +1999-06-17 08:39 pergj + + * lib/LXR/Config.pm: Fixed bug related to invoking genxref as "perl + genxref" + +1999-06-16 12:24 pergj + + * lib/LXR/Config.pm: Fixed error handling + +1999-06-16 09:17 pergj + + * HACKING, INSTALL, lxr.conf.template: Added some documentation + +1999-06-01 17:09 toffer + + * lib/LXR/Lang.pm: Testing commitinfo + +1999-06-01 16:49 toffer + + * initdb, lib/LXR/Lang.pm: More python. + +1999-06-01 11:52 toffer + + * lib/LXR/Lang.pm: Fixed conflicts + +1999-06-01 08:07 pergj + + * initdb, source, lib/LXR/Common.pm, lib/LXR/Config.pm, + lib/LXR/Lang.pm, lib/LXR/Tagger.pm, lib/LXR/Files/Plain.pm, + lib/LXR/Index/DBI.pm, initdb, source, lib/LXR/Common.pm, + lib/LXR/Config.pm, lib/LXR/Lang.pm, lib/LXR/Tagger.pm, + lib/LXR/Files/Plain.pm, lib/LXR/Index/DBI.pm: Fixed previous commit + +1999-06-01 06:44 pergj + + * initdb, source, lib/LXR/Config.pm, lib/LXR/Tagger.pm, + lib/LXR/Files/Plain.pm, lib/LXR/Index/DBI.pm: Testing new + datastructure on a separate branch + +1999-05-31 19:23 toffer + + * lib/LXR/: Common.pm, Lang.pm, Tagger.pm: The + python-crossreferencing is producing links (which is useless right + now, but still...) + +1999-05-29 23:34 argggh + + * genxref, lxr.conf.template, lib/LXR/Common.pm, lib/LXR/Config.pm, + lib/LXR/Files/CVS.pm, lib/LXR/Index/DBI.pm: allversions support + added for CVS backends. + +1999-05-29 19:38 argggh + + * lib/: SimpleParse.pm, LXR/SimpleParse.pm, LXR/Lang.pm: Fixed + sublte bug in SimpleParse + +1999-05-29 18:57 toffer + + * initdb, lib/LXR/Lang.pm, lib/LXR/Tagger.pm, + lib/LXR/Files/Plain.pm, lib/LXR/Index/DB.pm: Started working on + Python support. + +1999-05-28 11:59 pergj + + * lxr.conf-new, lxr.conf.template, lib/LXR/Config.pm: Moved + configuration to a template + +1999-05-27 14:44 toffer + + * lib/LXR/Files.pm: Plain files will now at least have a chance of + working + +1999-05-25 21:39 argggh + + * diff, source, lib/LXR/Common.pm, lib/LXR/Lang.pm, + lib/LXR/Files/CVS.pm, lib/LXR/Index/DBI.pm: diff works again. + +1999-05-25 19:33 argggh + + * diff, ident, lib/LXR/Index/DBI.pm: ident works again. + +1999-05-24 21:53 argggh + + * genxref, initdb, lxr.conf-new, source, lib/SimpleParse.pm, + lib/LXR/SimpleParse.pm, lib/LXR/Common.pm, lib/LXR/Lang.pm, + lib/LXR/Files/CVS.pm, lib/LXR/Files/Plain.pm, lib/LXR/Index/DB.pm, + lib/LXR/Index/DBI.pm: Cleaned up some more. CVS-support getting + stable. + +1999-05-22 14:41 argggh + + * genxref, source, lib/LXR/Tagger.pm, lib/LXR/Files/CVS.pm, + lib/LXR/Index/DBI.pm: Did some more CVS work. genxref seems to + work with CVS files now. + +1999-05-22 10:51 argggh + + * source, lib/LXR/Files.pm, lib/LXR/Files/CVS.pm: Minor changes. + +1999-05-21 13:16 argggh + + * lxr.conf-new, source, lib/LXR/Common.pm, lib/LXR/Files/CVS.pm: + Bulk of CVS support for files implemented. + +1999-05-20 22:37 argggh + + * lxr.conf-new, lxr.conf.template, lib/LXR/Files.pm, + lib/LXR/Files/CVS.pm: Started CVS support. + +1999-05-17 23:43 argggh + + * initdb, lib/LXR/Files/Plain.pm, lib/LXR/Index/DB.pm, + lib/LXR/Index/DBI.pm: Minor fixes. + +1999-05-16 23:48 argggh + + * Local.pm, lxr.conf-new, source, templ-lxr-tail, + lib/SimpleParse.pm, lib/LXR/SimpleParse.pm, lib/LXR/Common.pm, + lib/LXR/Config.pm, lib/LXR/Files.pm, lib/LXR/Index.pm, + lib/LXR/Lang.pm, lib/LXR/Tagger.pm, lib/LXR/Files/Plain.pm, + lib/LXR/Index/DB.pm, lib/LXR/Index/DBI.pm: More cleanups. + +1999-05-16 16:49 argggh + + * genxref, lxr.conf-new, source, lib/LXR/Common.pm, + lib/LXR/Config.pm, lib/LXR/Lang.pm, lib/LXR/Tagger.pm, + lib/LXR/Files/Plain.pm, lib/LXR/Index/DB.pm: More code cleanups. + +1999-05-16 09:53 argggh + + * Local.pm, source, lib/LXR/Common.pm, lib/LXR/Config.pm: More code + cleanups. + +1999-05-15 18:40 pergj + + * lib/LXR/Config.pm: Logging of cvs messages should now be in place + +1999-05-15 14:13 argggh + + * templ-lxr-dir, templ-lxr-head, templ-lxr-search, templ-lxr-tail: + Added the traditional LXR templates to the repository. + +1999-05-15 14:11 argggh + + * initdb, lxr.conf-new, source, lib/SimpleParse.pm, + lib/LXR/Common.pm, lib/LXR/SimpleParse.pm, lib/LXR/Config.pm, + lib/LXR/Files/Plain.pm: Did some profiling, reduced the time to + process drivers/block/floppy.c by more than half. + +1999-05-14 20:27 argggh + + * lib/LXR/Files.pm: [no log message] + +1999-05-14 17:31 argggh + + * Local.pm, lxr.conf-new, source, lib/LXR/Config.pm, + lib/LXR/Files/Plain.pm: More backend integration... + +1999-05-14 12:45 argggh + + * diff, genxref, lxr.conf-new, source, lib/SimpleParse.pm, + lib/LXR/Common.pm, lib/LXR/SimpleParse.pm, lib/LXR/Config.pm, + lib/LXR/Index.pm, lib/LXR/Tagger.pm, lib/LXR/Files/Plain.pm, + lib/LXR/Index/DBI.pm: Integrated the new backends a bit more. + +1999-05-13 22:57 argggh + + * Local.pm, genxref, lxr.conf-new, source, lib/LXR/Common.pm, + lib/LXR/Config.pm, lib/LXR/Tagger.pm: New configuration file layout + +1999-05-12 06:44 pergj + + * source, lib/LXR/Common.pm, lib/LXR/Files/Plain.pm: Things should + at least compile + +1999-05-11 20:50 pergj + + * Local.pm, genxref, lxr.conf, lxr.conf.template, source, + lib/LXR/Common.pm, lib/LXR/Config.pm, lib/LXR/Index.pm, + lib/LXR/Files/Plain.pm, lib/LXR/Index/DB.pm: Removed some obscure + perl-bugs It is better to use join than .= Started working on using + the new file scheme in source I do not know if this even compiles + at the moment. + +1999-05-11 16:32 pergj + + * genxref, lib/LXR/Index.pm: Forgot to add Index.pm + +1999-04-09 10:35 pergj + + * .htaccess, Local.pm, diff, find, genxref, ident, lxr.conf, + search, source, template-head, template-source-head, + template-sourcedir-head, lib/SimpleParse.pm, lib/LXR/Common.pm, + lib/LXR/SimpleParse.pm, lib/LXR/Config.pm, lib/LXR/Index/DB.pm, + lib/LXR/Index/DBI.pm: My changes from the easter + +1999-04-09 10:18 pergj + + * .htaccess, Local.pm, diff, find, genjavaclasses, genxref, ident, + initdb, lxr.conf, notes, search, source, template-dir, + template-head, template-source-head, template-sourcedir-head, + template-tail, lib/SimpleParse.pm, lib/LXR/SimpleParse.pm, + lib/LXR/Common.pm, lib/LXR/Config.pm, lib/LXR/JavaClassList.pm, + lib/LXR/Files/Plain.pm, lib/LXR/Index/DB.pm, lib/LXR/Index/DBI.pm: + Initial revision + +1999-04-09 10:18 pergj + + * .htaccess, Local.pm, diff, find, genjavaclasses, genxref, ident, + initdb, lxr.conf, notes, search, source, template-dir, + template-head, template-source-head, template-sourcedir-head, + template-tail, lib/SimpleParse.pm, lib/LXR/SimpleParse.pm, + lib/LXR/Common.pm, lib/LXR/Config.pm, lib/LXR/JavaClassList.pm, + lib/LXR/Files/Plain.pm, lib/LXR/Index/DB.pm, lib/LXR/Index/DBI.pm: + Imported sources + |
|
From: Malcolm B. <mb...@us...> - 2002-02-03 05:31:35
|
Update of /cvsroot/lxr/lxr/templates In directory usw-pr-cvs1:/tmp/cvs-serv8455/templates Modified Files: lxr.conf Log Message: Change dbdir config variable to glimpsedir Index: lxr.conf =================================================================== RCS file: /cvsroot/lxr/lxr/templates/lxr.conf,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- lxr.conf 2002/01/23 15:52:51 1.8 +++ lxr.conf 2002/02/03 05:31:33 1.9 @@ -104,7 +104,7 @@ # 'dbuser' => 'lxr', # For using glimpse, the directory to store the .glimpse files in is required - 'dbdir' => '/path/to/glimpse/databases', + 'glimpsedir' => '/path/to/glimpse/databases', # Location of swish-e index database files if using swish-e 'swishdir' => '/a/directory/here/', |
|
From: Malcolm B. <mb...@us...> - 2002-02-03 05:31:35
|
Update of /cvsroot/lxr/lxr
In directory usw-pr-cvs1:/tmp/cvs-serv8455
Modified Files:
find search
Log Message:
Change dbdir config variable to glimpsedir
Index: find
===================================================================
RCS file: /cvsroot/lxr/lxr/find,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- find 2001/10/16 20:38:37 1.6
+++ find 2002/02/03 05:31:32 1.7
@@ -53,7 +53,7 @@
if ($searchtext ne "") {
- unless (open(FILELLISTING,$config->dbdir."/.glimpse_filenames")) {
+ unless (open(FILELLISTING,$config->glimpsedir."/.glimpse_filenames")) {
&warning("Could not open .glimpse_filenames.");
return;
}
Index: search
===================================================================
RCS file: /cvsroot/lxr/lxr/search,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- search 2002/01/23 15:52:51 1.8
+++ search 2002/02/03 05:31:32 1.9
@@ -40,7 +40,7 @@
unless (open(GLIMPSE, "-|")) {
open(STDERR, ">&STDOUT");
$!='';
- exec($config->glimpsebin,"-i","-H".$config->dbdir,'-y','-n',$searchtext);
+ exec($config->glimpsebin,"-i","-H".$config->glimpsedir,'-y','-n',$searchtext);
print("Glimpse subprocess died unexpextedly: $!\n");
exit;
}
|
|
From: Malcolm B. <mb...@us...> - 2002-01-23 15:52:55
|
Update of /cvsroot/lxr/lxr/templates
In directory usw-pr-cvs1:/tmp/cvs-serv30089/templates
Modified Files:
lxr.conf
Log Message:
Add ability to use swish-e as a free-text search engine, rather than Glimpse.
Swish-e is fully free software, unlike Glimpse.
Patch from Arne.
Index: lxr.conf
===================================================================
RCS file: /cvsroot/lxr/lxr/templates/lxr.conf,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- lxr.conf 2002/01/23 14:59:21 1.7
+++ lxr.conf 2002/01/23 15:52:51 1.8
@@ -5,9 +5,22 @@
{
# Global configuration
- 'glimpsebin' => '/info/lxr/bin/glimpse', # Path to glimpse executable
- 'ectagsbin' => '/usr/bin/ctags', # Path to Exuberant Ctags executable
- 'tmpdir' => '/tmp', # Place where lxr can write temporary files
+ # Path to glimpse executable.
+ # Define this OR the swish-e variables depending which search engine you want to use.
+ 'glimpsebin' => '/info/lxr/bin/glimpse',
+
+ # Location of SWISH-E indexer binary
+ 'swishindex' => '/usr/local/bin/swish-e',
+
+ # Location of SWISH-E search binary
+ 'swishsearch' => '/usr/local/bin/swish-e',
+
+ # Path to Exuberant Ctags executable
+ 'ectagsbin' => '/usr/bin/ctags',
+
+ # Place where lxr can write temporary files
+ 'tmpdir' => '/tmp',
+
# Location of the Generic.pm config file
'genericconf' => '/path/to/lib/LXR/Lang/generic.conf'
@@ -78,6 +91,24 @@
# The name to display for this source tree
'sourcerootname' => 'Example',
+
+
+ # The DBI identifier for the database to use
+ # For mysql, the format is dbi:mysql:dbname=<name>
+ # for Postgres, it is dbi:Pg:dbname=<name>
+ 'dbname' => 'dbi:mysql:dbname=lxr',
+
+ # If you need to specify the username or password for the database connection,
+ # uncomment the following two lines
+ # 'dbpass' => 'foo',
+ # 'dbuser' => 'lxr',
+
+ # For using glimpse, the directory to store the .glimpse files in is required
+ 'dbdir' => '/path/to/glimpse/databases',
+
+ # Location of swish-e index database files if using swish-e
+ 'swishdir' => '/a/directory/here/',
+
# where to look for include files inside the sourcetree. This is used to hyperlink
# to included files.
@@ -158,16 +189,5 @@
'python' => 'Python',
},
- # The DBI identifier for the database to use
- # For mysql, the format is dbi:mysql:dbname=<name>
- # for Postgres, it is dbi:Pg:dbname=<name>
- 'dbname' => 'dbi:mysql:dbname=lxr',
-
- # If you need to specify the username or password for the database connection,
- # uncomment the following two lines
- # 'dbpass' => 'foo',
- # 'dbuser' => 'lxr',
- # For using glimpse, the directory to store the .glimpse files in is required
- 'dbdir' => '/path/to/glimpse/databases',
})
|
|
From: Malcolm B. <mb...@us...> - 2002-01-23 15:52:55
|
Update of /cvsroot/lxr/lxr In directory usw-pr-cvs1:/tmp/cvs-serv30089 Modified Files: INSTALL genxref search Log Message: Add ability to use swish-e as a free-text search engine, rather than Glimpse. Swish-e is fully free software, unlike Glimpse. Patch from Arne. Index: INSTALL =================================================================== RCS file: /cvsroot/lxr/lxr/INSTALL,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- INSTALL 2002/01/23 15:14:07 1.5 +++ INSTALL 2002/01/23 15:52:51 1.6 @@ -7,11 +7,14 @@ 2) A relational database - MySQL (http://www.mysql.com) and Postgresql (http://www.postgresql.org) are supported. + 3) Apache with mod_perl - http://www.apache.org -If you want to be able to do free text searchs of your repository as -well as browse it you will have to obtain and install glimpse from -http://glimpse.cs.arizona.edu +4) For freetext searching, either Glimpse (http://glimpse.cs.arizona.edu) or + Swish-e (http://swish-e.org). You need the development version of + swish-e (i.e. 2.1.x or later). + Swish-e is fully GPL'ed, while Glimpse is only free for + non-commercial use. Installing the database ----------------------- @@ -109,6 +112,24 @@ 'sourceroot' => 'cvs:/path/to/cvs/repository/lxr' 'sourcerootname' => 'A Friendly Name For Your Repository' + +Using Swish-e with LXR +---------------------- + +This is simple: + +1) Put the paths to swish-e and swish-search in the 'swishindex' and + 'swishsearch' variables in lxr.conf. If there is no swish-search + executable on your system, use the path to swish-e as the + 'swishsearch' value. + +2) Create a directory for the swish index files to go in, and put the + path of this directory in the 'swishdir' variable. + +3) Comment out the 'glimpsebin' variable + +Now re-run genxref and it should build the swish indexes for you and +you're done. Getting Glimpse to work with LXR -------------------------------- Index: genxref =================================================================== RCS file: /cvsroot/lxr/lxr/genxref,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- genxref 2001/09/26 14:42:57 1.24 +++ genxref 2002/01/23 15:52:51 1.25 @@ -19,6 +19,7 @@ use lib 'lib'; use Fcntl; use Getopt::Long; +use IO::Handle; use LXR::Files; use LXR::Index; @@ -78,6 +79,7 @@ foreach my $version (@versions) { genindex('/', $version); genrefs('/', $version); + gensearch($version); } @@ -109,4 +111,42 @@ &LXR::Tagger::processrefs($pathname, $release, $config, $files, $index) } +} + +sub feedswish { + my ($pathname, $release, $swish) = @_; + + print(STDERR "&&& $pathname $release \n"); + + if ($pathname =~ m|/$|) { + map { + feedswish($pathname.$_, $release, $swish) + } $files->getdir($pathname, $release); + } else { + my $contents = $files->getfile($pathname, $release); + $swish->print("Path-Name: $pathname\n", + "Content-Length: ".length($contents)."\n", + "Document-Type: TXT\n", + "\n", + $contents) + if length($contents) > 0; + } +} + +sub gensearch { + my ($release) = @_; + + if ($config->swishdir and $config->swishindex) { + my $swish = new IO::Handle; + my $pid = open($swish, "|-"); + if ($pid == 0) { + exec($config->swishindex, + "-S", "prog", "-i", "/bin/cat", "-v", "1", + "-f", $config->swishdir."/".$release.".index"); + print(STDERR "Couldn't exec ".$config->swishindex.": $!\n"); + kill(9, $$); + } + feedswish("/", $release, $swish); + $swish->close(); + } } Index: search =================================================================== RCS file: /cvsroot/lxr/lxr/search,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- search 2001/10/16 20:38:37 1.7 +++ search 2002/01/23 15:52:51 1.8 @@ -25,19 +25,122 @@ $CVSID = '$Id$ '; +use strict; use lib do { $0 =~ m{(.*)/} ? "$1/lib" : "lib" }; use LXR::Common qw(:html); use LXR::Config; -$maxhits = 1000; +my $maxhits = 1000; + + +sub glimpsesearch { + my ($searchtext) = @_; + + unless (open(GLIMPSE, "-|")) { + open(STDERR, ">&STDOUT"); + $!=''; + exec($config->glimpsebin,"-i","-H".$config->dbdir,'-y','-n',$searchtext); + print("Glimpse subprocess died unexpextedly: $!\n"); + exit; + } + + my $numlines = 0; + my @glimpselines = (); + while (<GLIMPSE>) { + $numlines++; + push(@glimpselines,$_); + if ($numlines > $maxhits) { + last; + } + } + + close(GLIMPSE); + + my $retval = $? >> 8; + + # The manpage for glimpse says that it returns 2 on syntax errors or + # inaccessible files. It seems this is not the case. + # We will have to work around it for the time being. + + if ($retval == 0) { + if (@glimpselines == 0) { + print("No matching files<br>\n"); + } else { + if ($numlines > $maxhits) { + print("<b> Too many hits, displaying first $maxhits</b><br>\n"); + } + print("<h1>$searchtext</h1>\n"); + my $sourceroot = $config->sourceroot; + foreach my $glimpseline (@glimpselines) { + + $glimpseline =~ s/$sourceroot//; + my ($file, $line, $text) = + $glimpseline =~ /(.*?):\s*(\d+)\s*:(.*)/; + $text =~ s/&/&/g; + $text =~ s/</</g; + $text =~ s/>/>/g; + + print(&fileref("$file, line $line", "find-file", + "/$file", $line), + " -- $text<br>\n"); + } + } + } elsif ($retval == 1) { + my $glimpsebin = $config->glimpsebin; + my $glimpseresponse = join("<br>",@glimpselines); + my $glimpseresponse =~ s/$glimpsebin/Reason/; + my $glimpseresponse =~ s/glimpse: error in searching index//; + print("<b>Search failed</b><br>\n$glimpseresponse"); + } else { + print("Unexpected returnvalue $retval from Glimpse\n"); + } +} + + +sub swishsearch { + my ($searchtext) = @_; + + unless (open(SWISH, "-|")) { + open(STDERR, ">&STDOUT"); + exec($config->swishsearch, + "-f", $config->swishdir."/".$release.".index", + "-m", $maxhits, "-w", $searchtext); + + print(STDERR "Couldn't exec ".$config->swishsearch.": $!\n"); + kill(9, $$); + } + + my @result = grep { not /^[\#\.]/ } <SWISH>; + close(SWISH); + my $retval = $? >> 8; + + if ($retval == 0) { + if (@result == 0) { + print("No matching files<br>\n"); + } else { + if (@result == $maxhits) { + print("<b> Too many hits, displaying first $maxhits</b><br>\n"); + } + print("<h1>$searchtext</h1>\n"); + + foreach my $hit (@result) { + my ($score, $file) = + $hit =~ /^(\d+) \/(\S+) \S+ \d+/; + + print("$score ", &fileref("$file", "find-file", "/$file"), "<br>\n"); + } + } + } + else { + print("<b>Search failed</b><br>\n@result"); + } +} + sub search { print("<p align=center>\n", - "This searchpage is powered by ", - "<a href=\"http://glimpse.cs.arizona.edu\">Glimpse</a>\n"); - - print("<form method=get action=\"search\">\n"); + "<form method=get action=\"search\">\n"); foreach ($config->allvariables) { if ($config->variable($_) ne $config->vardefault($_)) { @@ -46,6 +149,8 @@ } } + my $searchtext = $HTTP->{'param'}->{'string'}; + print("<B>Search for: </B><input type=text name=\"string\" ", "value=\"",$searchtext,"\" size=50>\n", "<input type=submit value=\"search\">\n", @@ -55,69 +160,16 @@ if ($searchtext ne "") { print("<hr>\n"); - unless (open(GLIMPSE, "-|")) { - open(STDERR, ">&STDOUT"); - $!=''; - exec($config->glimpsebin,"-i","-H".$config->dbdir,'-y','-n',$searchtext); - print("Glimpse subprocess died unexpextedly: $!\n"); - exit; - } - - $numlines = 0; - @glimpselines = (); - while (<GLIMPSE>) { - $numlines++; - push(@glimpselines,$_); - if ($numlines > $maxhits) { - last; - } + if ($config->glimpsebin) { + glimpsesearch($searchtext); } - - close(GLIMPSE); - - $retval = $? >> 8; - - # The manpage for glimpse says that it returns 2 on syntax errors or - # inaccessible files. It seems this is not the case. - # We will have to work around it for the time being. - - if ($retval == 0) { - if (@glimpselines == 0) { - print("No matching files<br>\n"); - } else { - if ($numlines > $maxhits) { - print("<b> Too many hits, displaying first $maxhits</b><br>\n"); - } - print("<h1>$searchtext</h1>\n"); - $sourceroot = $config->sourceroot; - foreach $glimpseline (@glimpselines) { - - $glimpseline =~ s/$sourceroot//; - ($file, $line, $text) = - $glimpseline =~ /(.*?):\s*(\d+)\s*:(.*)/; - $text =~ s/&/&/g; - $text =~ s/</</g; - $text =~ s/>/>/g; - - print(&fileref("$file, line $line", "find-file", - "/$file", $line), - " -- $text<br>\n"); - } - } - } elsif ($retval == 1) { - $glimpsebin = $config->glimpsebin; - $glimpseresponse = join("<br>",@glimpselines); - $glimpseresponse =~ s/$glimpsebin/Reason/; - $glimpseresponse =~ s/glimpse: error in searching index//; - print("<b>Search failed</b><br>\n$glimpseresponse"); - } else { - print("Unexpected returnvalue $retval from Glimpse\n"); + elsif ($config->swishsearch and $config->swishdir) { + swishsearch($searchtext); } } } httpinit; -$searchtext = $HTTP->{'param'}->{'string'}; &makeheader('search'); &search; |
|
From: Malcolm B. <mb...@us...> - 2002-01-23 15:48:55
|
Update of /cvsroot/lxr/lxr/lib/LXR/Index
In directory usw-pr-cvs1:/tmp/cvs-serv29755
Modified Files:
Postgres.pm
Log Message:
Make sure all sql statements are undef'ed to prevent warnings from Pg.pm
Index: Postgres.pm
===================================================================
RCS file: /cvsroot/lxr/lxr/lib/LXR/Index/Postgres.pm,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- Postgres.pm 2001/11/28 12:59:02 1.9
+++ Postgres.pm 2002/01/23 15:48:52 1.10
@@ -300,23 +300,27 @@
sub END {
- $files_select = undef;
- $filenum_nextval = undef;
+
+ $files_select= undef;
+ $filenum_nextval= undef;
$files_insert = undef;
- $symbols_byname = undef;
- $symbols_byid = undef;
+ $symbols_byname= undef;
+ $symbols_byid= undef;
$symnum_nextval = undef;
- $symbols_insert = undef;
+ $symbols_remove= undef;
+ $symbols_insert= undef;
+ $indexes_select= undef;
$indexes_insert = undef;
- $releases_insert = undef;
+ $releases_select= undef;
+ $releases_insert= undef;
$status_insert = undef;
- $status_update = undef;
- $usage_insert = undef;
- $usage_select = undef;
- $declid_nextnum = undef;
+ $status_update= undef;
+ $usage_insert= undef;
+ $usage_select= undef;
$decl_select = undef;
+ $declid_nextnum= undef;
$decl_insert = undef;
-
+
$dbh->commit();
$dbh->disconnect();
$dbh = undef;
|
|
From: Malcolm B. <mb...@us...> - 2002-01-23 15:14:11
|
Update of /cvsroot/lxr/lxr In directory usw-pr-cvs1:/tmp/cvs-serv16574 Modified Files: INSTALL CREDITS.txt Log Message: Updated INSTALL document from Guido Sohne. Index: INSTALL =================================================================== RCS file: /cvsroot/lxr/lxr/INSTALL,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- INSTALL 2001/08/04 18:53:57 1.4 +++ INSTALL 2002/01/23 15:14:07 1.5 @@ -2,58 +2,172 @@ ------------ The current version of the lxr depends on three things: -1) A recent version of the exuberant ctags program -2) A relational database. MySQL has been tested, and there is code -for Postgresql as well. -3) Apache with mod_perl +1) A recent version of the exuberant ctags program. Available from + http://sf.net/projects/ctags -At the moment the DBI backend works, this means that you will have to -set up a relational database like MySQL. The DBI backend currently in -CVS has been tested with MySQL. There is a DB backend for Berkeley -dbm file support, but it has not been tested recently. +2) A relational database - MySQL (http://www.mysql.com) and Postgresql + (http://www.postgresql.org) are supported. +3) Apache with mod_perl - http://www.apache.org + +If you want to be able to do free text searchs of your repository as +well as browse it you will have to obtain and install glimpse from +http://glimpse.cs.arizona.edu Installing the database ----------------------- -First install the DBMS and create a lxr database. The files -initdb-<name> where <name> is the name of your database contain the -commands to create the correct database. +You will need to create a database for lxr, and possibly create a user +as well. If you are unsure how to do this, or don't have admin rights +to the database, consult the documentation or your sysadmin +respectively. The steps below assume you know what you're doing. -If you are running postgres the initialization can be done by running -'psql lxr' and reading the file "initdb-postgres" by entering '\i -createdb'. Just ignore the errors about unimplemented functions. -The user running your cgi-scripts must be able to use the postgres -database. This user is usually nobody, create the postgres user by -entering "createuser nobody" at the shell prompt. +For Postgresql: +Create a user for lxr and give the user permission to create databases: + createuser lxr +Create a database for lxr: + createdb -U lxr lxr +Initialise the database: + psql -U lxr lxr + \i initdb-postgres +Just ignore the errors about unimplemented functions. -If you are using MySQL, run 'mysql' 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. +For MySQL: + +Run 'mysql' 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. + +Create lxr installation directory +--------------------------------- +Expand the tarball in the LXR distribution into a directory of your +choice. A good choice could be /usr/local/lxr so you would do + + cd /usr/local/ + tar -zxf /path/to/lxr/lxr-x.x.tgz (as root or with appropriate permissions) + +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 + +Now you should copy the template files for LXR to your installation + + mv /usr/local/lxr/templates/* /usr/local/lxr/ + Edit the lxr config file ------------------------ -When the database is initialized, copy templates/* to . ("cp templates/* ."). -Then edit lxr.conf, it should contain enough comments to get you -started. You may also wish to edit the lxr HTML files. +Go through the config file and fill in the relevant values. +If you have glimpse installed, you should set + + 'glimpsebin' => '/path/to/your/glimpse/executable' + +Now remember you copied the perl modules for Glimpse to a directory +in your perl module search path ? The example path I used was +/usr/lib/perl5/site_perl which is also needed in lxr.conf + + 'genericconf' => '/usr/lib/perl5/site_perl/LXR/Lang/generic.conf' + +Next set your base URL and virtual root for LXR by setting + + 'baseurl' => 'http://your.host.name/your_lxr_virtual_root + 'virtroot' => '/your_lxr_virtual_root' + +Fill in the dbname, dbpass and dbuser variable to the right values for +the database you created above. + +The 'v' (Version) variable needs to have the list of versions of your +sourcecode that you want to index. This list can be in the lxr.conf +file, read from a file or calculated at runtime. Select the right +method for your setup in the lxr.conf file. + +Set the 'sourceroot' variable to point to the source code that you +want to index and browse. + +You may also want to configure the 'graphicfile', 'filetype' and +'incprefix' variables, but the defaults should be reasonable for most setups. + +Getting lxr to work with CVS +---------------------------- +If you want lxr to work on files that are located in a CVS repository, edit +lxr.conf and set the range variable so that it uses a subroutine instead +of the default setting that reads the src/cvsversions file. + + 'range' => sub { return + ($files->allreleases($LXR::Common::pathname), + $files->allrevisions($LXR::Common::pathname)) + }, # deferred function call. + +You should also set the default version retrieved to a version that really +does exist otherwise you will receive errors when generating your index. + +A good value for the default version is head. + + 'default' => 'head' + +Next, set the source root variable to point to the directory containing +the versions of your project in CVS. If your cvs repository in stored +in /path/to/cvs/repository and your cvs module is called lxr then set + + 'sourceroot' => 'cvs:/path/to/cvs/repository/lxr' + 'sourcerootname' => 'A Friendly Name For Your Repository' + +Getting Glimpse to work with LXR +-------------------------------- +Create a directory in your LXR directory called glimpse + + mkdir /usr/local/lxr/glimpse + +If you are using CVS, checkout a copy of your project in the +LXR directory, for example + cd /usr/local/lxr + cvs checkout my_project + +otherwise just use the path to your project instead in the +example below + + find /usr/local/lxr/my_project/ -name *.java | + glimpseindex -H /usr/local/lxr/glimpse -o -F + +Be sure that the glimpse indexes are readable by the user +that Apache is running as. You can do + + chmod a+x /usr/local/lxr/glimpse/.* + +Now edit lxr.conf again and add the following variable for +the URL section that you configured earlier + + 'strip' => '/usr/local/lxr/sikasem' + +This munges the output of glimpse so that you can go straight +to the file that contains a match for a search term. + Generate index. --------------- + It is now time to generate the index. This is done using the program -"genxref". The new genxref is much smarter than the old one. Our -intention is that you configure everything inside lxr.conf, the file -is read by genxref and all paths are set up so the cgi-scripts will -find the files. genxref takes two arguments --url=<url> and ---version=<ver> where <url> is the url where the lxr cgi scripts are -found. Version is a tag from cvs if you are using the cvs backend or -the name of a directory in your "sourceroot" directory. It is worth -noting that one lxr.conf file can be used for several different +"genxref". genxref takes two arguments --url= and --version= where is +the url where the lxr cgi scripts are found. + +Version is a tag from cvs if you are using the cvs backend or the name +of a directory in your "sourceroot" directory. It is worth noting that +one lxr.conf file can be used for several different configurations. Which config block to use is selected according to the url argument. -Note that genxref can be a very slow process the first time it's run, -for example on a 4Gb source tree a full run can take several days. However, -on future runs it will only index changed files, thus speeding the -process. +If you are setting up LXR to use files in a CVS repository, genxref +will most likely run without printing out any error messages. This is +*not* what you want. You have to explicitly state a version to use. + genxref --url=/path/to/lxr --version=head + +You can also use the --allversions argument to automatically index all +the versions defined in the versions variable. + +Note that genxref can be a very slow process the first time it is run, +for example on a 4Gb source tree a full run can take several +days. However, on future runs it will only index changed files, thus +speeding the process. + Set up webserver ---------------- The browsing scripts currently supplied depend on mod_perl to execute @@ -61,24 +175,37 @@ CGI scripts. Since mod_perl is an Apache add-on, this means using Apache at the moment. -In httpd.conf +You may need to edit httpd.conf to point to the lxr files, for example +if you have installed the lxr files in /usr/local/lxr and you want to +have your URL be http://mysite/lxr then you would add: -Alias /lxr /path/to/lxr -<Directory /path/to/lxr/> -AllowOverride All +Alias /lxr /usr/local/lxr +<Directory /usr/local/lxr> + 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. -If you have problems with the LXR modules not being found by mod_perl, -you may need to install the LXR module under the normal perl module -directory i.e. copy/link lib/LXR into /usr/lib/perl5/site_perl/5.6.0 -(assuming this is where your perl is installed). +That's it - lxr should now work. Fire up your webbrowser and go to +http://yoursite/lxr/source and you should see the listing for the top +of your source tree. -Possible problems and solutions: -------------------------------- +Getting help if it doesn't work: +-------------------------------- +If you can't get LXR to work then you can try asking on the mailing +list or the support forums. Do check the archives of both first +though - your question may already have been answered. + +By web: http://sourceforge.net/forum/forum.php?forum_id=86145 +By email: Send a mail to lxr...@li... + + + +Troubleshooting: +--------------- + ** Fatal: Can't find database This message comes from the DB backend. The likely cause is that the @@ -93,3 +220,4 @@ HTML. This can normally be solved by changing the value of $wwwdebug to 0 in Common.pm. But please report the warning message as a bug at http://sf.net/projects/lxr first! + Index: CREDITS.txt =================================================================== RCS file: /cvsroot/lxr/lxr/CREDITS.txt,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- CREDITS.txt 2001/11/28 13:04:51 1.3 +++ CREDITS.txt 2002/01/23 15:14:07 1.4 @@ -23,6 +23,7 @@ Jason Dorie Short <js...@de...> File re-org Joseph Corral <jos...@hp...> Kristoffer Gleditsch <to...@pi...> Postgres patches +Guido Sohne Updated INSTALL document |
|
From: Malcolm B. <mb...@us...> - 2002-01-23 14:59:27
|
Update of /cvsroot/lxr/lxr/lib/LXR
In directory usw-pr-cvs1:/tmp/cvs-serv10443/lib/LXR
Modified Files:
Lang.pm
Log Message:
Add mapping from interpreter names to languages. If the file extension does
not select a language, then the first line of the file is checked for a #!
If one is found, then the interpreter name is matched against the 'interpreters'
map in lxr.conf, and the relevant language module loaded.
Index: Lang.pm
===================================================================
RCS file: /cvsroot/lxr/lxr/lib/LXR/Lang.pm,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- Lang.pm 2002/01/23 08:12:05 1.26
+++ Lang.pm 2002/01/23 14:59:21 1.27
@@ -37,22 +37,32 @@
last;
}
}
-
+
if (!defined $lang) {
# Try to see if it's a script
my $fh = $files->getfilehandle($pathname, $release);
- $fh->getline =~ /^#!\s*(\S+)/s;
+ $fh->getline =~ /^\#!\s*(\S+)/s;
my $shebang = $1;
+ my %filetype = %{$config->filetype};
+ my %inter = %{$config->interpreters};
- if ($shebang =~ /perl/) {
- require LXR::Lang::Generic;
- $lang = new LXR::Lang::Generic($pathname, $release, 'Perl');
- } else {
- $lang = undef;
+ foreach my $patt (keys %inter) {
+ if ($shebang =~ /$patt/) {
+ eval "require $filetype{$inter{$patt}}[2]";
+ die "Unable to load $filetype{$inter{$patt}}[2] Lang class, $@" if $@;
+ my $create = "new ".
+ $filetype{$inter{$patt}}[2].'($pathname, $release, $filetype{$inter{$patt}}[0])';
+ $lang = eval($create);
+ last if defined $lang;
+ die "Unable to create $filetype{$inter{$patt}}[2] Lang object, $@";
+ }
}
}
+ # No match for this file
+ return undef if !defined $lang;
+
$$lang{'itag'} = \@itag if $lang;
return $lang;
|
|
From: Malcolm B. <mb...@us...> - 2002-01-23 14:59:27
|
Update of /cvsroot/lxr/lxr/templates
In directory usw-pr-cvs1:/tmp/cvs-serv10443/templates
Modified Files:
lxr.conf
Log Message:
Add mapping from interpreter names to languages. If the file extension does
not select a language, then the first line of the file is checked for a #!
If one is found, then the interpreter name is matched against the 'interpreters'
map in lxr.conf, and the relevant language module loaded.
Index: lxr.conf
===================================================================
RCS file: /cvsroot/lxr/lxr/templates/lxr.conf,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- lxr.conf 2002/01/23 08:16:19 1.6
+++ lxr.conf 2002/01/23 14:59:21 1.7
@@ -5,71 +5,87 @@
{
# Global configuration
- # 'glimpsebin' => '/info/lxr/bin/glimpse',
- 'ectagsbin' => '/usr/bin/ctags',
- 'tmpdir' => '/tmp',
+ 'glimpsebin' => '/info/lxr/bin/glimpse', # Path to glimpse executable
+ 'ectagsbin' => '/usr/bin/ctags', # Path to Exuberant Ctags executable
+ 'tmpdir' => '/tmp', # Place where lxr can write temporary files
# Location of the Generic.pm config file
'genericconf' => '/path/to/lib/LXR/Lang/generic.conf'
},
{
- # Configuration for http://karsk.ping.uio.no/~argggh/lxr.
+ # Configuration for http://192.168.1.3/lxr.
# baseurl is used to select configuration block.
- 'baseurl' => 'http://192.168.1.3/lxr',
- 'virtroot' => '/lxr',
+ 'baseurl' => 'http://192.168.1.3/lxr', # Put your URL here
+ 'virtroot' => '/lxr', # The bit after the / above
'variables' => {
- # Define typed variable "v", read valueset from file.
- 'v' => {'name' => 'Version',
- 'range' => [ readfile('src/cvsversions') ],
-
- # If files within a tree can have different versions,
- # e.g in a CVS tree, 'range' can be specified as a
- # function to call for each file:
- #'range' => sub { return
- # ($files->allreleases($LXR::Common::pathname),
- # $files->allrevisions($LXR::Common::pathname))
- # }, # deferred function call.
+ # Define typed variable "v". This is the list of versions to index.
+ 'v' => {'name' => 'Version',
+ # This can come from a file, a function or be explicitly
+ # ennumerated.
+ # From a file:
+ 'range' => [ readfile('src/versions') ],
+ # Explicitly:
+ # 'range' => [qw(v1 v2 v3.1 v4 experimental)],
+ # If files within a tree can have different versions,
+ # e.g in a CVS tree, 'range' can be specified as a
+ # function to call for each file:
+ #'range' => sub { return
+ # ($files->allreleases($LXR::Common::pathname),
+ # $files->allrevisions($LXR::Common::pathname))
+ # }, # deferred function call.
- 'default' => '1.0.6'},
+ # The default version to display
+ 'default' => '1.0.6'},
- # Define typed variable "a". First value is default.
- 'a' => {'name' => 'Architecture',
- 'range' => [qw(i386 alpha arm m68k mips ppc sparc sparc64)]},
- },
-
- 'maps' => {
- '/include/asm[^\/]*/' => '/include/asm-$a/',
- '/arch/[^\/]+/' => '/arch/$a/',
- },
+ # Define typed variable "a". First value is default.
+ 'a' => {'name' => 'Architecture',
+ 'range' => [qw(i386 alpha arm m68k mips ppc sparc sparc64)]},
+ },
-
- # Templates used for headers and footers
- 'htmlhead' => 'html-head.html',
- 'htmltail' => 'html-tail.html',
- 'htmldir' => 'html-dir.html',
- 'htmlident' => 'html-ident.html',
-
- 'sourcehead' => 'html-head.html',
- 'sourcedirhead' => 'html-head.html',
- 'stylesheet' => 'templates/lxr.css',
+ # These do funky things to paths in the system - you probably don't need them.
+ 'maps' => {
+ '/include/asm[^\/]*/' => '/include/asm-$a/',
+ '/arch/[^\/]+/' => '/arch/$a/',
+ },
+
+
+ # Templates used for headers and footers
+ 'htmlhead' => 'html-head.html',
+ 'htmltail' => 'html-tail.html',
+ 'htmldir' => 'html-dir.html',
+ 'htmlident' => 'html-ident.html',
+
+ 'sourcehead' => 'html-head.html',
+ 'sourcedirhead' => 'html-head.html',
+ 'stylesheet' => 'lxr.css',
+
+ # sourceroot - where to get the source files from
-# sourceroot can either be the name of an ordinary directory
-# containing one directory for each version, or cvs: and the name of a
-# cvs repository
+ # For ordinary directories, this specifies a directory which has each version as a
+ # subdirectory e.g.
+ # indexed-src/version1/...
+ # indexed-src/version2/...
+ # The names of the version directories must match the values for the Version
+ # variable above.
+ 'sourceroot' => '/home/malcolm/indexed-src',
+ # Alternatively, this can specify a CVS repository by setting the value to "cvs:"
+ # followed by the path to the repository. Note this must be file accessible - remote
+ # server access does NOT work.
+ # 'sourceroot' => 'cvs:/hom/karsk/a/CVSROOT/linux',
- 'sourceroot' => '/home/malcolm/indexed-src',
-# 'sourceroot' => 'cvs:/hom/karsk/a/CVSROOT/linux',
- 'sourcerootname' => 'Example',
-# where to look for include files inside the sourcetree
+ # The name to display for this source tree
+ 'sourcerootname' => 'Example',
+
+ # where to look for include files inside the sourcetree. This is used to hyperlink
+ # to included files.
'incprefix' => ['/include', '/include/linux'],
-
+
# Which extensions to treat as images when browsing. If a file is an image,
# it is displayed.
-
- 'graphicfile' => '(?i)\.(gif|jpg|jpeg|pjpg|pjpeg|xbm|png)$',
+ 'graphicfile' => '(?i)\.(gif|jpg|jpeg|pjpg|pjpeg|xbm|png)$', #'
# How to map files to languages
# Note that the string for the key and the first entry in the
@@ -126,15 +142,32 @@
# ['tcl', '(?i)\.tcl$|\.wish$' #'
# , 'LXR::Lang::Generic'],
},
+
+ # Maps interpreter names to languages. The format is:
+ # regexp => langname
+ # regexp is matched against the part after #! on the first line of a file
+ # langname must match one of the keys in filetype above.
+ #
+ # This mapping is only used if the filename doesn't match a pattern above, so
+ # a shell script called shell.c will be recognised as a C file, not a shell file.
- # If dbname is a directory the db-file databases will be stored here
- # if a relational database is used the name is a dbi database specifier
+ 'interpreters' => {
+ 'perl' => 'Perl',
+# 'bash' => 'shell',
+# 'csh' => 'shell',
+ 'python' => 'Python',
+ },
+
+ # The DBI identifier for the database to use
+ # For mysql, the format is dbi:mysql:dbname=<name>
+ # for Postgres, it is dbi:Pg:dbname=<name>
'dbname' => 'dbi:mysql:dbname=lxr',
-# Used with the mysql backend
-# 'dbpass' => 'foo',
-# 'dbuser' => 'lxr'
- # 'dbname' => 'src/db',
+
+ # If you need to specify the username or password for the database connection,
+ # uncomment the following two lines
+ # 'dbpass' => 'foo',
+ # 'dbuser' => 'lxr',
# For using glimpse, the directory to store the .glimpse files in is required
- 'dbdir' => '/path/to/glimpse/database',
+ 'dbdir' => '/path/to/glimpse/databases',
})
|
|
From: Jan-Benedict G. <jb...@lu...> - 2002-01-23 14:11:53
|
On Wed, 2002-01-23 00:12:07 -0800, Malcolm Box <mb...@us...>
wrote in message <E16...@us...>:
>
> Index: Lang.pm
> ===================================================================
> RCS file: /cvsroot/lxr/lxr/lib/LXR/Lang.pm,v
> retrieving revision 1.25
> retrieving revision 1.26
> diff -u -d -r1.25 -r1.26
> --- Lang.pm 2001/11/28 13:01:57 1.25
> +++ Lang.pm 2002/01/23 08:12:05 1.26
> @@ -40,7 +40,8 @@
>
> if (!defined $lang) {
> # Try to see if it's a script
> - $files->getfile($pathname, $release) =~ /^#!\s*(\S+)/s;
> + my $fh = $files->getfilehandle($pathname, $release);
> + $fh->getline =~ /^#!\s*(\S+)/s;
>
> my $shebang = $1;
Please, take Lang.pm and read some further lines. There, we fetch
a (possible) shell bang and test it against the occurence of "perl".
Bad.
Spoken C'ish, there's an array of structs in lxr.conf (sorry,
I'm not Perl-enabled...) containing language descriptions. This
includes some possible filename extensions which are almost
reasonable. Why don't we add a struct member called "interpreters"
containing a list of possible interpreters, if there's not a match
for the filename extension.
Lang.pm does this exceptional for Perl, I'd like to see this behavior
to be a bit more flexible by scanning over thise things there in
lxr.conf. There's no need for a perl script to end up in .pl, equally
there's no need for s shell script to end up in .sh. So why don't we
generally also test for a shell bang (if there's no extension)?
I don't think that this is hard to code, but I can't do it.
Alternatively, one could use output of the "file" command...
Any volunteers?
MfG, JBG
--
Jan-Benedict Glaw . jb...@lu... . +49-172-7608481
-- New APT-Proxy written in shell script --
http://lug-owl.de/~jbglaw/software/ap2/
|
|
From: Malcolm B. <mb...@us...> - 2002-01-23 08:16:51
|
Update of /cvsroot/lxr/lxr/templates In directory usw-pr-cvs1:/tmp/cvs-serv6022 Modified Files: lxr.conf Log Message: Fix bug #506845: Missing variable in lxr.conf Added $dbdir to the lxr.conf template. Index: lxr.conf =================================================================== RCS file: /cvsroot/lxr/lxr/templates/lxr.conf,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- lxr.conf 2001/11/18 03:31:34 1.5 +++ lxr.conf 2002/01/23 08:16:19 1.6 @@ -134,4 +134,7 @@ # 'dbpass' => 'foo', # 'dbuser' => 'lxr' # 'dbname' => 'src/db', + + # For using glimpse, the directory to store the .glimpse files in is required + 'dbdir' => '/path/to/glimpse/database', }) |
|
From: Malcolm B. <mb...@us...> - 2002-01-23 08:12:36
|
Update of /cvsroot/lxr/lxr/lib/LXR
In directory usw-pr-cvs1:/tmp/cvs-serv4800
Modified Files:
Lang.pm
Log Message:
Fix bug 506627: Excessive memory usage. Rather than read the whole file into
memory to determine if it is a script, get a filehandle to it and retrieve the first line.
This may still mean the whole file ends up in memory "under the hood", depending on the
implementation of the individual backends, but with Plain.pm it doesn't.
Index: Lang.pm
===================================================================
RCS file: /cvsroot/lxr/lxr/lib/LXR/Lang.pm,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- Lang.pm 2001/11/28 13:01:57 1.25
+++ Lang.pm 2002/01/23 08:12:05 1.26
@@ -40,7 +40,8 @@
if (!defined $lang) {
# Try to see if it's a script
- $files->getfile($pathname, $release) =~ /^#!\s*(\S+)/s;
+ my $fh = $files->getfilehandle($pathname, $release);
+ $fh->getline =~ /^#!\s*(\S+)/s;
my $shebang = $1;
|
|
From: Malcolm B. <mb...@us...> - 2002-01-19 07:23:28
|
Update of /cvsroot/lxr/lxr In directory usw-pr-cvs1:/tmp/cvs-serv20915 Added Files: BUGS CHANGELOG Log Message: --- NEW FILE: BUGS --- See http://www.sourceforge.net/projects/lxr for a list of known bugs and how to report bugs you find. --- NEW FILE: CHANGELOG --- 2001-10-23 mbox * /cvsroot/lxr/lxr/lib/LXR/Tagger.pm: Remove obsolete code * /cvsroot/lxr/lxr/templates/html-tail.html: Updated valid HTML logo to point to W3C's validator and the HTML 4.01 logo 2001-10-17 mbox * /cvsroot/lxr/lxr/lib/LXR/Index/Mysql.pm: Fix typo in if() expression 2001-10-17 pergj * /cvsroot/lxr/lxr/source: Fix accidentially added libpath. 2001-10-16 pergj * /cvsroot/lxr/lxr/diff, /cvsroot/lxr/lxr/find, /cvsroot/lxr/lxr/ident, /cvsroot/lxr/lxr/lib/LXR/Common.pm, /cvsroot/lxr/lxr/search, /cvsroot/lxr/lxr/source: Clean up after httpinit * /cvsroot/lxr/lxr/lib/LXR/Index/Mysql.pm, /cvsroot/lxr/lxr/templates/lxr.conf: Database password and user can now be specified in lxr.conf 2001-09-28 mbox * /cvsroot/lxr/lxr/CREDITS.txt: Credit the right person :-) * /cvsroot/lxr/lxr/templates/html-head.html: Fix HTML to be 4.01 Transitional compliant * /cvsroot/lxr/lxr/templates/lxr.css: Adding missing file for CSS support 2001-09-27 mbox * /cvsroot/lxr/lxr/templates/html-dir.html, /cvsroot/lxr/lxr/templates/html-head.html, /cvsroot/lxr/lxr/templates/html-ident.html, /cvsroot/lxr/lxr/templates/lxr.conf, /cvsroot/lxr/lxr/.cvsignore, /cvsroot/lxr/lxr/diff, /cvsroot/lxr/lxr/find, /cvsroot/lxr/lxr/ident, /cvsroot/lxr/lxr/lib/LXR/Common.pm, /cvsroot/lxr/lxr/lib/LXR/Lang.pm, /cvsroot/lxr/lxr/lib/LXR/Lang/Perl.pm, /cvsroot/lxr/lxr/search, /cvsroot/lxr/lxr/source: Apply patch 458027 from Pavel Hlavnicka Adds stylesheet (CSS) support to ident, source and diff. Output style is now controllable from via the lxr.css stylesheet (example provided in templates). Ident output now generated via a template rather than hard coded. Minor additional fixes by me result in the output of ident & source both validating as HTML 4.01 Transitional. * /cvsroot/lxr/lxr/lib/LXR/Lang/generic.conf: Fix typo * /cvsroot/lxr/lxr/lib/LXR/Lang/generic.conf: Patched to add support for PHP (thanks to ta...@us...) * /cvsroot/lxr/lxr/CREDITS.txt: Added a CREDITS file to acknowledge and thank all those who have helped create the lxr. 2001-09-26 mbox * /cvsroot/lxr/lxr/initdb-mysql, /cvsroot/lxr/lxr/initdb-postgres: Dramatically speed up (>50 times) the speed of incremental indexing by creating an index to allow the fileid to be looked up fast from the filename. Ideally this index would include the revision as well, but this is not possible in MySQL because of limits (500 chars) on the index key. Tested on MySQL, but not on postgres. Fixes bug 465131 * /cvsroot/lxr/lxr/genxref: Replace use of direct access of range variable v with the correct varrange accessor 2001-08-16 mbox * /cvsroot/lxr/lxr/.cvsignore: Ignore the template & conf files of the user |
|
From: Malcolm B. <mb...@us...> - 2002-01-19 07:20:03
|
Update of /cvsroot/lxr/lxr/lib/LXR/Lang
In directory usw-pr-cvs1:/tmp/cvs-serv20301/lib/LXR/Lang
Modified Files:
generic.conf
Log Message:
Fix emacs modeline
Index: generic.conf
===================================================================
RCS file: /cvsroot/lxr/lxr/lib/LXR/Lang/generic.conf,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- generic.conf 2001/11/18 03:31:34 1.8
+++ generic.conf 2002/01/19 07:20:00 1.9
@@ -1,4 +1,4 @@
-# -*- mode: perl, tab-width: 2 -*-
+# -*- mode: perl; tab-width: 2 -*-
# Configure options for the generic language support
{
|
|
From: Malcolm B. <mb...@us...> - 2001-12-06 14:46:44
|
Update of /cvsroot/lxr/lxr/lib/LXR/Lang
In directory usw-pr-cvs1:/tmp/cvs-serv8398
Modified Files:
Generic.pm
Log Message:
Fix error message
Index: Generic.pm
===================================================================
RCS file: /cvsroot/lxr/lxr/lib/LXR/Lang/Generic.pm,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- Generic.pm 2001/11/28 12:59:51 1.9
+++ Generic.pm 2001/12/06 14:36:43 1.10
@@ -53,7 +53,7 @@
}
sub read_config {
- open (CONF, $config->genericconf) || die "Can't open $config->genericconf, $!";
+ open (CONF, $config->genericconf) || die "Can't open ".$config->genericconf.", $!";
local($/) = undef;
|
|
From: Malcolm B. <mb...@us...> - 2001-11-28 13:04:55
|
Update of /cvsroot/lxr/lxr In directory usw-pr-cvs1:/tmp/cvs-serv31942 Modified Files: .htaccess CREDITS.txt Log Message: Updated CREDITS. Added lib to the INC path from the .htaccess file. This should solve the Can't find errors that occur under mod_perl Index: .htaccess =================================================================== RCS file: /cvsroot/lxr/lxr/.htaccess,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- .htaccess 2000/10/31 12:52:10 1.3 +++ .htaccess 2001/11/28 13:04:51 1.4 @@ -13,4 +13,5 @@ <Files ~ (find|search|source|ident|diff|cgi-bin)$> SetHandler perl-script PerlHandler Apache::Registry +PerlSetEnv PERL5LIB lib </Files> Index: CREDITS.txt =================================================================== RCS file: /cvsroot/lxr/lxr/CREDITS.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- CREDITS.txt 2001/09/28 14:31:38 1.2 +++ CREDITS.txt 2001/11/28 13:04:51 1.3 @@ -8,8 +8,7 @@ Per Kristian Gjermshus <lx...@li...> Current Maintainer ------------------- - +------------------ Malcolm Box <mb...@us...> Principal Developers @@ -23,6 +22,8 @@ Pavel Hlavnicka <pa...@gi...> CSS support Jason Dorie Short <js...@de...> File re-org Joseph Corral <jos...@hp...> +Kristoffer Gleditsch <to...@pi...> Postgres patches + ------------------------------------------------------------------------- |
|
From: Malcolm B. <mb...@us...> - 2001-11-28 13:02:00
|
Update of /cvsroot/lxr/lxr/lib/LXR
In directory usw-pr-cvs1:/tmp/cvs-serv31524/lib/LXR
Modified Files:
Lang.pm
Log Message:
Add error output if require fails.
Index: Lang.pm
===================================================================
RCS file: /cvsroot/lxr/lxr/lib/LXR/Lang.pm,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- Lang.pm 2001/11/14 15:03:29 1.24
+++ Lang.pm 2001/11/28 13:01:57 1.25
@@ -30,6 +30,7 @@
foreach $type (values %{$config->filetype}) {
if ($pathname =~ /$$type[1]/) {
eval "require $$type[2]";
+ die "Unable to load $$type[2] Lang class, $@" if $@;
my $create = "new $$type[2]".'($pathname, $release, $$type[0])';
$lang = eval($create);
die "Unable to create $$type[2] Lang object, $@" unless defined $lang;
|
|
From: Malcolm B. <mb...@us...> - 2001-11-28 12:59:54
|
Update of /cvsroot/lxr/lxr/lib/LXR/Lang
In directory usw-pr-cvs1:/tmp/cvs-serv30982/lib/LXR/Lang
Modified Files:
Generic.pm
Log Message:
Apply speedup patch from Arne.
Makes Generic.pm only read the config file once, and then share the info
between instances.
Index: Generic.pm
===================================================================
RCS file: /cvsroot/lxr/lxr/lib/LXR/Lang/Generic.pm,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- Generic.pm 2001/11/18 03:31:34 1.8
+++ Generic.pm 2001/11/28 12:59:51 1.9
@@ -30,6 +30,8 @@
use vars qw($AUTOLOAD);
+my $generic_config;
+
@LXR::Lang::Generic::ISA = ('LXR::Lang');
sub new {
@@ -39,29 +41,37 @@
bless ($self, $class);
$$self{'release'} = $release;
$$self{'language'} = $lang;
-
- open (X, $config->genericconf) || die "Can't open $config->genericconf, $!";
-
- local($/) = undef;
- my $cfg = eval ("\n#line 1 \"generic.conf\"\n".
- <X>);
- die ($@) if $@;
- close X;
- %$self= (%$self, %$cfg);
+ read_config() unless defined $generic_config;
+ %$self = (%$self, %$generic_config);
# Set langid
$$self{'langid'} = $self->langinfo('langid');
die "No langid for language $lang" if !defined $self->langid;
-
- # Setup the ctags to declid mapping
- my $typemap =\%{$self->langinfo('typemap')};
-
- foreach my $type (keys %$typemap) {
- $typemap->{$type}=$index->getdecid($self->langid, $typemap->{$type});
- }
return $self;
+}
+
+sub read_config {
+ open (CONF, $config->genericconf) || die "Can't open $config->genericconf, $!";
+
+ local($/) = undef;
+
+ $generic_config = eval ("\n#line 1 \"generic.conf\"\n".
+ <CONF>);
+ die ($@) if $@;
+ close CONF;
+
+ # Setup the ctags to declid mapping
+ my $langmap = $generic_config->{'langmap'};
+ foreach my $lang (keys %$langmap) {
+ my $typemap = $langmap->{$lang}{'typemap'};
+ foreach my $type (keys %$typemap) {
+ $typemap->{$type} =
+ $index->getdecid($langmap->{$lang}{'langid'},
+ $typemap->{$type});
+ }
+ }
}
sub indexfile {
|
|
From: Malcolm B. <mb...@us...> - 2001-11-28 12:59:05
|
Update of /cvsroot/lxr/lxr/lib/LXR/Index
In directory usw-pr-cvs1:/tmp/cvs-serv30739/lib/LXR/Index
Modified Files:
Postgres.pm
Log Message:
Applied Postgres fixes from Kristoffer Gleditsch <to...@pi...>
Index: Postgres.pm
===================================================================
RCS file: /cvsroot/lxr/lxr/lib/LXR/Index/Postgres.pm,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- Postgres.pm 2001/11/18 03:31:34 1.8
+++ Postgres.pm 2001/11/28 12:59:02 1.9
@@ -22,6 +22,7 @@
use strict;
use DBI;
+use LXR::Common;
use vars qw($dbh $transactions %files %symcache $commitlimit
$files_select $filenum_nextval $files_insert
@@ -36,7 +37,7 @@
my ($self, $dbname) = @_;
$self = bless({}, $self);
- $dbh ||= DBI->connect($dbname);
+ $dbh ||= DBI->connect($dbname, $config->{'dbuser'}, $config->{'dbpass'});
die($DBI::errstr) unless $dbh;
$$dbh{'AutoCommit'} = 0;
@@ -66,7 +67,7 @@
("delete from symbols where symname = ?");
$indexes_select = $dbh->prepare
- ("select f.filename, i.line, d.type, i.relsym ".
+ ("select f.filename, i.line, d.declaration, i.relsym ".
"from symbols s, indexes i, files f, releases r, declarations d ".
"where s.symid = i.symid and i.fileid = f.fileid ".
"and f.fileid = r.fileid ".
@@ -115,6 +116,12 @@
%symcache = ();
}
+sub commit_if_limit {
+ unless (++$transactions % $commitlimit) {
+ $dbh->commit();
+ }
+}
+
sub index {
my ($self, $symname, $fileid, $line, $langid, $type, $relsym) = @_;
@@ -124,9 +131,7 @@
$langid,
$type,
$relsym ? $self->symid($relsym) : undef);
- unless (++$transactions % $commitlimit) {
- $dbh->commit();
- }
+ commit_if_limit();
}
sub reference {
@@ -135,10 +140,7 @@
$usage_insert->execute($fileid,
$line,
$self->symid($symname));
-
- unless (++$transactions % $commitlimit) {
- $dbh->commit();
- }
+ commit_if_limit();
}
sub getindex {
@@ -200,6 +202,7 @@
}
$files{"$filename\t$revision"} = $fileid;
}
+ commit_if_limit();
return $fileid;
}
@@ -217,6 +220,7 @@
unless ($firstrow) {
$releases_insert->execute($fileid+0, $release);
}
+ commit_if_limit();
}
sub symid {
@@ -233,7 +237,7 @@
}
$symcache{$symname} = $symid;
}
-
+ commit_if_limit();
return $symid;
}
@@ -264,6 +268,7 @@
my ($self, $fileid) = @_;
$status_insert->execute($fileid+0, $fileid+0);
+ commit_if_limit();
return $status_update->execute(1, $fileid+0, 0) > 0;
}
@@ -286,9 +291,10 @@
}
$decl_select->execute($lang, $string);
- my $id = decl_select->fetchrow_array();
+ my $id = $decl_select->fetchrow_array();
$decl_select->finish();
+ commit_if_limit();
return $id;
}
|
|
From: Malcolm B. <mb...@us...> - 2001-11-28 12:59:05
|
Update of /cvsroot/lxr/lxr In directory usw-pr-cvs1:/tmp/cvs-serv30739 Modified Files: initdb-postgres Log Message: Applied Postgres fixes from Kristoffer Gleditsch <to...@pi...> Index: initdb-postgres =================================================================== RCS file: /cvsroot/lxr/lxr/initdb-postgres,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- initdb-postgres 2001/11/18 03:31:33 1.4 +++ initdb-postgres 2001/11/28 12:59:02 1.5 @@ -1,11 +1,13 @@ drop sequence filenum; drop sequence symnum; +drop sequence declnum; drop table files; drop table symbols; drop table indexes; drop table releases; drop table usage; drop table status; +drop table declarations; create sequence filenum cache 50; create sequence symnum cache 50; @@ -28,13 +30,21 @@ ); +create table declarations ( + declid smallint not null, + langid smallint not null, + declaration char(255) not null, + primary key (declid, langid) +); + create table indexes ( symid int references symbols, fileid int references files, line int, - langid tinyint not null references declarations, - type smallint not null references declarations, - relsym int references symbols + langid smallint not null, + type smallint not null, + relsym int references symbols, + foreign key (langid, type) references declarations (langid, declid) ); create table releases @@ -54,12 +64,6 @@ status smallint, primary key (fileid) ); -create table declarations - (declid smallint not null, - langid tinyint not null, - declaration char(255) not null, - primary key (declid, langid) -); create index indexindex on indexes using btree (symid); create index symbolindex on symbols using btree (symname); @@ -72,4 +76,4 @@ grant select on releases to public; grant select on usage to public; grant select on status to public; - +grant select on declarations to public; \ No newline at end of file |
|
From: Malcolm B. <mb...@us...> - 2001-11-20 15:34:02
|
Update of /cvsroot/lxr/lxr
In directory usw-pr-cvs1:/tmp/cvs-serv21593
Modified Files:
ident
Log Message:
Remove pre-CSS & template code
Index: ident
===================================================================
RCS file: /cvsroot/lxr/lxr/ident,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- ident 2001/11/18 03:31:33 1.12
+++ ident 2001/11/20 15:34:00 1.13
@@ -124,71 +124,6 @@
));
}
-sub ident_ {
- print("Type the full name of an identifier to summarize ",
- "(a function name, variable name, typedef, etc).\n",
- "<p>Matches are case-sensitive.\n");
-
- print("<form method=get action=\"ident\">\n");
-
- foreach ($config->allvariables) {
- if ($config->variable($_) ne $config->vardefault($_)) {
- print("<input type=hidden name=\"",$_, "\" ",
- "value=\"", $config->variable($_), "\">\n");
- }
- }
-
- print("<b>Identifier: </b><input type=text name=\"i\" ",
- "value=\"",$identifier,"\" size=15>\n",
- "<input type=submit value=\"Find\">\n",
- "</form>\n");
-
-
- if ($identifier) {
- my @refs = $index->getindex($identifier, $release);
-
- print("<span class=search-ident>$identifier</span>\n");
-
- if (@refs) {
- my $def;
-
- # print("<ul>\n"); CSS _PH_
- print "<span class=search-ul>\n";
- while ($def = shift(@refs)) {
- my ($file, $line, $type, $rel) = @$def;
-
- $rel &&= "(member of ".idref($rel, "search-member", $rel).")";
-
- print("<span class=search-li1> $type_names{$type} in ".
- fileref("$file, line $line", "search-decl",
- $file, $line).
- " $rel</span>\n");
- }
- print "</span>\n";
- # print("</ul>\n");
-
- my @uses = $index->getreference($identifier, $release);
-
- if (@uses) {
- @uses = sort { $$a[0] cmp $$b[0] } @uses;
-
- my $ref;
- while ($ref = shift(@uses)) {
- my ($file, $line) = @$ref;
-
- print("<span class=search-li2> ".
- fileref("$file, line $line", "search-ref",
- $file, $line).
- "</span>\n");
- }
- }
- }
- else {
- print("<br><b>Not used</b>");
- }
- }
-}
-
httpinit;
|
|
From: Malcolm B. <mb...@us...> - 2001-11-18 03:31:37
|
Update of /cvsroot/lxr/lxr/templates
In directory usw-pr-cvs1:/tmp/cvs-serv15958/templates
Modified Files:
html-ident.html lxr.conf
Log Message:
Fix bug 476695 - Java interfaces display as docs.
Changes the type field in the indexes table to be a (langid, typeid) tuple,
and adds another table to look up the (langid, typeid) -> string mapping.
This means that each language module can manage its own string table and the
right identifier type can easily be displayed.
This also means that each identifier is tagged with the language it occurs in,
which could be used for filtering displayed results when browsing. This has
not been implemented.
This change is database incompatible - you will need to drop and recreate the
lxr database. MySQL has been tested, Postgres has not though the changes have
been made.
Also add some limited support for Makefile in generic.conf.
Index: html-ident.html
===================================================================
RCS file: /cvsroot/lxr/lxr/templates/html-ident.html,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- html-ident.html 2001/09/27 16:12:21 1.1
+++ html-ident.html 2001/11/18 03:31:34 1.2
@@ -18,7 +18,7 @@
<table>
<tr><td colspan='2'><b>Declarations:</b></td></tr>
$refs{<tr>
- <td>$fileref</td><td>$rel</td>
+ <td>$fileref</td><td>$type</td><td>$rel</td>
</tr>}
</table>
Index: lxr.conf
===================================================================
RCS file: /cvsroot/lxr/lxr/templates/lxr.conf,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- lxr.conf 2001/11/14 15:27:36 1.4
+++ lxr.conf 2001/11/18 03:31:34 1.5
@@ -76,7 +76,8 @@
# array MUST match
'filetype' => {
# Format is
- # Language name, filepatten regexp, module to invoke, tabwidth
+ # Language name, filepatten regexp, module to invoke,
+ # (optional )tabwidth
# Note that to have another language supported by Generic.pm,
# you must ensure that:
# a) exuberant ctags supports it
@@ -100,9 +101,10 @@
'Java' => ['Java', '(?i)\.java$' #'
, 'LXR::Lang::Java', '4'],
# ['Lisp', '(?i)\.cl$|\.clisp$|\.el$|\.l$|\.lisp$|\.lsp$|\.ml$' #'
-# , 'LXR::Lang::Generic'],
-# ['Make', '(?i)\.mak$|makefile*' #'
-# , 'LXR::Lang::Generic'],
+ # , 'LXR::Lang::Generic'],
+ # No tabwidth specified here as an example
+ 'Make' => ['Make', '(?i)\.mak$|makefile*' #'
+ , 'LXR::Lang::Generic'],
# ['Pascal', '(?i)\.p$|\.pas$' #'
# , 'LXR::Lang::Generic'],
'Perl' => ['Perl', '(?i)\.pl$|\.pm$|\.perl$' #'
|
|
From: Malcolm B. <mb...@us...> - 2001-11-18 03:31:37
|
Update of /cvsroot/lxr/lxr/lib/LXR/Index
In directory usw-pr-cvs1:/tmp/cvs-serv15958/lib/LXR/Index
Modified Files:
Mysql.pm Postgres.pm
Log Message:
Fix bug 476695 - Java interfaces display as docs.
Changes the type field in the indexes table to be a (langid, typeid) tuple,
and adds another table to look up the (langid, typeid) -> string mapping.
This means that each language module can manage its own string table and the
right identifier type can easily be displayed.
This also means that each identifier is tagged with the language it occurs in,
which could be used for filtering displayed results when browsing. This has
not been implemented.
This change is database incompatible - you will need to drop and recreate the
lxr database. MySQL has been tested, Postgres has not though the changes have
been made.
Also add some limited support for Makefile in generic.conf.
Index: Mysql.pm
===================================================================
RCS file: /cvsroot/lxr/lxr/lib/LXR/Index/Mysql.pm,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- Mysql.pm 2001/11/14 15:41:37 1.11
+++ Mysql.pm 2001/11/18 03:31:34 1.12
@@ -59,13 +59,14 @@
("delete from symbols where symname = ?");
$self->{indexes_select} = $self->{dbh}->prepare
- ("select f.filename, i.line, i.type, i.relsym ".
- "from symbols s, indexes i, files f, releases r ".
+ ("select f.filename, i.line, d.declaration, i.relsym ".
+ "from symbols s, indexes i, files f, releases r, declarations d ".
"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 = ?");
$self->{indexes_insert} = $self->{dbh}->prepare
- ("insert into indexes (symid, fileid, line, type, relsym) values (?, ?, ?, ?, ?)");
+ ("insert into indexes (symid, fileid, line, langid, type, relsym) values (?, ?, ?, ?, ?, ?)");
$self->{releases_select} = $self->{dbh}->prepare
("select * from releases where fileid = ? and release = ?");
@@ -89,21 +90,27 @@
"from symbols s, files f, releases r, useage u ".
"where s.symid = u.symid ".
"and f.fileid = u.fileid ".
- "and u.fileid = r.fileid and ".
- "s.symname = ? and r.release = ? ".
+ "and u.fileid = r.fileid ".
+ "and s.symname = ? and r.release = ? ".
"order by f.filename");
+ $self->{decl_select} = $self->{dbh}->prepare
+ ("select declid from declarations where langid = ? and ".
+ "declaration = ?");
+ $self->{decl_insert} = $self->{dbh}->prepare
+ ("insert into declarations (declid, langid, declaration) values (NULL, ?, ?)");
return $self;
}
sub index {
- my ($self, $symname, $fileid, $line, $type, $relsym) = @_;
+ my ($self, $symname, $fileid, $line, $langid, $type, $relsym) = @_;
$self->{indexes_insert}->execute($self->symid($symname),
- $fileid,
- $line,
- $type,
- $relsym ? $self->symid($relsym) : undef);
+ $fileid,
+ $line,
+ $langid,
+ $type,
+ $relsym ? $self->symid($relsym) : undef);
}
sub reference {
@@ -147,17 +154,6 @@
return @ret;
}
-sub relate {
- my ($self, $symname, $release, $rsymname, $reltype) = @_;
-
-# $relation{$self->symid($symname, $release)} .=
-# join("\t", $self->symid($rsymname, $release), $reltype, '');
-}
-
-sub getrelations {
- my ($self, $symname, $release) = @_;
-}
-
sub fileid {
my ($self, $filename, $revision) = @_;
my ($fileid);
@@ -268,6 +264,24 @@
%symcache = ();
}
+sub getdecid {
+ my ($self, $lang, $string) = @_;
+
+ my $rows = $self->{decl_select}->execute($lang, $string);
+ $self->{decl_select}->finish();
+
+ unless ($rows > 0) {
+ $self->{decl_insert}->execute($lang, $string);
+ }
+
+ $self->{decl_select}->execute($lang, $string);
+ my $id = $self->{decl_select}->fetchrow_array();
+ $self->{decl_select}->finish();
+
+ return $id;
+}
+
+
sub DESTROY {
my ($self) = @_;
$self->{files_select} = undef;
@@ -281,7 +295,9 @@
$self->{status_update} = undef;
$self->{usage_insert} = undef;
$self->{usage_select} = undef;
-
+ $self->{decl_select} = undef;
+ $self->{decl_insert} = undef;
+
if($self->{dbh}) {
$self->{dbh}->disconnect();
$self->{dbh} = undef;
Index: Postgres.pm
===================================================================
RCS file: /cvsroot/lxr/lxr/lib/LXR/Index/Postgres.pm,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- Postgres.pm 2001/08/15 15:50:27 1.7
+++ Postgres.pm 2001/11/18 03:31:34 1.8
@@ -28,7 +28,8 @@
$symbols_byname $symbols_byid $symnum_nextval
$symbols_remove $symbols_insert $indexes_select $indexes_insert
$releases_select $releases_insert $status_insert
- $status_update $usage_insert $usage_select);
+ $status_update $usage_insert $usage_select $decl_select
+ $declid_nextnum $decl_insert);
sub new {
@@ -65,13 +66,15 @@
("delete from symbols where symname = ?");
$indexes_select = $dbh->prepare
- ("select f.filename, i.line, i.type, i.relsym ".
- "from symbols s, indexes i, files f, releases r ".
+ ("select f.filename, i.line, d.type, i.relsym ".
+ "from symbols s, indexes i, files f, releases r, declarations d ".
"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 = ?");
$indexes_insert = $dbh->prepare
- ("insert into indexes values (?, ?, ?, ?, ?)");
+ ("insert into indexes (symid, fileid, line, langid, type, relsym) ".
+ "values (?, ?, ?, ?, ?, ?)");
$releases_select = $dbh->prepare
("select * from releases where fileid = ? and release = ?");
@@ -96,6 +99,15 @@
"and f.fileid = r.fileid and ".
"s.symname = ? and r.release = ?");
+ $declid_nextnum = $dbh->prepare
+ ("select nextval('declnum')");
+
+ $decl_select = $dbh->prepare
+ ("select declid from declarations where langid = ? and ".
+ "declaration = ?");
+ $decl_insert = $dbh->prepare
+ ("insert into declarations (declid, langid, declaration) values (?, ?, ?)");
+
return $self;
}
@@ -104,11 +116,12 @@
}
sub index {
- my ($self, $symname, $fileid, $line, $type, $relsym) = @_;
+ my ($self, $symname, $fileid, $line, $langid, $type, $relsym) = @_;
$indexes_insert->execute($self->symid($symname),
$fileid,
$line,
+ $langid,
$type,
$relsym ? $self->symid($relsym) : undef);
unless (++$transactions % $commitlimit) {
@@ -260,6 +273,26 @@
return $status_update->execute(2, $fileid, 1) > 0;
}
+sub getdecid {
+ my ($self, $lang, $string) = @_;
+
+ my $rows = $decl_select->execute($lang, $string);
+ $decl_select->finish();
+
+ unless ($rows > 0) {
+ $declid_nextnum->execute();
+ my ($declid) = $declid_nextnum->fetchrow_array();
+ $decl_insert->execute($declid, $lang, $string);
+ }
+
+ $decl_select->execute($lang, $string);
+ my $id = decl_select->fetchrow_array();
+ $decl_select->finish();
+
+ return $id;
+}
+
+
sub END {
$files_select = undef;
$filenum_nextval = undef;
@@ -274,7 +307,10 @@
$status_update = undef;
$usage_insert = undef;
$usage_select = undef;
-
+ $declid_nextnum = undef;
+ $decl_select = undef;
+ $decl_insert = undef;
+
$dbh->commit();
$dbh->disconnect();
$dbh = undef;
|
|
From: Malcolm B. <mb...@us...> - 2001-11-18 03:31:37
|
Update of /cvsroot/lxr/lxr/lib/LXR/Lang
In directory usw-pr-cvs1:/tmp/cvs-serv15958/lib/LXR/Lang
Modified Files:
Generic.pm generic.conf
Log Message:
Fix bug 476695 - Java interfaces display as docs.
Changes the type field in the indexes table to be a (langid, typeid) tuple,
and adds another table to look up the (langid, typeid) -> string mapping.
This means that each language module can manage its own string table and the
right identifier type can easily be displayed.
This also means that each identifier is tagged with the language it occurs in,
which could be used for filtering displayed results when browsing. This has
not been implemented.
This change is database incompatible - you will need to drop and recreate the
lxr database. MySQL has been tested, Postgres has not though the changes have
been made.
Also add some limited support for Makefile in generic.conf.
Index: Generic.pm
===================================================================
RCS file: /cvsroot/lxr/lxr/lib/LXR/Lang/Generic.pm,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- Generic.pm 2001/11/17 04:00:55 1.7
+++ Generic.pm 2001/11/18 03:31:34 1.8
@@ -27,12 +27,10 @@
use strict;
use LXR::Common;
use LXR::Lang;
-require Exporter;
-
-use vars qw(@ISA $AUTOLOAD $langconf);
+use vars qw($AUTOLOAD);
-@ISA = ('LXR::Lang');
+@LXR::Lang::Generic::ISA = ('LXR::Lang');
sub new {
my ($proto, $pathname, $release, $lang) = @_;
@@ -52,11 +50,25 @@
close X;
%$self= (%$self, %$cfg);
+ # Set langid
+ $$self{'langid'} = $self->langinfo('langid');
+ die "No langid for language $lang" if !defined $self->langid;
+
+ # Setup the ctags to declid mapping
+ my $typemap =\%{$self->langinfo('typemap')};
+
+ foreach my $type (keys %$typemap) {
+ $typemap->{$type}=$index->getdecid($self->langid, $typemap->{$type});
+ }
+
return $self;
}
sub indexfile {
my ($self, $name, $path, $fileid, $index, $config) = @_;
+
+ my $typemap = $self->langinfo('typemap');
+
my $langforce = $ {$self->eclangnamemapping}{$self->language};
if (!defined $langforce) {
$langforce = $self->language;
@@ -76,6 +88,7 @@
my ($sym, $file, $line, $type,$ext) = split(/\t/, $_);
$line =~ s/;\"$//;
$ext =~ /language:(\w+)/;
+ $type = $typemap->{$type};
# TODO: can we make it more generic in parsing the extension fields?
if (defined($ext) && $ext =~ /^(struct|union|class|enum):(.*)/) {
@@ -85,7 +98,7 @@
$ext = undef;
}
- $index->index($sym, $fileid, $line, $type, $ext);
+ $index->index($sym, $fileid, $line, $self->langid, $type, $ext);
}
close(CTAGS);
@@ -240,18 +253,16 @@
if (exists $$map{$self->language}) {
$val = $$map{$self->language};
} else {
- $val = undef;
+ return undef;
}
if (defined $val && defined $$val{$item}) {
- if (ref($$val{$item})) {
- return wantarray ? @{$$val{$item}} : $$val{$item};
- }
- else {
+ if (ref($$val{$item}) eq 'ARRAY') {
+ return wantarray ? @{$$val{$item}} : $$val{$item};
+ }
return $$val{$item};
- }
} else {
- return undef;
+ return undef;
}
}
Index: generic.conf
===================================================================
RCS file: /cvsroot/lxr/lxr/lib/LXR/Lang/generic.conf,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- generic.conf 2001/11/14 15:27:36 1.7
+++ generic.conf 2001/11/18 03:31:34 1.8
@@ -35,6 +35,23 @@
'string', '"', '"',
'string', "'", "'",
'include', '#\s*include', "\$"],
+
+ 'typemap' => {
+ 'c' => 'class',
+ 'd' => 'macro (un)definition',
+ 'e' => 'enumerator',
+ 'f' => 'function definition',
+ 'g' => 'enumeration name',
+ 'm' => 'class, struct, or union member',
+ 'n' => 'namespace',
+ 'p' => 'function prototype or declaration',
+ 's' => 'structure name',
+ 't' => 'typedef',
+ 'u' => 'union name',
+ 'v' => 'variable definition',
+ 'x' => 'extern or forward variable declaration',
+ 'i' => 'interface'},
+ 'langid' => '1',
},
'C++' => {
@@ -65,6 +82,23 @@
'string', '"', '"',
'string', "'", "'",
'include', '#\s*include', "\$"],
+ 'typemap' => {
+ 'c' => 'class',
+ 'd' => 'macro (un)definition',
+ 'e' => 'enumerator',
+ 'f' => 'function definition',
+ 'g' => 'enumeration name',
+ 'm' => 'class, struct, or union member',
+ 'n' => 'namespace',
+ 'p' => 'function prototype or declaration',
+ 's' => 'structure name',
+ 't' => 'typedef',
+ 'u' => 'union name',
+ 'v' => 'variable definition',
+ 'x' => 'extern or forward variable declaration',
+ 'i' => 'interface'},
+ 'langid' => '2',
+
},
'Java' => {
@@ -87,19 +121,42 @@
'include' => ('import', "\$"),
'include' => ('package', "\$"),
],
-
+ 'typemap' => {
+ 'c' => 'class',
+ 'f' => 'field',
+ 'i' => 'interface',
+ 'm' => 'method',
+ 'p' => 'package',
+ },
+ 'langid' => '3',
},
'Fortran' => {
'reserved' => [],
+ 'typemap' => {
+ 'b' => 'block data',
+ 'c' => 'common block',
+ 'e' => 'entry point',
+ 'f' => 'function',
+ 'i' => 'interface',
+ 'k' => 'type component',
+ 'l' => 'label',
+ 'L' => 'local and common block variable',
+ 'm' => 'module',
+ 'n' => 'namelist',
+ 'p' => 'program',
+ },
+ 'langid' => '4',
},
'Pascal' => {
'reserved' => [],
+ 'langid' => '5',
},
'COBOL' => {
'reserved' => [],
+ 'langid' => '6',
},
'Perl' => {
'reserved' => [
@@ -113,6 +170,10 @@
'comment' => ('#', "\$"),
'comment' => ("^=\\w+", "^=cut"),
'string' => ("'", "'")],
+ 'typemap' => {
+ 's' => 'subroutine',
+ },
+ 'langid' => '7',
},
'Python' => {
@@ -131,6 +192,11 @@
'string' => ('"', '"'),
'string' => ("'", "'"),
'atom' => ('\\\\.', '')],
+ 'typemap' => {
+ 'c' => 'class',
+ 'f' => 'function',
+ },
+ 'langid' => '8',
},
'php' => {
'reserved' => ['and','$argv','$argc','break','case','class',
@@ -157,6 +223,22 @@
'include', 'require_once', "\$",
'include', 'include_once', "\$"
],
+ 'typemap' => {
+ 'c' => 'class',
+ 'f' => 'function',
+ },
+ 'langid' => '9',
},
+ 'Make' => {
+ 'reserved' => {},
+ 'spec' => ['comment' => ('#', "\$"),
+ 'string' => ('"', '"'),
+ 'string' => ("'", "'"),
+ 'include' => ('^ *-?include', '\$')],
+ 'typemap' => {
+ 'm' => 'macro',
+ },
+ 'langid' => '10',
+ },
}
}
|