lxr-commits Mailing List for LXR Cross Referencer (Page 10)
Brought to you by:
ajlittoz
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(11) |
Sep
(13) |
Oct
(11) |
Nov
(19) |
Dec
(1) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(11) |
Feb
(14) |
Mar
(10) |
Apr
|
May
|
Jun
|
Jul
(8) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2003 |
Jan
|
Feb
|
Mar
(10) |
Apr
|
May
(2) |
Jun
(4) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2004 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
|
Jun
(26) |
Jul
(83) |
Aug
(4) |
Sep
(4) |
Oct
(9) |
Nov
|
Dec
(17) |
2005 |
Jan
(1) |
Feb
(71) |
Mar
(1) |
Apr
(3) |
May
(9) |
Jun
|
Jul
|
Aug
|
Sep
(4) |
Oct
(1) |
Nov
(6) |
Dec
|
2006 |
Jan
|
Feb
|
Mar
|
Apr
(35) |
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(12) |
2007 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
|
Mar
(30) |
Apr
(55) |
May
(28) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
(5) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(5) |
2013 |
Jan
(35) |
Feb
|
Mar
(7) |
Apr
(12) |
May
(1) |
Jun
(2) |
Jul
|
Aug
(1) |
Sep
(32) |
Oct
|
Nov
(45) |
Dec
(18) |
2014 |
Jan
(9) |
Feb
|
Mar
(10) |
Apr
(2) |
May
(4) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(7) |
Nov
(4) |
Dec
|
From: Malcolm B. <mb...@us...> - 2009-05-06 22:38:02
|
Update of /cvsroot/lxr/lxr/lib/LXR/Index In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv28856/lib/LXR/Index Modified Files: Mysql.pm Postgres.pm Log Message: Fix for bugs 2787781 and 2787771. Changes the interface to Mysql & Postgres to match the documentation so that fileindexed returns whether the file has been indexed, not whether it needs indexing. Aligned the Postgres and Mysql implementations of fileindexed, filereferenced, setfileindexed and setfilereferenced. NOTE: This commit will break any Index module that has not been updated. Part II will fix these Index: Mysql.pm =================================================================== RCS file: /cvsroot/lxr/lxr/lib/LXR/Index/Mysql.pm,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- Mysql.pm 26 Apr 2009 09:14:37 -0000 1.26 +++ Mysql.pm 6 May 2009 22:37:50 -0000 1.27 @@ -208,15 +208,24 @@ $self->{status_get}->finish(); if (!defined($status)) { - $self->{status_insert}->execute($fileid + 0, 0); + $status = 0; } - - return $status == 0; + return $status; } sub setfileindexed { my ($self, $fileid) = @_; - $self->{status_update}->execute(1, $fileid, 0); + my ($status); + + $self->{status_get}->execute($fileid); + $status = $self->{status_get}->fetchrow_array(); + $self->{status_get}->finish(); + + if (!defined($status)) { + $self->{status_insert}->execute($fileid + 0, 1); + } else { + $self->{status_update}->execute(1, $fileid, 0); + } } sub filereferenced { @@ -227,12 +236,22 @@ $status = $self->{status_get}->fetchrow_array(); $self->{status_get}->finish(); - return $status < 2; + return defined($status) && $status == 2; } sub setfilereferenced { my ($self, $fileid) = @_; - $self->{status_update}->execute(2, $fileid, 1); + my ($status); + + $self->{status_get}->execute($fileid); + $status = $self->{status_get}->fetchrow_array(); + $self->{status_get}->finish(); + + if (!defined($status)) { + $self->{status_insert}->execute($fileid + 0, 2); + } else { + $self->{status_update}->execute(2, $fileid, 1); + } } sub symdeclarations { Index: Postgres.pm =================================================================== RCS file: /cvsroot/lxr/lxr/lib/LXR/Index/Postgres.pm,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- Postgres.pm 26 Apr 2009 09:14:37 -0000 1.26 +++ Postgres.pm 6 May 2009 22:37:50 -0000 1.27 @@ -28,7 +28,7 @@ $files_select $filenum_nextval $files_insert $symbols_byname $symbols_byid $symnum_nextval $symbols_remove $symbols_insert $indexes_select $indexes_insert - $releases_select $releases_insert $status_insert + $releases_select $releases_insert $status_get $status_insert $status_update $usage_insert $usage_select $decl_select $declid_nextnum $decl_insert $delete_indexes $delete_usage $delete_status $delete_releases $delete_files $prefix); @@ -81,13 +81,10 @@ $releases_select = $dbh->prepare("select * from ${prefix}releases where fileid = ? and release = ?"); $releases_insert = $dbh->prepare("insert into ${prefix}releases values (?, ?)"); - + $status_get = $dbh->prepare("select status from ${prefix}status where fileid = ?"); $status_insert = $dbh->prepare - - # ("insert into status select ?, 0 except select fileid, 0 from status"); - ( "insert into ${prefix}status select ?, 0 where not exists " - . "(select * from ${prefix}status where fileid = ?)"); - + ("insert into ${prefix}status (fileid, status) values (?, ?)"); + $status_update = $dbh->prepare("update ${prefix}status set status = ? where fileid = ? and status <= ?"); @@ -198,30 +195,59 @@ _commitIfLimit(); } -# If this file has not been indexed earlier, mark it as being indexed -# now and return true. Return false if already indexed. sub fileindexed { my ($self, $fileid) = @_; + my ($status); - $status_insert->execute($fileid + 0, $fileid + 0); - _commitIfLimit(); - return $status_update->execute(1, $fileid + 0, 0) > 0; + $status_get->execute($fileid); + $status = $status_get->fetchrow_array(); + $status_get->finish(); + + if (!defined($status)) { + $status = 0; + } + return $status; } sub setfileindexed { my ($self, $fileid) = @_; - $status_update->execute(1, $fileid, 0); + my ($status); + + $status_get->execute($fileid); + $status = $status_get->fetchrow_array(); + $status_get->finish(); + + if (!defined($status)) { + $status_insert->execute($fileid + 0, 1); + } else { + $status_update->execute(1, $fileid, 0); + } } sub filereferenced { my ($self, $fileid) = @_; + my ($status); - return $status_update->execute(2, $fileid, 1) > 0; + $status_get->execute($fileid); + $status = $status_get->fetchrow_array(); + $status_get->finish(); + + return defined($status) && $status == 2; } sub setfilereferenced { my ($self, $fileid) = @_; - $status_update->execute(2, $fileid, 1); + my ($status); + + $status_get->execute($fileid); + $status = $status_get->fetchrow_array(); + $status_get->finish(); + + if (!defined($status)) { + $status_insert->execute($fileid + 0, 2); + } else { + $status_update->execute(2, $fileid, 1); + } } sub symdeclarations { |
From: Malcolm B. <mb...@us...> - 2009-05-06 22:34:25
|
Update of /cvsroot/lxr/lxr In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv28643 Modified Files: initdb-postgres Log Message: Make drop commands at start of script clean out dependencies Index: initdb-postgres =================================================================== RCS file: /cvsroot/lxr/lxr/initdb-postgres,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- initdb-postgres 20 Dec 2006 19:54:31 -0000 1.7 +++ initdb-postgres 6 May 2009 22:34:07 -0000 1.8 @@ -1,13 +1,13 @@ drop sequence lxr_filenum; drop sequence lxr_symnum; drop sequence lxr_declnum; -drop table lxr_files; -drop table lxr_symbols; -drop table lxr_indexes; -drop table lxr_releases; -drop table lxr_usage; -drop table lxr_status; -drop table lxr_declarations; +drop table lxr_files cascade; +drop table lxr_symbols cascade; +drop table lxr_indexes cascade; +drop table lxr_releases cascade; +drop table lxr_usage cascade; +drop table lxr_status cascade; +drop table lxr_declarations cascade; create sequence lxr_filenum cache 50; create sequence lxr_symnum cache 50; |
From: Malcolm B. <mb...@us...> - 2009-05-06 22:33:29
|
Update of /cvsroot/lxr/lxr-tools/tests In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv28549 Modified Files: AllTests.pm README lxr.conf Added Files: MysqlTest.pm initdb-mysql Log Message: Add tests for Mysql.pm --- NEW FILE: MysqlTest.pm --- # Test cases for the MySQL backend # Uses the lxr.conf file in the tests directory # Assumes the use of lxr_tests as the test database package MysqlTest; use strict; use Test::Unit; use LXR::Config; use LXR::Index::Mysql; use DBI; use base qw(Test::Unit::TestCase); use vars qw($config); sub new { my $self = shift()->SUPER::new(@_); return $self; } # define tests # Test fileid sub test_fileid { my $self = shift; my $mysql = $self->{'mysql'}; my $dbh = $self->{'dbh'}; my ($id, $id2); # Test generation and matching $id = $mysql->fileid("/lxr/tests/testpath", 1); $self->assert_not_null($id, "Fileid null"); $id2 = $mysql->fileid("/lxr/tests/testpath", 1); $self->assert_equals($id, $id2, "Fileid doesn't match"); $id2 = $mysql->fileid("/lxr/tests/testpath", 2); $self->assert_not_equals($id, $id2, "Match even though revisions different"); $id2 = $mysql->fileid("/lxr/tests/testpath/two", 1); $self->assert_not_equals($id, $id2); # Look in the database for the files my $data; $data = $dbh->selectrow_array("SELECT filename FROM lxr_files WHERE fileid = $id"); $self->assert_equals("/lxr/tests/testpath", $data); $data = $dbh->selectrow_array("SELECT revision FROM lxr_files WHERE fileid = $id"); $self->assert_equals(1, $data); $data = $dbh->selectrow_array("SELECT COUNT(filename) FROM lxr_files"); $self->assert_equals(3, $data, "Wrong number of rows in DB"); } # Tests for the fileindexed getter/setters sub test_fileindexed { my $self = shift; my $mysql = $self->{'mysql'}; my $dbh = $self->{'dbh'}; my $status; # Indexed $status = $mysql->fileindexed(1789); $self->assert_equals(0, $status); $mysql->setfileindexed(1789); $status = $mysql->fileindexed(1789); $self->assert($status, "Indexed should be true"); $mysql->setfileindexed(17890); $status = $mysql->fileindexed(1789); $self->assert($status); $mysql->setfilereferenced(17890); $status = $mysql->fileindexed(17890); $self->assert($status, "Expected indexed to be true"); } sub test_filereferenced { my $self = shift; my $mysql = $self->{'mysql'}; my $dbh = $self->{'dbh'}; my $status; # referenced $status = $mysql->filereferenced(17890); $self->assert(!$status, "Referenced should be false (fixture interference?)"); $status = $mysql->filereferenced(1789); $self->assert(!$status, "Ref should be false"); $mysql->setfilereferenced(1789); $status = $mysql->filereferenced(1789); $self->assert($status); $status = $mysql->fileindexed(1789); $self->assert($status, "Setting referenced should set indexed"); } sub test_creation { my $self = shift; $self->assert($config->dbname =~ /^dbi:mysql:dbname/); $self->assert(defined($self->{'mysql'}), "Failed to create object"); $self->assert($self->{'mysql'}->isa("LXR::Index::Mysql"), "Not a Mysql object"); # Check we have connected to the database $self->assert_not_null($self->{'dbh'}, $DBI::errstr); } # Test symbol insertion and retrieval sub test_symbol { my $self = shift; my ($stat, $symname, $fid1, $fid2, $line, $langid, $type, $relsym); my $dbh = $self->{'dbh'}; my $mysql = $self->{'mysql'}; # Set up some dummy files $fid1 = $mysql->fileid("/lxr/tests/testfile1", "1.0.1"); $fid2 = $mysql->fileid("/a/nother/path/to/a/file/that\'s very/long", "longversionstringhere"); $mysql->setfilerelease($fid1, 1); $mysql->setfilerelease($fid2, 2); # Set up dummy declarations my ($id1, $id2); $id1 = $mysql->decid(1, "struct"); $id2 = $mysql->decid(1, "class"); # Now insert some symbols into the first release $mysql->setsymdeclaration("symbol1", $fid1, 1000, 1, $id1, undef); $mysql->setsymdeclaration("aVeryLongSymbolNameWithWeirdCapsGoesHere", $fid2, 101, 1, $id2, undef); # Check that the declarations are in the database my $data; $data = $dbh->selectall_arrayref("SELECT s.symname, i.line, i.type FROM lxr_indexes as i, lxr_symbols as s WHERE i.symid = s.symid AND i.fileid = $fid1"); $self->assert_equals( "symbol1", $data->[0]->[0]); $self->assert_equals(1000, $data->[0]->[1]); $self->assert_equals($id1, $data->[0]->[2]); $data = $dbh->selectall_arrayref("SELECT s.symname, i.line, i.type FROM lxr_indexes as i, lxr_symbols as s WHERE i.symid=s.symid AND i.fileid = $fid2"); $self->assert_equals("aVeryLongSymbolNameWithWeirdCapsGoesHere", $data->[0]->[0]); $self->assert_equals(101, $data->[0]->[1]); $self->assert_equals($id2, $data->[0]->[2]); # Now use the accessors my @syms; @syms = $mysql->symdeclarations("symbol1", 1); # returns filename, line, declaration, relsym $self->assert_equals("/lxr/tests/testfile1", $syms[0]->[0]); $self->assert_equals(1000, $syms[0]->[1]); $self->assert_equals("struct", $syms[0]->[2]); $self->assert_null($syms[0]->[3]); } # Test reference insertion and retrival sub test_references { my $self = shift; my $mysql = $self->{'mysql'}; my $dbh = $self->{'dbh'}; my ($fid1, $fid2); # Set up some dummy files $fid1 = $mysql->fileid("/lxr/tests/testfile1", "1.0.1"); $fid2 = $mysql->fileid("/a/nother/path/to/a/file/that\'s very/long", "longversionstringhere"); $mysql->setfilerelease($fid1, 1); $mysql->setfilerelease($fid2, 2); # Set up dummy declarations my ($id1, $id2); $id1 = $mysql->decid(1, "struct"); $id2 = $mysql->decid(1, "class"); # Now insert some symbols into the first release $mysql->setsymdeclaration("symbol1", $fid1, 1000, 1, $id1, undef); $mysql->setsymdeclaration("aVeryLongSymbolNameWithWeirdCapsGoesHere", $fid2, 101, 1, $id2, undef); # Set references to symbols $mysql->setsymreference("symbol1", $fid1, 2000); $mysql->setsymreference("symbol1", $fid2, 3000); $mysql->setsymreference("symbol1", $fid1, 2001); # Check directly in database my $data; $data = $dbh->selectall_arrayref("SELECT * from lxr_useage WHERE symid=".$mysql->symid("symbol1")." ORDER BY line"); $self->assert_equals(2000,$data->[0]->[1]); $self->assert_equals(2001, $data->[1]->[1]); # And via accessor my @data; @data = $mysql->symreferences("symbol1", 1); # returns filename, line $self->assert_equals("/lxr/tests/testfile1", $data[0]->[0]); $self->assert_equals(2000, $data[0]->[1]); $self->assert_equals(1, $#data); $self->assert_equals("/lxr/tests/testfile1", $data[1]->[0]); $self->assert_equals(2001, $data[1]->[1]); @data = $mysql->symreferences("symbol1", 2); $self->assert_equals(0, $#data); $self->assert_equals("/a/nother/path/to/a/file/that\'s very/long", $data[0]->[0]); $self->assert_equals(3000, $data[0]->[1]); } # Test the declaration id creation logic sub test_decid { my $self = shift; my $mysql = $self->{'mysql'}; my ($id1, $id2); $id1 = $mysql->decid(1, "struct"); $id2 = $mysql->decid(1, "class"); $self->assert($id1 != $id2); } # set_up and tear_down are used to # prepare and release resources need for testing # Prepare the database for the run sub set_up { my $self = shift; # Clear out all data in the database system("mysql -u lxr < initdb-mysql > /dev/null 2>&1"); # Create config $config = new LXR::Config("http://test/lxr", "./lxr.conf"); # Create Mysql object $self->{'mysql'} = new LXR::Index($config->dbname); # Create direct connection to DB $self->{'dbh'} = DBI->connect($config->dbname, "lxr", $config->{dbpass}); } sub tear_down { my $self = shift; $self->{'mysql'} = undef; $config = undef; $self->{'dbh'}->disconnect(); } 1; --- NEW FILE: initdb-mysql --- /* Read this into mysql with "\. initdb-mysql" when logged in as root to delete the old lxr_tests database and create a new one*/ drop database if exists lxr_tests; create database lxr_tests; use lxr_tests; /* symnum filenum */ create table lxr_files ( filename char(255) binary not null, revision char(255) binary not null, fileid int not null auto_increment, primary key (fileid) /*, unique (filename, revision) */ ); create table lxr_symbols ( symname char(255) binary not null, symid int not null auto_increment, primary key (symid), unique (symname) ); create table lxr_indexes ( symid int not null references lxr_symbols, fileid int not null references lxr_files, line int not null, langid tinyint not null references lxr_declarations, type smallint not null references lxr_declarations, relsym int references lxr_symbols ); create table lxr_releases (fileid int not null references lxr_files, rel char(255) binary not null, primary key (fileid,rel) ); create table lxr_useage (fileid int not null references lxr_files, line int not null, symid int not null references lxr_symbols ); create table lxr_status (fileid int not null references lxr_files, status tinyint not null, primary key (fileid) ); create table lxr_declarations (declid smallint not null auto_increment, langid tinyint not null, declaration char(255) not null, primary key (declid, langid) ); create index lxr_indexindex on lxr_indexes (symid) ; create unique index lxr_symbolindex on lxr_symbols (symname) ; create index lxr_useageindex on lxr_useage (symid) ; create index lxr_filelookup on lxr_files (filename); grant all on lxr_tests.* to lxr@localhost; Index: AllTests.pm =================================================================== RCS file: /cvsroot/lxr/lxr-tools/tests/AllTests.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- AllTests.pm 21 Apr 2009 15:25:00 -0000 1.1 +++ AllTests.pm 6 May 2009 22:33:08 -0000 1.2 @@ -17,7 +17,8 @@ $suite->add_test(Test::Unit::TestSuite->new("SecurityTest")); # $suite->add_test(Test::Unit::TestSuite->new("CVSTest")); $suite->add_test(Test::Unit::TestSuite->new("PlainTest")); -# $suite->add_test(Test::Unit::TestSuite->new("BKTest")); + # $suite->add_test(Test::Unit::TestSuite->new("BKTest")); + $suite->add_test(Test::Unit::TestSuite->new("MysqlTest")); return $suite; } Index: README =================================================================== RCS file: /cvsroot/lxr/lxr-tools/tests/README,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- README 21 Apr 2009 16:52:33 -0000 1.2 +++ README 6 May 2009 22:33:08 -0000 1.3 @@ -1,5 +1,12 @@ To run these tests: +- Set up the databases for testing: + - Mysql: mysql -u root -p + \. initdb-mysql + - Postgres: createdb lxr_tests + For Postgres, it's also necessary that the user running the + tests can alter/drop/create the database without requiring a + password entry. This can be configured in lxr.conf in this directory. - Make sure Test::Unit is installed - Execute TestRunner.pl AllTests Index: lxr.conf =================================================================== RCS file: /cvsroot/lxr/lxr-tools/tests/lxr.conf,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- lxr.conf 21 Apr 2009 16:48:58 -0000 1.2 +++ lxr.conf 6 May 2009 22:33:08 -0000 1.3 @@ -79,7 +79,7 @@ # For mysql, the format is dbi:mysql:dbname=<name> # for Postgres, it is dbi:Pg:dbname=<name> # for Oracle, it is dbi:Oracle:host=localhost;sid=DEVMMS;port=1521 - 'dbname' => 'dbi:mysql:dbname=lxr', + 'dbname' => 'dbi:mysql:dbname=lxr_tests', # If you need to specify the username or password for the database connection, # uncomment the following two lines @@ -174,4 +174,152 @@ }, -}) + }, + { + # baseurl is used to select configuration block. + + 'baseurl' => 'http://test/pg/lxr', # Put your URL here + 'virtroot' => '/lxr', # The bit after the / above + + 'variables' => { + # 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('test-versions') ], + # 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)]}, + }, + + + # 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 + + # 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' => '../test-data/source/', + + # The name to display for this source tree + 'sourcerootname' => 'Test Configuration - Postgres', + 'sourceparams' => {'cachepath' => '/a/path/to/cache', 'param2' => 'secondparam'}, + + # 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> + # for Oracle, it is dbi:Oracle:host=localhost;sid=DEVMMS;port=1521 + 'dbname' => 'dbi:Pg:dbname=lxr_tests', + + # If you need to specify the username or password for the database connection, + # uncomment the following two lines + # 'dbpass' => 'lxr', + # 'dbuser' => 'lxr', + + # For using glimpse, the directory to store the .glimpse files in is required + 'glimpsedir' => '/tmp/lxr-glimpse', + + # Location of swish-e index database files if using swish-e + 'swishdir' => '/tmp/lxr-swishe/', + + + # 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)$', #' + + # How to map files to languages + # Note that the string for the key and the first entry in the + # array MUST match + 'filetype' => { + # Format is + # 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 + # b) generic.conf is updated to specify information about the language + # c) the name of the language given here matches the entry in generic.conf + 'C' => ['C', '\.c$' #' + , 'LXR::Lang::Generic', '8'], + 'C++' => ['C++', '\.C$|((?i)\.c\+\+$|\.cc$|\.cpp$|\.cxx$|\.h$|\.hh$|\.hpp$|\.hxx$|\.h\+\+$)' #' + , 'LXR::Lang::Generic', '8'], + +# Some languages are commented out until the relevant entries in generic.conf are made +# The list here is the set supported by ctags 5.0.1 +# ['Beta', '(?i)\.bet$' #' +# , 'LXR::Lang::Generic'], +# ['Cobol', '(?i)\.cob$' #' +# , 'LXR::Lang::Generic'], +# ['Eiffel', '(?i)\.e$' #' +# , 'LXR::Lang::Generic'], +# ['Fortran', '(?i)\.f$|\.for$|\.ftn$|\.f77$|\.f90$|\.f95$' #' +# , 'LXR::Lang::Generic'], + 'Java' => ['Java', '(?i)\.java$' #' + , 'LXR::Lang::Java', '4'], +# ['Lisp', '(?i)\.cl$|\.clisp$|\.el$|\.l$|\.lisp$|\.lsp$|\.ml$' #' + # , '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$' #' + , 'LXR::Lang::Generic', '4'], + 'php' => ['php', '(?i)\.php$|\.php3$|\.phtml$' #' + , 'LXR::Lang::Generic', '2'], + 'Python' => ['Python', '(?i)\.py$|\.python$' #' + , 'LXR::Lang::Generic', '4'], +# ['rexx', '(?i)\.cmd$|\.rexx$|\.rx$' #' +# , 'LXR::Lang::Generic'], +# ['ruby', '(?i)\.rb$' #' +# , 'LXR::Lang::Generic'], +# ['scheme', '(?i)\.sch$|\.scheme$|\.scm$|\.sm$' #' +# , 'LXR::Lang::Generic'], +# ['shell', '(?i)\.sh$|\.bsh$|\.bash$|\.ksh$|\.zsh$' #' +# , 'LXR::Lang::Generic'], +# ['s-Lang', '(?i)\.sl$' #' +# , 'LXR::Lang::Generic'], +# ['tcl', '(?i)\.tcl$|\.wish$' #' +# , 'LXR::Lang::Generic'], + }, + + 'ignoredirs' => [], + # 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. + + 'interpreters' => { + 'perl' => 'Perl', +# 'bash' => 'shell', +# 'csh' => 'shell', + 'python' => 'Python', + }, + + +}, + +) |
From: AdrianIssott <adr...@us...> - 2009-04-26 09:14:41
|
Update of /cvsroot/lxr/lxr/lib/LXR/Index In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv6666/lib/LXR/Index Modified Files: Mysql.pm Postgres.pm Oracle.pm Log Message: Feature 1691378 (Rearchitect the DB backends) Part V * Re-ordered DBI implementations to be in API order used in LXR::Index * No code changes Index: Mysql.pm =================================================================== RCS file: /cvsroot/lxr/lxr/lib/LXR/Index/Mysql.pm,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- Mysql.pm 25 Apr 2009 20:40:24 -0000 1.25 +++ Mysql.pm 26 Apr 2009 09:14:37 -0000 1.26 @@ -138,18 +138,101 @@ return $self; } -sub setsymdeclaration { - my ($self, $symname, $fileid, $line, $langid, $type, $relsym) = @_; +sub DESTROY { + my ($self) = @_; + $self->{files_select} = undef; + $self->{files_insert} = undef; + $self->{symbols_byname} = undef; + $self->{symbols_byid} = undef; + $self->{symbols_insert} = undef; + $self->{indexes_insert} = undef; + $self->{releases_insert} = undef; + $self->{status_insert} = undef; + $self->{status_update} = undef; + $self->{usage_insert} = undef; + $self->{usage_select} = undef; + $self->{decl_select} = undef; + $self->{decl_insert} = undef; + $self->{delete_indexes} = undef; + $self->{delete_useage} = undef; + $self->{delete_status} = undef; + $self->{delete_releases} = undef; + $self->{delete_files} = undef; - $self->{indexes_insert}->execute($self->symid($symname), - $fileid, $line, $langid, $type, $relsym ? $self->symid($relsym) : undef); + if ($self->{dbh}) { + $self->{dbh}->disconnect(); + $self->{dbh} = undef; + } } -sub setsymreference { - my ($self, $symname, $fileid, $line) = @_; +# +# LXR::Index API Implementation +# - $self->{usage_insert}->execute($fileid, $line, $self->symid($symname)); +sub fileid { + my ($self, $filename, $revision) = @_; + my ($fileid); + + unless (defined($fileid = $files{"$filename\t$revision"})) { + $self->{files_select}->execute($filename, $revision); + ($fileid) = $self->{files_select}->fetchrow_array(); + unless ($fileid) { + $self->{files_insert}->execute($filename, $revision); + $self->{files_select}->execute($filename, $revision); + ($fileid) = $self->{files_select}->fetchrow_array(); + } + $files{"$filename\t$revision"} = $fileid; + $self->{files_select}->finish(); + } + return $fileid; +} + +sub setfilerelease { + my ($self, $fileid, $release) = @_; + + my $rows = $self->{releases_select}->execute($fileid + 0, $release); + $self->{releases_select}->finish(); + + unless ($rows > 0) { + $self->{releases_insert}->execute($fileid, $release); + $self->{releases_insert}->finish(); + } +} + +sub fileindexed { + my ($self, $fileid) = @_; + my ($status); + + $self->{status_get}->execute($fileid); + $status = $self->{status_get}->fetchrow_array(); + $self->{status_get}->finish(); + + if (!defined($status)) { + $self->{status_insert}->execute($fileid + 0, 0); + } + + return $status == 0; +} +sub setfileindexed { + my ($self, $fileid) = @_; + $self->{status_update}->execute(1, $fileid, 0); +} + +sub filereferenced { + my ($self, $fileid) = @_; + my ($status); + + $self->{status_get}->execute($fileid); + $status = $self->{status_get}->fetchrow_array(); + $self->{status_get}->finish(); + + return $status < 2; +} + +sub setfilereferenced { + my ($self, $fileid) = @_; + $self->{status_update}->execute(2, $fileid, 1); } sub symdeclarations { @@ -169,6 +252,13 @@ return @ret; } +sub setsymdeclaration { + my ($self, $symname, $fileid, $line, $langid, $type, $relsym) = @_; + + $self->{indexes_insert}->execute($self->symid($symname), + $fileid, $line, $langid, $type, $relsym ? $self->symid($relsym) : undef); +} + sub symreferences { my ($self, $symname, $release) = @_; my ($rows, @ret); @@ -184,36 +274,26 @@ return @ret; } -sub fileid { - my ($self, $filename, $revision) = @_; - my ($fileid); +sub setsymreference { + my ($self, $symname, $fileid, $line) = @_; - # CAUTION: $revision is not $release! - unless (defined($fileid = $files{"$filename\t$revision"})) { - $self->{files_select}->execute($filename, $revision); - ($fileid) = $self->{files_select}->fetchrow_array(); - unless ($fileid) { - $self->{files_insert}->execute($filename, $revision); - $self->{files_select}->execute($filename, $revision); - ($fileid) = $self->{files_select}->fetchrow_array(); - } - $files{"$filename\t$revision"} = $fileid; - $self->{files_select}->finish(); - } - return $fileid; -} + $self->{usage_insert}->execute($fileid, $line, $self->symid($symname)); -# Indicate that this filerevision is part of this release -sub setfilerelease { - my ($self, $fileid, $release) = @_; +} - my $rows = $self->{releases_select}->execute($fileid + 0, $release); - $self->{releases_select}->finish(); +sub issymbol { + my ($self, $symname, $release) = @_; # TODO make use of $release + my ($symid); - unless ($rows > 0) { - $self->{releases_insert}->execute($fileid, $release); - $self->{releases_insert}->finish(); + $symid = $symcache{$symname}; + unless (defined($symid)) { + $self->{symbols_byname}->execute($symname); + ($symid) = $self->{symbols_byname}->fetchrow_array(); + $self->{symbols_byname}->finish(); + $symcache{$symname} = $symid; } + + return $symid; } sub symid { @@ -250,66 +330,6 @@ return $symname; } -sub issymbol { - my ($self, $symname, $release) = @_; # TODO make use of $release - my ($symid); - - $symid = $symcache{$symname}; - unless (defined($symid)) { - $self->{symbols_byname}->execute($symname); - ($symid) = $self->{symbols_byname}->fetchrow_array(); - $self->{symbols_byname}->finish(); - $symcache{$symname} = $symid; - } - - return $symid; -} - -# If this file has not been indexed earlier return true. Return false -# if already indexed. -sub fileindexed { - my ($self, $fileid) = @_; - my ($status); - - $self->{status_get}->execute($fileid); - $status = $self->{status_get}->fetchrow_array(); - $self->{status_get}->finish(); - - if (!defined($status)) { - $self->{status_insert}->execute($fileid + 0, 0); - } - - return $status == 0; -} - -sub setfileindexed { - my ($self, $fileid) = @_; - $self->{status_update}->execute(1, $fileid, 0); -} - -sub filereferenced { - my ($self, $fileid) = @_; - my ($status); - - $self->{status_get}->execute($fileid); - $status = $self->{status_get}->fetchrow_array(); - $self->{status_get}->finish(); - - return $status < 2; -} - -sub setfilereferenced { - my ($self, $fileid) = @_; - $self->{status_update}->execute(2, $fileid, 1); -} - -# This function should be called before parsing each new file, -# if this is not done the too much memory will be used and -# tings will become very slow. -sub emptycache { - %symcache = (); -} - sub decid { my ($self, $lang, $string) = @_; @@ -327,6 +347,10 @@ return $id; } +sub emptycache { + %symcache = (); +} + sub purge { my ($self, $version) = @_; @@ -339,31 +363,4 @@ $self->{delete_files}->execute($version); } -sub DESTROY { - my ($self) = @_; - $self->{files_select} = undef; - $self->{files_insert} = undef; - $self->{symbols_byname} = undef; - $self->{symbols_byid} = undef; - $self->{symbols_insert} = undef; - $self->{indexes_insert} = undef; - $self->{releases_insert} = undef; - $self->{status_insert} = undef; - $self->{status_update} = undef; - $self->{usage_insert} = undef; - $self->{usage_select} = undef; - $self->{decl_select} = undef; - $self->{decl_insert} = undef; - $self->{delete_indexes} = undef; - $self->{delete_useage} = undef; - $self->{delete_status} = undef; - $self->{delete_releases} = undef; - $self->{delete_files} = undef; - - if ($self->{dbh}) { - $self->{dbh}->disconnect(); - $self->{dbh} = undef; - } -} - 1; Index: Postgres.pm =================================================================== RCS file: /cvsroot/lxr/lxr/lib/LXR/Index/Postgres.pm,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- Postgres.pm 25 Apr 2009 20:40:24 -0000 1.25 +++ Postgres.pm 26 Apr 2009 09:14:37 -0000 1.26 @@ -131,29 +131,97 @@ return $self; } -sub emptycache { - %symcache = (); +sub END { + $files_select = undef; + $filenum_nextval = undef; + $files_insert = undef; + $symbols_byname = undef; + $symbols_byid = undef; + $symnum_nextval = undef; + $symbols_remove = undef; + $symbols_insert = undef; + $indexes_select = undef; + $indexes_insert = undef; + $releases_select = undef; + $releases_insert = undef; + $status_insert = undef; + $status_update = undef; + $usage_insert = undef; + $usage_select = undef; + $decl_select = undef; + $declid_nextnum = undef; + $decl_insert = undef; + $delete_indexes = undef; + $delete_usage = undef; + $delete_status = undef; + $delete_releases = undef; + $delete_files = undef; + + $dbh->commit(); + $dbh->disconnect(); + $dbh = undef; } -sub commit_if_limit { - unless (++$transactions % $commitlimit) { - $dbh->commit(); +# +# LXR::Index API Implementation +# + +sub fileid { + my ($self, $filename, $revision) = @_; + my ($fileid); + + unless (defined($fileid = $files{"$filename\t$revision"})) { + $files_select->execute($filename, $revision); + ($fileid) = $files_select->fetchrow_array(); + unless ($fileid) { + $filenum_nextval->execute(); + ($fileid) = $filenum_nextval->fetchrow_array(); + $files_insert->execute($filename, $revision, $fileid); + } + $files{"$filename\t$revision"} = $fileid; } + _commitIfLimit(); + return $fileid; } -sub setsymdeclaration { - my ($self, $symname, $fileid, $line, $langid, $type, $relsym) = @_; +sub setfilerelease { + my ($self, $fileid, $release) = @_; - $indexes_insert->execute($self->symid($symname), - $fileid, $line, $langid, $type, $relsym ? $self->symid($relsym) : undef); - commit_if_limit(); + $releases_select->execute($fileid + 0, $release); + my $firstrow = $releases_select->fetchrow_array(); + + # $releases_select->finish(); + + unless ($firstrow) { + $releases_insert->execute($fileid + 0, $release); + } + _commitIfLimit(); } -sub setsymreference { - my ($self, $symname, $fileid, $line) = @_; +# If this file has not been indexed earlier, mark it as being indexed +# now and return true. Return false if already indexed. +sub fileindexed { + my ($self, $fileid) = @_; - $usage_insert->execute($fileid, $line, $self->symid($symname)); - commit_if_limit(); + $status_insert->execute($fileid + 0, $fileid + 0); + _commitIfLimit(); + return $status_update->execute(1, $fileid + 0, 0) > 0; +} + +sub setfileindexed { + my ($self, $fileid) = @_; + $status_update->execute(1, $fileid, 0); +} + +sub filereferenced { + my ($self, $fileid) = @_; + + return $status_update->execute(2, $fileid, 1) > 0; +} + +sub setfilereferenced { + my ($self, $fileid) = @_; + $status_update->execute(2, $fileid, 1); } sub symdeclarations { @@ -179,6 +247,14 @@ return @ret; } +sub setsymdeclaration { + my ($self, $symname, $fileid, $line, $langid, $type, $relsym) = @_; + + $indexes_insert->execute($self->symid($symname), + $fileid, $line, $langid, $type, $relsym ? $self->symid($relsym) : undef); + _commitIfLimit(); +} + sub symreferences { my ($self, $symname, $release) = @_; my ($rows, @ret); @@ -194,39 +270,22 @@ return @ret; } -sub fileid { - my ($self, $filename, $revision) = @_; - my ($fileid); - - # CAUTION: $revision is not $release! +sub setsymreference { + my ($self, $symname, $fileid, $line) = @_; - unless (defined($fileid = $files{"$filename\t$revision"})) { - $files_select->execute($filename, $revision); - ($fileid) = $files_select->fetchrow_array(); - unless ($fileid) { - $filenum_nextval->execute(); - ($fileid) = $filenum_nextval->fetchrow_array(); - $files_insert->execute($filename, $revision, $fileid); - } - $files{"$filename\t$revision"} = $fileid; - } - commit_if_limit(); - return $fileid; + $usage_insert->execute($fileid, $line, $self->symid($symname)); + _commitIfLimit(); } -# Indicate that this filerevision is part of this release -sub setfilerelease { - my ($self, $fileid, $release) = @_; - - $releases_select->execute($fileid + 0, $release); - my $firstrow = $releases_select->fetchrow_array(); - - # $releases_select->finish(); +sub issymbol { + my ($self, $symname, $release) = @_; # TODO make use of $release - unless ($firstrow) { - $releases_insert->execute($fileid + 0, $release); + unless (exists($symcache{$symname})) { + $symbols_byname->execute($symname); + ($symcache{$symname}) = $symbols_byname->fetchrow_array(); } - commit_if_limit(); + + return $symcache{$symname}; } sub symid { @@ -243,7 +302,7 @@ } $symcache{$symname} = $symid; } - commit_if_limit(); + _commitIfLimit(); return $symid; } @@ -257,33 +316,6 @@ return $symname; } -sub issymbol { - my ($self, $symname, $release) = @_; # TODO make use of $release - - unless (exists($symcache{$symname})) { - $symbols_byname->execute($symname); - ($symcache{$symname}) = $symbols_byname->fetchrow_array(); - } - - return $symcache{$symname}; -} - -# If this file has not been indexed earlier, mark it as being indexed -# now and return true. Return false if already indexed. -sub fileindexed { - my ($self, $fileid) = @_; - - $status_insert->execute($fileid + 0, $fileid + 0); - commit_if_limit(); - return $status_update->execute(1, $fileid + 0, 0) > 0; -} - -sub filereferenced { - my ($self, $fileid) = @_; - - return $status_update->execute(2, $fileid, 1) > 0; -} - sub decid { my ($self, $lang, $string) = @_; @@ -300,10 +332,14 @@ my $id = $decl_select->fetchrow_array(); $decl_select->finish(); - commit_if_limit(); + _commitIfLimit(); return $id; } +sub emptycache { + %symcache = (); +} + sub purge { my ($self, $version) = @_; @@ -314,49 +350,17 @@ $delete_status->execute($version); $delete_releases->execute($version); $delete_files->execute($version); - commit_if_limit(); -} - -sub setfileindexed { - my ($self, $fileid) = @_; - $status_update->execute(1, $fileid, 0); -} - -sub setfilereferenced { - my ($self, $fileid) = @_; - $status_update->execute(2, $fileid, 1); + _commitIfLimit(); } -sub END { - - $files_select = undef; - $filenum_nextval = undef; - $files_insert = undef; - $symbols_byname = undef; - $symbols_byid = undef; - $symnum_nextval = undef; - $symbols_remove = undef; - $symbols_insert = undef; - $indexes_select = undef; - $indexes_insert = undef; - $releases_select = undef; - $releases_insert = undef; - $status_insert = undef; - $status_update = undef; - $usage_insert = undef; - $usage_select = undef; - $decl_select = undef; - $declid_nextnum = undef; - $decl_insert = undef; - $delete_indexes = undef; - $delete_usage = undef; - $delete_status = undef; - $delete_releases = undef; - $delete_files = undef; +# +# Internal subroutines +# - $dbh->commit(); - $dbh->disconnect(); - $dbh = undef; +sub _commitIfLimit { + unless (++$transactions % $commitlimit) { + $dbh->commit(); + } } 1; Index: Oracle.pm =================================================================== RCS file: /cvsroot/lxr/lxr/lib/LXR/Index/Oracle.pm,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- Oracle.pm 25 Apr 2009 20:40:24 -0000 1.14 +++ Oracle.pm 26 Apr 2009 09:14:37 -0000 1.15 @@ -131,21 +131,104 @@ return $self; } -sub setsymdeclaration { - my ($self, $symname, $fileid, $line, $langid, $type, $relsym) = @_; +sub DESTROY { + my ($self) = @_; + $self->{files_select} = undef; + $self->{files_insert} = undef; + $self->{symbols_byname} = undef; + $self->{symbols_byid} = undef; + $self->{symbols_insert} = undef; + $self->{indexes_insert} = undef; + $self->{releases_insert} = undef; + $self->{status_insert} = undef; + $self->{status_update} = undef; + $self->{usage_insert} = undef; + $self->{usage_select} = undef; + $self->{decl_select} = undef; + $self->{decl_insert} = undef; + $self->{delete_indexes} = undef; + $self->{delete_usage} = undef; + $self->{delete_status} = undef; + $self->{delete_releases} = undef; + $self->{delete_files} = undef; - $self->{indexes_insert}->execute($self->symid($symname), - $fileid, $line, $langid, $type, $relsym ? $self->symid($relsym) : undef); + if ($self->{dbh}) { + $self->{dbh}->disconnect(); + $self->{dbh} = undef; + } } -sub setsymreference { - my ($self, $symname, $fileid, $line) = @_; +# +# LXR::Index API Implementation +# - $self->{usage_insert}->execute($fileid, $line, $self->symid($symname)); +sub fileid { + my ($self, $filename, $revision) = @_; + my ($fileid); + unless (defined($fileid = $files{"$filename\t$revision"})) { + $self->{files_select}->execute($filename, $revision); + ($fileid) = $self->{files_select}->fetchrow_array(); + unless ($fileid) { + $self->{files_insert}->execute($filename, $revision); + $self->{files_select}->execute($filename, $revision); + ($fileid) = $self->{files_select}->fetchrow_array(); + } + $files{"$filename\t$revision"} = $fileid; + $self->{files_select}->finish(); + } + return $fileid; } -sub symdeclarations { # Hinzugefügt von Variable @row, While-Schleife +sub setfilerelease { + my ($self, $fileid, $release) = @_; + + my $rows = $self->{releases_select}->execute($fileid + 0, $release); + $self->{releases_select}->finish(); + + unless ($rows > 0) { + $self->{releases_insert}->execute($fileid, $release); + $self->{releases_insert}->finish(); + } +} + +sub fileindexed { + my ($self, $fileid) = @_; + my ($status); + + $self->{status_get}->execute($fileid); + $status = $self->{status_get}->fetchrow_array(); + $self->{status_get}->finish(); + + if (!defined($status)) { + $self->{status_insert}->execute($fileid + 0, 0); + } + + return $status == 0; +} + +sub setfileindexed { + my ($self, $fileid) = @_; + $self->{status_update}->execute(1, $fileid, 0); +} + +sub filereferenced { + my ($self, $fileid) = @_; + my ($status); + + $self->{status_get}->execute($fileid); + $status = $self->{status_get}->fetchrow_array(); + $self->{status_get}->finish(); + + return $status < 2; +} + +sub setfilereferenced { + my ($self, $fileid) = @_; + $self->{status_update}->execute(2, $fileid, 1); +} + +sub symdeclarations { my ($self, $symname, $release) = @_; my ($rows, @ret, @row); @@ -155,10 +238,6 @@ push(@ret, [@row]); } - #while ($rows-- > 0) { - # push(@ret, [ $self->{indexes_select}->fetchrow_array ]); - #} - $self->{indexes_select}->finish(); map { $$_[3] &&= $self->symname($$_[3]) } @ret; @@ -166,6 +245,13 @@ return @ret; } +sub setsymdeclaration { + my ($self, $symname, $fileid, $line, $langid, $type, $relsym) = @_; + + $self->{indexes_insert}->execute($self->symid($symname), + $fileid, $line, $langid, $type, $relsym ? $self->symid($relsym) : undef); +} + sub symreferences { my ($self, $symname, $release) = @_; my ($rows, @ret, @row); @@ -176,45 +262,31 @@ push(@ret, [@row]); } - #while ($rows-- > 0) { - # push(@ret, [ $self->{usage_select}->fetchrow_array ]); - #} - $self->{usage_select}->finish(); return @ret; } -sub fileid { - my ($self, $filename, $revision) = @_; - my ($fileid); +sub setsymreference { + my ($self, $symname, $fileid, $line) = @_; - # CAUTION: $revision is not $release! - unless (defined($fileid = $files{"$filename\t$revision"})) { - $self->{files_select}->execute($filename, $revision); - ($fileid) = $self->{files_select}->fetchrow_array(); - unless ($fileid) { - $self->{files_insert}->execute($filename, $revision); - $self->{files_select}->execute($filename, $revision); - ($fileid) = $self->{files_select}->fetchrow_array(); - } - $files{"$filename\t$revision"} = $fileid; - $self->{files_select}->finish(); - } - return $fileid; -} + $self->{usage_insert}->execute($fileid, $line, $self->symid($symname)); -# Indicate that this filerevision is part of this release -sub setfilerelease { - my ($self, $fileid, $release) = @_; +} - my $rows = $self->{releases_select}->execute($fileid + 0, $release); - $self->{releases_select}->finish(); +sub issymbol { + my ($self, $symname, $release) = @_; # TODO make use of $release + my ($symid); - unless ($rows > 0) { - $self->{releases_insert}->execute($fileid, $release); - $self->{releases_insert}->finish(); + $symid = $symcache{$release}{$symname}; + unless (defined($symid)) { + $self->{symbols_byname}->execute($symname); + ($symid) = $self->{symbols_byname}->fetchrow_array(); + $self->{symbols_byname}->finish(); + $symcache{$release}{$symname} = $symid; } + + return $symid; } sub symid { @@ -251,66 +323,6 @@ return $symname; } -sub issymbol { - my ($self, $symname, $release) = @_; # TODO make use of $release - my ($symid); - - $symid = $symcache{$release}{$symname}; - unless (defined($symid)) { - $self->{symbols_byname}->execute($symname); - ($symid) = $self->{symbols_byname}->fetchrow_array(); - $self->{symbols_byname}->finish(); - $symcache{$release}{$symname} = $symid; - } - - return $symid; -} - -# If this file has not been indexed earlier return true. Return false -# if already indexed. -sub fileindexed { - my ($self, $fileid) = @_; - my ($status); - - $self->{status_get}->execute($fileid); - $status = $self->{status_get}->fetchrow_array(); - $self->{status_get}->finish(); - - if (!defined($status)) { - $self->{status_insert}->execute($fileid + 0, 0); - } - - return $status == 0; -} - -sub setfileindexed { - my ($self, $fileid) = @_; - $self->{status_update}->execute(1, $fileid, 0); -} - -sub filereferenced { - my ($self, $fileid) = @_; - my ($status); - - $self->{status_get}->execute($fileid); - $status = $self->{status_get}->fetchrow_array(); - $self->{status_get}->finish(); - - return $status < 2; -} - -sub setfilereferenced { - my ($self, $fileid) = @_; - $self->{status_update}->execute(2, $fileid, 1); -} - -# This function should be called before parsing each new file, -# if this is not done the too much memory will be used and -# tings will become very slow. -sub emptycache { - %symcache = (); -} - sub decid { my ($self, $lang, $string) = @_; @@ -328,6 +340,10 @@ return $id; } +sub emptycache { + %symcache = (); +} + sub purge { my ($self, $version) = @_; @@ -340,31 +356,4 @@ $self->{delete_files}->execute($version); } -sub DESTROY { - my ($self) = @_; - $self->{files_select} = undef; - $self->{files_insert} = undef; - $self->{symbols_byname} = undef; - $self->{symbols_byid} = undef; - $self->{symbols_insert} = undef; - $self->{indexes_insert} = undef; - $self->{releases_insert} = undef; - $self->{status_insert} = undef; - $self->{status_update} = undef; - $self->{usage_insert} = undef; - $self->{usage_select} = undef; - $self->{decl_select} = undef; - $self->{decl_insert} = undef; - $self->{delete_indexes} = undef; - $self->{delete_usage} = undef; - $self->{delete_status} = undef; - $self->{delete_releases} = undef; - $self->{delete_files} = undef; - - if ($self->{dbh}) { - $self->{dbh}->disconnect(); - $self->{dbh} = undef; - } -} - 1; |
From: AdrianIssott <adr...@us...> - 2009-04-25 20:40:43
|
Update of /cvsroot/lxr/lxr In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv5694 Modified Files: ident Log Message: Feature 1691378 (Rearchitect the DB backends) Part IV: * Renamed LXR::Index subroutines to be more understandable Index: ident =================================================================== RCS file: /cvsroot/lxr/lxr/ident,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- ident 8 Apr 2009 20:49:19 -0000 1.22 +++ ident 25 Apr 2009 20:40:24 -0000 1.23 @@ -49,7 +49,7 @@ my $templ = shift; my $ret = ''; - my @refs = $index->getindex($identifier, $release); + my @refs = $index->symdeclarations($identifier, $release); my $file_hits = 0; my $last_file; @@ -86,7 +86,7 @@ my $templ = shift; my $ret = ''; - my @uses = $index->getreference($identifier, $release); + my @uses = $index->symreferences($identifier, $release); my $file_hits = 0; my $last_file; foreach my $ref (sort { $$a[0] cmp $$b[0] } @uses) { |
From: AdrianIssott <adr...@us...> - 2009-04-25 20:40:37
|
Update of /cvsroot/lxr/lxr/lib/LXR/Lang In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv5694/lib/LXR/Lang Modified Files: Generic.pm Log Message: Feature 1691378 (Rearchitect the DB backends) Part IV: * Renamed LXR::Index subroutines to be more understandable Index: Generic.pm =================================================================== RCS file: /cvsroot/lxr/lxr/lib/LXR/Lang/Generic.pm,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- Generic.pm 19 Apr 2009 16:52:40 -0000 1.23 +++ Generic.pm 25 Apr 2009 20:40:24 -0000 1.24 @@ -72,7 +72,7 @@ foreach my $lang (keys %$langmap) { my $typemap = $langmap->{$lang}{'typemap'}; foreach my $type (keys %$typemap) { - $typemap->{$type} = $index->getdecid($langmap->{$lang}{'langid'}, $typemap->{$type}); + $typemap->{$type} = $index->decid($langmap->{$lang}{'langid'}, $typemap->{$type}); } } @@ -124,7 +124,7 @@ $ext = undef; } - $index->index($sym, $fileid, $line, $self->langid, $type, $ext); + $index->setsymdeclaration($sym, $fileid, $line, $self->langid, $type, $ext); } close(CTAGS); @@ -231,7 +231,7 @@ { # print "adding $string to references\n"; - $index->reference($string, $fileid, $linenum); + $index->setsymreference($string, $fileid, $linenum); } } |
From: AdrianIssott <adr...@us...> - 2009-04-25 20:40:33
|
Update of /cvsroot/lxr/lxr/lib/LXR/Index In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv5694/lib/LXR/Index Modified Files: Mysql.pm DB.pm Postgres.pm Oracle.pm Log Message: Feature 1691378 (Rearchitect the DB backends) Part IV: * Renamed LXR::Index subroutines to be more understandable Index: Mysql.pm =================================================================== RCS file: /cvsroot/lxr/lxr/lib/LXR/Index/Mysql.pm,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- Mysql.pm 19 Apr 2009 16:52:40 -0000 1.24 +++ Mysql.pm 25 Apr 2009 20:40:24 -0000 1.25 @@ -138,21 +138,21 @@ return $self; } -sub index { +sub setsymdeclaration { my ($self, $symname, $fileid, $line, $langid, $type, $relsym) = @_; $self->{indexes_insert}->execute($self->symid($symname), $fileid, $line, $langid, $type, $relsym ? $self->symid($relsym) : undef); } -sub reference { +sub setsymreference { my ($self, $symname, $fileid, $line) = @_; $self->{usage_insert}->execute($fileid, $line, $self->symid($symname)); } -sub getindex { +sub symdeclarations { my ($self, $symname, $release) = @_; my ($rows, @ret); @@ -169,7 +169,7 @@ return @ret; } -sub getreference { +sub symreferences { my ($self, $symname, $release) = @_; my ($rows, @ret); @@ -204,7 +204,7 @@ } # Indicate that this filerevision is part of this release -sub release { +sub setfilerelease { my ($self, $fileid, $release) = @_; my $rows = $self->{releases_select}->execute($fileid + 0, $release); @@ -267,7 +267,7 @@ # If this file has not been indexed earlier return true. Return false # if already indexed. -sub toindex { +sub fileindexed { my ($self, $fileid) = @_; my ($status); @@ -282,12 +282,12 @@ return $status == 0; } -sub setindexed { +sub setfileindexed { my ($self, $fileid) = @_; $self->{status_update}->execute(1, $fileid, 0); } -sub toreference { +sub filereferenced { my ($self, $fileid) = @_; my ($status); @@ -298,7 +298,7 @@ return $status < 2; } -sub setreferenced { +sub setfilereferenced { my ($self, $fileid) = @_; $self->{status_update}->execute(2, $fileid, 1); } @@ -306,11 +306,11 @@ # This function should be called before parsing each new file, # if this is not done the too much memory will be used and # tings will become very slow. -sub empty_cache { +sub emptycache { %symcache = (); } -sub getdecid { +sub decid { my ($self, $lang, $string) = @_; my $rows = $self->{decl_select}->execute($lang, $string); Index: DB.pm =================================================================== RCS file: /cvsroot/lxr/lxr/lib/LXR/Index/DB.pm,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- DB.pm 19 Apr 2009 16:52:40 -0000 1.15 +++ DB.pm 25 Apr 2009 20:40:24 -0000 1.16 @@ -42,18 +42,18 @@ return $self; } -sub index { +sub setsymdeclaration { my ($self, $symname, $fileid, $line, $langid, $type, $relsym) = @_; my $symid = $self->symid($symname); $self->{'indexes'}{$symid} .= join("\t", $fileid, $line, $type, $relsym) . "\0"; - # $$self{'index'}{$self->symid($symname)} = + # $$self{'symdeclaration'}{$self->symid($symname)} = # join("\t", $filename, $line, $type, ''); } # Returns array of (fileid, line, type) -sub getindex { +sub symdeclarations { my ($self, $symname, $release) = @_; my (@d, $f); @@ -68,7 +68,7 @@ return @d; } -sub getreference { +sub symreferences { my ($self, $symname, $release) = @_; return (); } @@ -89,7 +89,7 @@ # If this file has not been indexed earlier, mark it as being indexed # now and return true. Return false if already indexed. -sub toindex { +sub fileindexed { my ($self, $fileid) = @_; return undef if $self->{'status'}{$fileid} >= 1; @@ -99,7 +99,7 @@ } # Indicate that this filerevision is part of this release -sub release { +sub setfilerelease { my ($self, $fileid, $release) = @_; $self->{'releases'}{$fileid} .= $release . ";"; @@ -118,7 +118,7 @@ return $$self{'indexes'}{ $self->symid($symname) }; } -sub empty_cache { +sub emptycache { } 1; Index: Postgres.pm =================================================================== RCS file: /cvsroot/lxr/lxr/lib/LXR/Index/Postgres.pm,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- Postgres.pm 19 Apr 2009 16:52:40 -0000 1.24 +++ Postgres.pm 25 Apr 2009 20:40:24 -0000 1.25 @@ -131,7 +131,7 @@ return $self; } -sub empty_cache { +sub emptycache { %symcache = (); } @@ -141,7 +141,7 @@ } } -sub index { +sub setsymdeclaration { my ($self, $symname, $fileid, $line, $langid, $type, $relsym) = @_; $indexes_insert->execute($self->symid($symname), @@ -149,14 +149,14 @@ commit_if_limit(); } -sub reference { +sub setsymreference { my ($self, $symname, $fileid, $line) = @_; $usage_insert->execute($fileid, $line, $self->symid($symname)); commit_if_limit(); } -sub getindex { +sub symdeclarations { my ($self, $symname, $release) = @_; my ($rows, @ret); @@ -179,7 +179,7 @@ return @ret; } -sub getreference { +sub symreferences { my ($self, $symname, $release) = @_; my ($rows, @ret); @@ -215,7 +215,7 @@ } # Indicate that this filerevision is part of this release -sub release { +sub setfilerelease { my ($self, $fileid, $release) = @_; $releases_select->execute($fileid + 0, $release); @@ -270,7 +270,7 @@ # If this file has not been indexed earlier, mark it as being indexed # now and return true. Return false if already indexed. -sub toindex { +sub fileindexed { my ($self, $fileid) = @_; $status_insert->execute($fileid + 0, $fileid + 0); @@ -278,13 +278,13 @@ return $status_update->execute(1, $fileid + 0, 0) > 0; } -sub toreference { +sub filereferenced { my ($self, $fileid) = @_; return $status_update->execute(2, $fileid, 1) > 0; } -sub getdecid { +sub decid { my ($self, $lang, $string) = @_; my $rows = $decl_select->execute($lang, $string); @@ -317,12 +317,12 @@ commit_if_limit(); } -sub setindexed { +sub setfileindexed { my ($self, $fileid) = @_; $status_update->execute(1, $fileid, 0); } -sub setreferenced { +sub setfilereferenced { my ($self, $fileid) = @_; $status_update->execute(2, $fileid, 1); } Index: Oracle.pm =================================================================== RCS file: /cvsroot/lxr/lxr/lib/LXR/Index/Oracle.pm,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- Oracle.pm 19 Apr 2009 16:52:40 -0000 1.13 +++ Oracle.pm 25 Apr 2009 20:40:24 -0000 1.14 @@ -131,21 +131,21 @@ return $self; } -sub index { +sub setsymdeclaration { my ($self, $symname, $fileid, $line, $langid, $type, $relsym) = @_; $self->{indexes_insert}->execute($self->symid($symname), $fileid, $line, $langid, $type, $relsym ? $self->symid($relsym) : undef); } -sub reference { +sub setsymreference { my ($self, $symname, $fileid, $line) = @_; $self->{usage_insert}->execute($fileid, $line, $self->symid($symname)); } -sub getindex { # Hinzugefügt von Variable @row, While-Schleife +sub symdeclarations { # Hinzugefügt von Variable @row, While-Schleife my ($self, $symname, $release) = @_; my ($rows, @ret, @row); @@ -166,7 +166,7 @@ return @ret; } -sub getreference { +sub symreferences { my ($self, $symname, $release) = @_; my ($rows, @ret, @row); @@ -205,7 +205,7 @@ } # Indicate that this filerevision is part of this release -sub release { +sub setfilerelease { my ($self, $fileid, $release) = @_; my $rows = $self->{releases_select}->execute($fileid + 0, $release); @@ -268,7 +268,7 @@ # If this file has not been indexed earlier return true. Return false # if already indexed. -sub toindex { +sub fileindexed { my ($self, $fileid) = @_; my ($status); @@ -283,12 +283,12 @@ return $status == 0; } -sub setindexed { +sub setfileindexed { my ($self, $fileid) = @_; $self->{status_update}->execute(1, $fileid, 0); } -sub toreference { +sub filereferenced { my ($self, $fileid) = @_; my ($status); @@ -299,7 +299,7 @@ return $status < 2; } -sub setreferenced { +sub setfilereferenced { my ($self, $fileid) = @_; $self->{status_update}->execute(2, $fileid, 1); } @@ -307,11 +307,11 @@ # This function should be called before parsing each new file, # if this is not done the too much memory will be used and # tings will become very slow. -sub empty_cache { +sub emptycache { %symcache = (); } -sub getdecid { +sub decid { my ($self, $lang, $string) = @_; my $rows = $self->{decl_select}->execute($lang, $string); |
From: AdrianIssott <adr...@us...> - 2009-04-25 20:40:32
|
Update of /cvsroot/lxr/lxr/lib/LXR In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv5694/lib/LXR Modified Files: Index.pm Tagger.pm Log Message: Feature 1691378 (Rearchitect the DB backends) Part IV: * Renamed LXR::Index subroutines to be more understandable Index: Index.pm =================================================================== RCS file: /cvsroot/lxr/lxr/lib/LXR/Index.pm,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- Index.pm 21 Apr 2009 20:03:04 -0000 1.12 +++ Index.pm 25 Apr 2009 20:40:24 -0000 1.13 @@ -43,69 +43,79 @@ # Stub implementations of this interface # -sub getindex { - my ($self, $symname, $release) = @_; - my @indexes; - warn __PACKAGE__."::getindex not implemented. Parameters @_"; - return @indexes; +sub fileid { + my ($self, $filename, $revision) = @_; # CAUTION: $revision is not $release! + my $fileid; + warn __PACKAGE__."::fileid not implemented. Parameters @_"; + return $fileid; } -sub index { - my ($self, $symname, $fileid, $line, $langid, $type, $relsym) = @_; - warn __PACKAGE__."::index not implemented. Parameters @_"; +# Indicate that the file referred to by $fileid is part of $release +sub setfilerelease { + my ($self, $fileid, $release) = @_; + warn __PACKAGE__."::setfilerelease not implemented. Parameters @_"; return; } -sub toindex { +# If the file referred to by $fileid has already been indexed return true. +# Otherwise return false. +sub fileindexed { my ($self, $fileid) = @_; my $filefoundboolean; - warn __PACKAGE__."::toindex not implemented. Parameters @_"; + warn __PACKAGE__."::fileindexed not implemented. Parameters @_"; return $filefoundboolean; } -sub setindexed { +sub setfileindexed { my ($self, $fileid) = @_; - warn __PACKAGE__."::setindexed not implemented. Parameters @_"; + warn __PACKAGE__."::setfileindexed not implemented. Parameters @_"; return; } -sub fileid { - my ($self, $filename, $revision) = @_; - my $fileid; - warn __PACKAGE__."::fileid not implemented. Parameters @_"; - return $fileid; +sub filereferenced { + my ($self, $fileid) = @_; + my $referencefoundboolean; + warn __PACKAGE__."::filereferenced not implemented. Parameters @_"; + return $referencefoundboolean; } -sub getreference { +sub setfilereferenced { + my ($self, $fileid) = @_; + warn __PACKAGE__."::setfilereferenced not implemented. Parameters @_"; + return; +} + +sub symdeclarations { my ($self, $symname, $release) = @_; - my @references; - warn __PACKAGE__."::getreference not implemented. Parameters @_"; - return @references; + my @indexes; + warn __PACKAGE__."::symdeclarations not implemented. Parameters @_"; + return @indexes; } -sub reference { - my ($self, $symname, $fileid, $line) = @_; - warn __PACKAGE__."::reference not implemented. Parameters @_"; +sub setsymdeclaration { + my ($self, $symname, $fileid, $line, $langid, $type, $relsym) = @_; + warn __PACKAGE__."::setsymdeclaration not implemented. Parameters @_"; return; } -sub toreference { - my ($self, $fileid) = @_; - my $referencefoundboolean; - warn __PACKAGE__."::toreference not implemented. Parameters @_"; - return $referencefoundboolean; +sub symreferences { + my ($self, $symname, $release) = @_; + my @references; + warn __PACKAGE__."::symreferences not implemented. Parameters @_"; + return @references; } -sub setreferenced { - my ($self, $fileid) = @_; - warn __PACKAGE__."::setreferenced not implemented. Parameters @_"; +sub setsymreference { + my ($self, $symname, $fileid, $line) = @_; + warn __PACKAGE__."::setsymreference not implemented. Parameters @_"; return; } -sub release { - my ($self, $fileid, $release) = @_; - warn __PACKAGE__."::release not implemented. Parameters @_"; - return; +sub issymbol { + my ($self, $symname, $release) = @_; + my $symbolfoundboolean; + warn __PACKAGE__."::issymbol not implemented. Parameters @_"; + return $symbolfoundboolean; } sub symid { @@ -122,23 +132,19 @@ return $symname; } -sub issymbol { - my ($self, $symname, $release) = @_; - my $symbolfoundboolean; - warn __PACKAGE__."::issymbol not implemented. Parameters @_"; - return $symbolfoundboolean; -} - -sub getdecid { +sub decid { my ($self, $lang, $string) = @_; my $decid; - warn __PACKAGE__."::getdecid not implemented. Parameters @_"; + warn __PACKAGE__."::decid not implemented. Parameters @_"; return $decid; } -sub empty_cache { +# This function should be called before parsing each new file, +# if this is not done then too much memory will be used and +# things will become very slow. +sub emptycache { my ($self) = @_; - warn __PACKAGE__."::empty_cache not implemented. Parameters @_"; + warn __PACKAGE__."::emptycache not implemented. Parameters @_"; return; } Index: Tagger.pm =================================================================== RCS file: /cvsroot/lxr/lxr/lib/LXR/Tagger.pm,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- Tagger.pm 21 Jul 2004 20:44:30 -0000 1.22 +++ Tagger.pm 25 Apr 2009 20:40:24 -0000 1.23 @@ -40,16 +40,16 @@ if ($index) { my $fileid = $index->fileid($pathname, $revision); - $index->release($fileid, $release); + $index->setfilerelease($fileid, $release); - if ($index->toindex($fileid)) { - $index->empty_cache(); + if ($index->fileindexed($fileid)) { + $index->emptycache(); print(STDERR "--- $pathname $fileid\n"); my $path = $files->tmpfile($pathname, $release); $lang->indexfile($pathname, $path, $fileid, $index, $config); - $index->setindexed($fileid); + $index->setfileindexed($fileid); unlink($path); } else { print(STDERR "$pathname was already indexed\n"); @@ -77,14 +77,14 @@ if ($index) { my $fileid = $index->fileid($pathname, $revision); - if ($index->toreference($fileid)) { - $index->empty_cache(); + if ($index->filereferenced($fileid)) { + $index->emptycache(); print(STDERR "--- $pathname $fileid\n"); my $path = $files->tmpfile($pathname, $release); $lang->referencefile($pathname, $path, $fileid, $index, $config); - $index->setreferenced($fileid); + $index->setfilereferenced($fileid); unlink($path); } else { print STDERR "$pathname was already referenced\n"; |
From: AdrianIssott <adr...@us...> - 2009-04-25 20:21:48
|
Update of /cvsroot/lxr/lxr/lib In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv2227/lib Modified Files: magic.mime Log Message: Fix for bug 2781293 (Bug 1691407 fix caused perl files to be ignored by genxref) Index: magic.mime =================================================================== RCS file: /cvsroot/lxr/lxr/lib/magic.mime,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- magic.mime 22 Apr 2009 15:16:57 -0000 1.1 +++ magic.mime 25 Apr 2009 20:21:35 -0000 1.2 @@ -272,19 +272,6 @@ # update to distinguish from *.vcf files by Joerg Jenderek: joerg dot jenderek at web dot de #0 regex BEGIN[[:space:]]*[{] application/x-awk -# For Larry Wall's perl language. The ``eval'' line recognizes an -# outrageously clever hack for USG systems. -# Keith Waclena <ke...@ce...> -0 string #!/bin/perl application/x-perl -0 string #!\ /bin/perl application/x-perl -0 string eval\ "exec\ /bin/perl application/x-perl -0 string #!/usr/bin/perl application/x-perl -0 string #!\ /usr/bin/perl application/x-perl -0 string eval\ "exec\ /usr/bin/perl application/x-perl -0 string #!/usr/local/bin/perl application/x-perl -0 string #!\ /usr/local/bin/perl application/x-perl -0 string eval\ "exec\ /usr/local/bin/perl application/x-perl - #------------------------------------------------------------------------------ # compress: file(1) magic for pure-compression formats (no archives) # |
From: Malcolm B. <mb...@us...> - 2009-04-22 15:38:41
|
Update of /cvsroot/lxr/lxr-tools In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv20620 Modified Files: makerelease.pl Log Message: Update to reflect new location of tests Index: makerelease.pl =================================================================== RCS file: /cvsroot/lxr/lxr-tools/makerelease.pl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- makerelease.pl 25 Mar 2009 16:49:49 -0000 1.2 +++ makerelease.pl 22 Apr 2009 15:38:35 -0000 1.3 @@ -51,6 +51,7 @@ --noex Do not do any action that alters SF state (useful for seeing what will happen) --tag Use the supplied string as the release tag name + --nottext Do not run the tests from lxr-tools END_HELP @@ -180,11 +181,15 @@ # Run the tests and make sure they pass sub run_tests { print "Running tests..."; - chdir("tests"); + if (! -d "../lxr-tools/tests") { + die "Can't find the lxr-tools directory with tests in ../lxr-tools"; + } + + chdir("../lxr-tools/tests"); my ($fileh, $rtn); - $rtn = open($fileh, "-|", "./TestRunner.pl AllTests.pm 2>&1"); + $rtn = open($fileh, "-|", "perl ./TestRunner.pl AllTests.pm 2>&1"); die "Failed to start tests" unless $rtn; while (<$fileh>) { if (/^Test was not successful\.$/) { |
From: Malcolm B. <mb...@us...> - 2009-04-22 15:29:11
|
Update of /cvsroot/lxr/lxr/lib/LXR/Lang In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv19343 Removed Files: Perl.pm Python.pm Log Message: Implement feature request 2774495: Deprecate or Remove Unused LXR::Lang Modules Perl.pm & Python.pm are not used by the default configuration of LXR, with more functionality being provided by LXR:Lang::Generic. --- Perl.pm DELETED --- --- Python.pm DELETED --- |
From: Malcolm B. <mb...@us...> - 2009-04-22 15:17:08
|
Update of /cvsroot/lxr/lxr In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv18381 Modified Files: genxref Log Message: Fix bug 1691407: genxref binary file detection flawed. Added magic.mime file in lib/ and make MMagic use it. Index: genxref =================================================================== RCS file: /cvsroot/lxr/lxr/genxref,v retrieving revision 1.40 retrieving revision 1.41 diff -u -d -r1.40 -r1.41 --- genxref 21 Apr 2009 16:07:39 -0000 1.40 +++ genxref 22 Apr 2009 15:16:57 -0000 1.41 @@ -74,7 +74,7 @@ $index = new LXR::Index($config->dbname, O_RDWR | O_CREAT); die "Can't create Index " . $config->dbname if !defined($index); -our $filetype = new File::MMagic(); +our $filetype = new File::MMagic(-f 'lib/magic.mime'? ('lib/magic.mime') : ()); our %binaryfiles; my @versions; @@ -155,14 +155,9 @@ if ($config->glimpsedir and $config->glimpseindex) { - # Make sure the directory that the glimpse results go into - # already exists as glimpse won't work if the directory does - # not exist - die $config->glimpsedir . " does not exist" - unless -d $config->glimpsedir; $string = $config->glimpsedir . "/" . $release; mkdir $string; - system("chmod 755 $string"); + system("chmod 755 $string"); # TODO - fix Unix specific call? my $glimpse = new IO::Handle; my $pid = open($glimpse, "|-"); if ($pid == 0) { |
From: Malcolm B. <mb...@us...> - 2009-04-22 15:17:03
|
Update of /cvsroot/lxr/lxr/lib In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv18381/lib Added Files: magic.mime Log Message: Fix bug 1691407: genxref binary file detection flawed. Added magic.mime file in lib/ and make MMagic use it. --- NEW FILE: magic.mime --- # Magic data for KMimeMagic (originally for file(1) command) # # The format is 4-5 columns: # Column #1: byte number to begin checking from, ">" indicates continuation # Column #2: type of data to match # Column #3: contents of data to match # Column #4: MIME type of result # Column #5: MIME encoding of result (optional) #------------------------------------------------------------------------------ # Localstuff: file(1) magic for locally observed files # Add any locally observed files here. # Real Audio (Magic .ra\0375) 0 belong 0x2e7261fd audio/x-pn-realaudio 0 string .RMF application/vnd.rn-realmedia #video/x-pn-realvideo #video/vnd.rn-realvideo #application/vnd.rn-realmedia # sigh, there are many mimes for that but the above are the most common. # Taken from magic, converted to magic.mime # mime types according to http://www.geocities.com/nevilo/mod.htm: # audio/it .it # audio/x-zipped-it .itz # audio/xm fasttracker modules # audio/x-s3m screamtracker modules # audio/s3m screamtracker modules # audio/x-zipped-mod mdz # audio/mod mod # audio/x-mod All modules (mod, s3m, 669, mtm, med, xm, it, mdz, stm, itz, xmz, s3z) # Taken from loader code from mikmod version 2.14 # by Steve McIntyre (st...@ch...) # <do...@cu...> added title printing on 2003-06-24 0 string MAS_UTrack_V00 >14 string >/0 audio/x-mod #audio/x-tracker-module #0 string UN05 MikMod UNI format module sound data 0 string Extended\ Module: audio/x-mod #audio/x-tracker-module ##>17 string >\0 Title: "%s" 21 string/c \!SCREAM! audio/x-mod #audio/x-screamtracker-module 21 string BMOD2STM audio/x-mod #audio/x-screamtracker-module 1080 string M.K. audio/x-mod #audio/x-protracker-module #>0 string >\0 Title: "%s" 1080 string M!K! audio/x-mod #audio/x-protracker-module #>0 string >\0 Title: "%s" 1080 string FLT4 audio/x-mod #audio/x-startracker-module #>0 string >\0 Title: "%s" 1080 string FLT8 audio/x-mod #audio/x-startracker-module #>0 string >\0 Title: "%s" 1080 string 4CHN audio/x-mod #audio/x-fasttracker-module #>0 string >\0 Title: "%s" 1080 string 6CHN audio/x-mod #audio/x-fasttracker-module #>0 string >\0 Title: "%s" 1080 string 8CHN audio/x-mod #audio/x-fasttracker-module #>0 string >\0 Title: "%s" 1080 string CD81 audio/x-mod #audio/x-oktalyzer-tracker-module #>0 string >\0 Title: "%s" 1080 string OKTA audio/x-mod #audio/x-oktalyzer-tracker-module #>0 string >\0 Title: "%s" # Not good enough. #1082 string CH #>1080 string >/0 %.2s-channel Fasttracker "oktalyzer" module sound data 1080 string 16CN audio/x-mod #audio/x-taketracker-module #>0 string >\0 Title: "%s" 1080 string 32CN audio/x-mod #audio/x-taketracker-module #>0 string >\0 Title: "%s" # Impuse tracker module (it) 0 string IMPM audio/x-mod #>4 string >\0 "%s" #>40 leshort !0 compatible w/ITv%x #>42 leshort !0 created w/ITv%x #------------------------------------------------------------------------------ # end local stuff #------------------------------------------------------------------------------ # xml based formats! # svg 0 string \<?xml # text/xml >38 string \<\!DOCTYPE\040svg image/svg+xml # xml 0 string \<?xml text/xml #------------------------------------------------------------------------------ # Java 0 short 0xcafe >2 short 0xbabe application/java #------------------------------------------------------------------------------ # audio: file(1) magic for sound formats # # from Jan Nicolai Langfeldt <ja...@if...>, # # Sun/NeXT audio data 0 string .snd >12 belong 1 audio/basic >12 belong 2 audio/basic >12 belong 3 audio/basic >12 belong 4 audio/basic >12 belong 5 audio/basic >12 belong 6 audio/basic >12 belong 7 audio/basic >12 belong 23 audio/x-adpcm # DEC systems (e.g. DECstation 5000) use a variant of the Sun/NeXT format # that uses little-endian encoding and has a different magic number # (0x0064732E in little-endian encoding). 0 lelong 0x0064732E >12 lelong 1 audio/x-dec-basic >12 lelong 2 audio/x-dec-basic >12 lelong 3 audio/x-dec-basic >12 lelong 4 audio/x-dec-basic >12 lelong 5 audio/x-dec-basic >12 lelong 6 audio/x-dec-basic >12 lelong 7 audio/x-dec-basic # compressed (G.721 ADPCM) >12 lelong 23 audio/x-dec-adpcm # Bytes 0-3 of AIFF, AIFF-C, & 8SVX audio files are "FORM" # AIFF audio data 8 string AIFF audio/x-aiff # AIFF-C audio data 8 string AIFC audio/x-aiff # IFF/8SVX audio data 8 string 8SVX audio/x-aiff # Creative Labs AUDIO stuff # Standard MIDI data 0 string MThd audio/unknown #>9 byte >0 (format %d) #>11 byte >1 using %d channels # Creative Music (CMF) data 0 string CTMF audio/unknown # SoundBlaster instrument data 0 string SBI audio/unknown # Creative Labs voice data 0 string Creative\ Voice\ File audio/unknown ## is this next line right? it came this way... #>19 byte 0x1A #>23 byte >0 - version %d #>22 byte >0 \b.%d # [GRR 950115: is this also Creative Labs? Guessing that first line # should be string instead of unknown-endian long...] #0 long 0x4e54524b MultiTrack sound data #0 string NTRK MultiTrack sound data #>4 long x - version %ld # Microsoft WAVE format (*.wav) # [GRR 950115: probably all of the shorts and longs should be leshort/lelong] # Microsoft RIFF 0 string RIFF # - WAVE format >8 string WAVE audio/x-wav >8 string/B AVI video/x-msvideo # >8 string CDRA image/x-coreldraw # AAC (aka MPEG-2 NBC) 0 beshort&0xfff6 0xfff0 audio/X-HX-AAC-ADTS 0 string ADIF audio/X-HX-AAC-ADIF 0 beshort&0xffe0 0x56e0 audio/MP4A-LATM 0 beshort 0x4De1 audio/MP4A-LATM # MPEG Layer 3 sound files 0 beshort&0xfffe =0xfffa audio/mpeg #MP3 with ID3 tag 0 string ID3 audio/mpeg # Ogg/Vorbis 0 string OggS application/ogg #------------------------------------------------------------------------------ # c-lang: file(1) magic for C programs or various scripts # # XPM icons (Greg Roelofs, ne...@uc...) # ideally should go into "images", but entries below would tag XPM as C source 0 string /*\ XPM image/x-xpmi 7bit # 3DS (3d Studio files) #16 beshort 0x3d3d image/x-3ds # this first will upset you if you're a PL/1 shop... (are there any left?) # in which case rm it; ascmagic will catch real C programs # C or REXX program text #0 string /* text/x-c # C++ program text #0 string // text/x-c++ #------------------------------------------------------------------------------ # commands: file(1) magic for various shells and interpreters # #0 string :\ shell archive or commands for antique kernel text 0 string #!/bin/sh application/x-shellscript 0 string #!\ /bin/sh application/x-shellscript 0 string #!/bin/csh application/x-shellscript 0 string #!\ /bin/csh application/x-shellscript # korn shell magic, sent by George Wu, gw...@cl... 0 string #!/bin/ksh application/x-shellscript 0 string #!\ /bin/ksh application/x-shellscript 0 string #!/bin/tcsh application/x-shellscript 0 string #!\ /bin/tcsh application/x-shellscript 0 string #!/usr/local/tcsh application/x-shellscript 0 string #!\ /usr/local/tcsh application/x-shellscript 0 string #!/usr/local/bin/tcsh application/x-shellscript 0 string #!\ /usr/local/bin/tcsh application/x-shellscript # bash shell magic, from Peter Tobias (to...@se...) 0 string #!/bin/bash application/x-shellscript 0 string #!\ /bin/bash application/x-shellscript 0 string #!/usr/local/bin/bash application/x-shellscript 0 string #!\ /usr/local/bin/bash application/x-shellscript # # zsh/ash/ae/nawk/gawk magic from ca...@cs... (Cameron Simpson) 0 string #!/bin/zsh application/x-shellscript 0 string #!/usr/bin/zsh application/x-shellscript 0 string #!/usr/local/bin/zsh application/x-shellscript 0 string #!\ /usr/local/bin/zsh application/x-shellscript 0 string #!/usr/local/bin/ash application/x-shellscript 0 string #!\ /usr/local/bin/ash application/x-shellscript #0 string #!/usr/local/bin/ae Neil Brown's ae #0 string #!\ /usr/local/bin/ae Neil Brown's ae 0 string #!/bin/nawk application/x-nawk 0 string #!\ /bin/nawk application/x-nawk 0 string #!/usr/bin/nawk application/x-nawk 0 string #!\ /usr/bin/nawk application/x-nawk 0 string #!/usr/local/bin/nawk application/x-nawk 0 string #!\ /usr/local/bin/nawk application/x-nawk 0 string #!/bin/gawk application/x-gawk 0 string #!\ /bin/gawk application/x-gawk 0 string #!/usr/bin/gawk application/x-gawk 0 string #!\ /usr/bin/gawk application/x-gawk 0 string #!/usr/local/bin/gawk application/x-gawk 0 string #!\ /usr/local/bin/gawk application/x-gawk # 0 string #!/bin/awk application/x-awk 0 string #!\ /bin/awk application/x-awk 0 string #!/usr/bin/awk application/x-awk 0 string #!\ /usr/bin/awk application/x-awk # update to distinguish from *.vcf files by Joerg Jenderek: joerg dot jenderek at web dot de #0 regex BEGIN[[:space:]]*[{] application/x-awk # For Larry Wall's perl language. The ``eval'' line recognizes an # outrageously clever hack for USG systems. # Keith Waclena <ke...@ce...> 0 string #!/bin/perl application/x-perl 0 string #!\ /bin/perl application/x-perl 0 string eval\ "exec\ /bin/perl application/x-perl 0 string #!/usr/bin/perl application/x-perl 0 string #!\ /usr/bin/perl application/x-perl 0 string eval\ "exec\ /usr/bin/perl application/x-perl 0 string #!/usr/local/bin/perl application/x-perl 0 string #!\ /usr/local/bin/perl application/x-perl 0 string eval\ "exec\ /usr/local/bin/perl application/x-perl #------------------------------------------------------------------------------ # compress: file(1) magic for pure-compression formats (no archives) # # compress, gzip, pack, compact, huf, squeeze, crunch, freeze, yabba, whap, etc. # # Formats for various forms of compressed data # Formats for "compress" proper have been moved into "compress.c", # because it tries to uncompress it to figure out what's inside. # standard unix compress 0 string \037\235 application/x-compress # gzip (GNU zip, not to be confused with [Info-ZIP/PKWARE] zip archiver) 0 string \037\213 application/x-gzip 0 string PK\003\004 application/x-zip # RAR archiver (Greg Roelofs, ne...@uc...) 0 string Rar! application/x-rar # According to gzip.h, this is the correct byte order for packed data. 0 string \037\036 application/octet-stream # # This magic number is byte-order-independent. # 0 short 017437 application/octet-stream # XXX - why *two* entries for "compacted data", one of which is # byte-order independent, and one of which is byte-order dependent? # # compacted data 0 short 0x1fff application/octet-stream 0 string \377\037 application/octet-stream # huf output 0 short 0145405 application/octet-stream # Squeeze and Crunch... # These numbers were gleaned from the Unix versions of the programs to # handle these formats. Note that I can only uncrunch, not crunch, and # I didn't have a crunched file handy, so the crunch number is untested. # Keith Waclena <ke...@ce...> #0 leshort 0x76FF squeezed data (CP/M, DOS) #0 leshort 0x76FE crunched data (CP/M, DOS) # Freeze #0 string \037\237 Frozen file 2.1 #0 string \037\236 Frozen file 1.0 (or gzip 0.5) # lzh? #0 string \037\240 LZH compressed data 257 string ustar\0 application/x-tar posix 257 string ustar\040\040\0 application/x-tar gnu 0 short 070707 application/x-cpio 0 short 0143561 application/x-cpio swapped 0 string =<ar> application/x-archive 0 string \!<arch> application/x-archive >8 string debian application/x-debian-package #------------------------------------------------------------------------------ # # RPM: file(1) magic for Red Hat Packages Erik Troan (ew...@re...) # 0 beshort 0xedab >2 beshort 0xeedb application/x-rpm 0 lelong&0x8080ffff 0x0000081a application/x-arc lzw 0 lelong&0x8080ffff 0x0000091a application/x-arc squashed 0 lelong&0x8080ffff 0x0000021a application/x-arc uncompressed 0 lelong&0x8080ffff 0x0000031a application/x-arc packed 0 lelong&0x8080ffff 0x0000041a application/x-arc squeezed 0 lelong&0x8080ffff 0x0000061a application/x-arc crunched 0 leshort 0xea60 application/x-arj # LHARC/LHA archiver (Greg Roelofs, ne...@uc...) 2 string -lh0- application/x-lharc lh0 2 string -lh1- application/x-lharc lh1 2 string -lz4- application/x-lharc lz4 2 string -lz5- application/x-lharc lz5 # [never seen any but the last; -lh4- reported in comp.compression:] 2 string -lzs- application/x-lha lzs 2 string -lh\ - application/x-lha lh 2 string -lhd- application/x-lha lhd 2 string -lh2- application/x-lha lh2 2 string -lh3- application/x-lha lh3 2 string -lh4- application/x-lha lh4 2 string -lh5- application/x-lha lh5 2 string -lh6- application/x-lha lh6 2 string -lh7- application/x-lha lh7 # Shell archives 10 string #\ This\ is\ a\ shell\ archive application/octet-stream x-shell #------------------------------------------------------------------------------ # frame: file(1) magic for FrameMaker files # # This stuff came on a FrameMaker demo tape, most of which is # copyright, but this file is "published" as witness the following: # 0 string \<MakerFile application/x-frame 0 string \<MIFFile application/x-frame 0 string \<MakerDictionary application/x-frame 0 string \<MakerScreenFon application/x-frame 0 string \<MML application/x-frame 0 string \<Book application/x-frame 0 string \<Maker application/x-frame #------------------------------------------------------------------------------ # html: file(1) magic for HTML (HyperText Markup Language) docs # # from Daniel Quinlan <qu...@yg...> # 0 string/cB \<!DOCTYPE\ html text/html 0 string/cb \<head text/html 0 string/cb \<title text/html 0 string/bc \<html text/html 0 string \<!-- text/html 0 string/c \<h1 text/html 0 string \<?xml text/xml #------------------------------------------------------------------------------ # images: file(1) magic for image formats (see also "c-lang" for XPM bitmaps) # # originally from je...@he... (Jef Poskanzer), # additions by ja...@if... as well as others. Jan also suggested # merging several one- and two-line files into here. # # XXX - byte order for GIF and TIFF fields? # [GRR: TIFF allows both byte orders; GIF is probably little-endian] # # [GRR: what the hell is this doing in here?] #0 string xbtoa btoa'd file # PBMPLUS # PBM file 0 string P1 image/x-portable-bitmap 7bit # PGM file 0 string P2 image/x-portable-greymap 7bit # PPM file 0 string P3 image/x-portable-pixmap 7bit # PBM "rawbits" file 0 string P4 image/x-portable-bitmap # PGM "rawbits" file 0 string P5 image/x-portable-greymap # PPM "rawbits" file 0 string P6 image/x-portable-pixmap # NIFF (Navy Interchange File Format, a modification of TIFF) # [GRR: this *must* go before TIFF] 0 string IIN1 image/x-niff # TIFF and friends # TIFF file, big-endian 0 string MM image/tiff # TIFF file, little-endian 0 string II image/tiff # possible GIF replacements; none yet released! # (Greg Roelofs, ne...@uc...) # # GRR 950115: this was mine ("Zip GIF"): # ZIF image (GIF+deflate alpha) 0 string GIF94z image/unknown # # GRR 950115: this is Jeremy Wohl's Free Graphics Format (better): # FGF image (GIF+deflate beta) 0 string FGF95a image/unknown # # GRR 950115: this is Thomas Boutell's Portable Bitmap Format proposal # (best; not yet implemented): # PBF image (deflate compression) 0 string PBF image/unknown # GIF 0 string GIF image/gif # JPEG images 0 beshort 0xffd8 image/jpeg # PC bitmaps (OS/2, Windoze BMP files) (Greg Roelofs, ne...@uc...) 0 string BM image/x-ms-bmp #>14 byte 12 (OS/2 1.x format) #>14 byte 64 (OS/2 2.x format) #>14 byte 40 (Windows 3.x format) #0 string IC icon #0 string PI pointer #0 string CI color icon #0 string CP color pointer #0 string BA bitmap array # CDROM Filesystems 32769 string CD001 application/x-iso9660 # Newer StuffIt archives (gr...@ne...) 0 string StuffIt application/x-stuffit #>162 string >0 : %s # BinHex is the Macintosh ASCII-encoded file format (see also "apple") # Daniel Quinlan, qu...@yg... 11 string must\ be\ converted\ with\ BinHex\ 4 application/mac-binhex40 ##>41 string x \b, version %.3s #------------------------------------------------------------------------------ # lisp: file(1) magic for lisp programs # # various lisp types, from Daniel Quinlan (qu...@yg...) 0 string ;; text/plain 8bit # Emacs 18 - this is always correct, but not very magical. 0 string \012( application/x-elc # Emacs 19 0 string ;ELC\023\000\000\000 application/x-elc #------------------------------------------------------------------------------ # mail.news: file(1) magic for mail and news # # There are tests to ascmagic.c to cope with mail and news. 0 string Relay-Version: message/rfc822 7bit 0 string #!\ rnews message/rfc822 7bit 0 string N#!\ rnews message/rfc822 7bit 0 string Forward\ to message/rfc822 7bit 0 string Pipe\ to message/rfc822 7bit 0 string Return-Path: message/rfc822 7bit 0 string Received: message/rfc822 0 string Path: message/news 8bit 0 string Xref: message/news 8bit 0 string From: message/rfc822 7bit 0 string Article message/news 8bit #------------------------------------------------------------------------------ # msword: file(1) magic for MS Word files # # Contributor claims: # Reversed-engineered MS Word magic numbers # 0 string \376\067\0\043 application/msword 0 string \320\317\021\340\241\261 application/msword 0 string \333\245-\0\0\0 application/msword #------------------------------------------------------------------------------ # printer: file(1) magic for printer-formatted files # # PostScript 0 string %! application/postscript 0 string \004%! application/postscript # Acrobat # (due to cl...@cs...) 0 string %PDF- application/pdf #------------------------------------------------------------------------------ # sc: file(1) magic for "sc" spreadsheet # 38 string Spreadsheet application/x-sc #------------------------------------------------------------------------------ # tex: file(1) magic for TeX files # # XXX - needs byte-endian stuff (big-endian and little-endian DVI?) # # From <co...@ta...> # Although we may know the offset of certain text fields in TeX DVI # and font files, we can't use them reliably because they are not # zero terminated. [but we do anyway, christos] 0 string \367\002 application/x-dvi #0 string \367\203 TeX generic font data #0 string \367\131 TeX packed font data #0 string \367\312 TeX virtual font data #0 string This\ is\ TeX, TeX transcript text #0 string This\ is\ METAFONT, METAFONT transcript text # There is no way to detect TeX Font Metric (*.tfm) files without # breaking them apart and reading the data. The following patterns # match most *.tfm files generated by METAFONT or afm2tfm. 2 string \000\021 application/x-tex-tfm 2 string \000\022 application/x-tex-tfm #>34 string >\0 (%s) # Texinfo and GNU Info, from Daniel Quinlan (qu...@yg...) 0 string \\input\ texinfo text/x-texinfo 0 string This\ is\ Info\ file text/x-info # correct TeX magic for Linux (and maybe more) # from Peter Tobias (to...@se...) # 0 leshort 0x02f7 application/x-dvi # RTF - Rich Text Format 0 string {\\rtf text/rtf #------------------------------------------------------------------------------ # animation: file(1) magic for animation/movie formats # # animation formats, originally from va...@cc... (VaX#n8) # MPEG file # MPEG sequences 0 belong 0x000001BA >4 byte &0x40 video/mp2p >4 byte ^0x40 video/mpeg 0 belong 0x000001BB video/mpeg 0 belong 0x000001B0 video/mp4v-es 0 belong 0x000001B5 video/mp4v-es 0 belong 0x000001B3 video/mpv 0 belong&0xFF5FFF1F 0x47400010 video/mp2t 0 belong 0x00000001 >4 byte&1F 0x07 video/h264 # FLI animation format 0 leshort 0xAF11 video/fli # FLC animation format 0 leshort 0xAF12 video/flc # # SGI and Apple formats # Added ISO mimes 0 string MOVI video/sgi 4 string moov video/quicktime 4 string mdat video/quicktime 4 string wide video/quicktime 4 string skip video/quicktime 4 string free video/quicktime 4 string idsc image/x-quicktime 4 string idat image/x-quicktime 4 string pckg application/x-quicktime 4 string/B jP image/jp2 4 string ftyp >8 string isom video/mp4 >8 string mp41 video/mp4 >8 string mp42 video/mp4 >8 string/B jp2 image/jp2 >8 string 3gp video/3gpp >8 string avc1 video/3gpp >8 string mmp4 video/mp4 >8 string/B M4A audio/mp4 >8 string/B qt video/quicktime # The contributor claims: # I couldn't find a real magic number for these, however, this # -appears- to work. Note that it might catch other files, too, # so BE CAREFUL! # # Note that title and author appear in the two 20-byte chunks # at decimal offsets 2 and 22, respectively, but they are XOR'ed with # 255 (hex FF)! DL format SUCKS BIG ROCKS. # # DL file version 1 , medium format (160x100, 4 images/screen) 0 byte 1 video/unknown 0 byte 2 video/unknown # # Databases # # GDBM magic numbers # Will be maintained as part of the GDBM distribution in the future. # <do...@te...> 0 belong 0x13579ace application/x-gdbm 0 lelong 0x13579ace application/x-gdbm 0 string GDBM application/x-gdbm # 0 belong 0x061561 application/x-dbm # # Executables # 0 string \177ELF >16 leshort 0 application/octet-stream >16 leshort 1 application/x-object >16 leshort 2 application/x-executable >16 leshort 3 application/x-sharedlib >16 leshort 4 application/x-coredump >16 beshort 0 application/octet-stream >16 beshort 1 application/x-object >16 beshort 2 application/x-executable >16 beshort 3 application/x-sharedlib >16 beshort 4 application/x-coredump # # DOS 0 string MZ application/x-dosexec # # KDE 0 string [KDE\ Desktop\ Entry] application/x-kdelnk 0 string \#\ KDE\ Config\ File application/x-kdelnk # xmcd database file for kscd 0 string \#\ xmcd text/xmcd #------------------------------------------------------------------------------ # pkgadd: file(1) magic for SysV R4 PKG Datastreams # 0 string #\ PaCkAgE\ DaTaStReAm application/x-svr4-package #PNG Image Format 0 string \x89PNG image/png # MNG Video Format, <URL:http://www.libpng.org/pub/mng/spec/> 0 string \x8aMNG video/x-mng 0 string \x8aJNG video/x-jng #------------------------------------------------------------------------------ # Hierarchical Data Format, used to facilitate scientific data exchange # specifications at http://hdf.ncsa.uiuc.edu/ 0 belong 0x0e031301 Hierarchical Data Format (version 4) data 0 string \211HDF\r\n\032 Hierarchical Data Format (version 5) data # Adobe Photoshop 0 string 8BPS image/x-photoshop # Felix von Leitner <fel...@fe...> 0 string d8:announce application/x-bittorrent # lotus 1-2-3 document 0 belong 0x00001a00 application/x-123 0 belong 0x00000200 application/x-123 # MS Access database 4 string Standard\ Jet\ DB application/msaccess ## magic for XBase files #0 byte 0x02 #>8 leshort >0 #>>12 leshort 0 application/x-dbf # #0 byte 0x03 #>8 leshort >0 #>>12 leshort 0 application/x-dbf # #0 byte 0x04 #>8 leshort >0 #>>12 leshort 0 application/x-dbf # #0 byte 0x05 #>8 leshort >0 #>>12 leshort 0 application/x-dbf # #0 byte 0x30 #>8 leshort >0 #>>12 leshort 0 application/x-dbf # #0 byte 0x43 #>8 leshort >0 #>>12 leshort 0 application/x-dbf # #0 byte 0x7b #>8 leshort >0 #>>12 leshort 0 application/x-dbf # #0 byte 0x83 #>8 leshort >0 #>>12 leshort 0 application/x-dbf # #0 byte 0x8b #>8 leshort >0 #>>12 leshort 0 application/x-dbf # #0 byte 0x8e #>8 leshort >0 #>>12 leshort 0 application/x-dbf # #0 byte 0xb3 #>8 leshort >0 #>>12 leshort 0 application/x-dbf # #0 byte 0xf5 #>8 leshort >0 #>>12 leshort 0 application/x-dbf # #0 leshort 0x0006 application/x-dbt # Debian has entries for the old PGP formats: # pgp: file(1) magic for Pretty Good Privacy # see http://lists.gnupg.org/pipermail/gnupg-devel/1999-September/016052.html 0 beshort 0x9900 text/PGP key public ring 0 beshort 0x9501 text/PGP key security ring 0 beshort 0x9500 text/PGP key security ring 0 beshort 0xa600 text/PGP encrypted data 0 string -----BEGIN\040PGP text/PGP armored data >15 string PUBLIC\040KEY\040BLOCK- public key block >15 string MESSAGE- message >15 string SIGNED\040MESSAGE- signed message >15 string PGP\040SIGNATURE- signature 0 beshort 0x8501 data # # GnuPG Magic: # 0 beshort 0x9901 text/GnuPG key public ring 0 beshort 0x8501 text/OpenPGP data # flash: file(1) magic for Macromedia Flash file format # # See # # http://www.macromedia.com/software/flash/open/ # 0 string FWS >3 byte x application/x-shockwave-flash # The following paramaters are created for Namazu. # <http://www.namazu.org/> # # 1999/08/13 #0 string \<!--\ MHonArc text/html; x-type=mhonarc 0 string BZh application/x-bzip2 # 1999/09/09 # VRML (suggested by Masao Takaku) 0 string #VRML\ V1.0\ ascii model/vrml 0 string #VRML\ V2.0\ utf8 model/vrml #------------------------------------------------------------------------------ # ichitaro456: file(1) magic for Just System Word Processor Ichitaro # # Contributor kenzo-: # Reversed-engineered JS Ichitaro magic numbers # 0 string DOC >43 byte 0x14 application/ichitaro4 >144 string JDASH application/ichitaro4 0 string DOC >43 byte 0x15 application/ichitaro5 0 string DOC >43 byte 0x16 application/ichitaro6 #------------------------------------------------------------------------------ # office97: file(1) magic for MicroSoft Office files # # Contributor kenzo-: # Reversed-engineered MS Office magic numbers # #0 string \320\317\021\340\241\261\032\341 #>48 byte 0x1B application/excel 2080 string Microsoft\ Excel\ 5.0\ Worksheet application/excel 2114 string Biff5 application/excel 0 string \224\246\056 application/msword 0 belong 0x31be0000 application/msword 0 string PO^Q` application/msword 0 string \320\317\021\340\241\261\032\341 >546 string bjbj application/msword >546 string jbjb application/msword 512 string R\0o\0o\0t\0\ \0E\0n\0t\0r\0y application/msword 2080 string Microsoft\ Word\ 6.0\ Document application/msword 2080 string Documento\ Microsoft\ Word\ 6 application/msword 2112 string MSWordDoc application/msword #0 string \320\317\021\340\241\261\032\341 application/powerpoint 0 string \320\317\021\340\241\261\032\341 application/msword 0 string #\ PaCkAgE\ DaTaStReAm application/x-svr4-package # WinNT/WinCE PE files (Warner Losh, im...@vi...) # 128 string PE\000\000 application/octet-stream 0 string PE\000\000 application/octet-stream # miscellaneous formats 0 string LZ application/octet-stream # .EXE formats (Greg Roelofs, ne...@uc...) # 0 string MZ >24 string @ application/octet-stream 0 string MZ >30 string Copyright\ 1989-1990\ PKWARE\ Inc. application/x-zip 0 string MZ >30 string PKLITE\ Copr. application/x-zip 0 string MZ >36 string LHa's\ SFX application/x-lha 0 string MZ application/octet-stream # LHA archiver 2 string -lh >6 string - application/x-lha # Zoo archiver 20 lelong 0xfdc4a7dc application/x-zoo # ARC archiver 0 lelong&0x8080ffff 0x0000081a application/x-arc 0 lelong&0x8080ffff 0x0000091a application/x-arc 0 lelong&0x8080ffff 0x0000021a application/x-arc 0 lelong&0x8080ffff 0x0000031a application/x-arc 0 lelong&0x8080ffff 0x0000041a application/x-arc 0 lelong&0x8080ffff 0x0000061a application/x-arc # Microsoft Outlook's Transport Neutral Encapsulation Format (TNEF) 0 lelong 0x223e9f78 application/ms-tnef # From: stephane.loeuillet@tiscali.f # http://www.djvuzone.org/ 0 string AT&TFORM image/x.djvu # Danny Milosavljevic <dan...@gm...> # this are adrift (adventure game standard) game files, extension .taf # depending on version magic continues with 0x93453E6139FA (V 4.0) # 0x9445376139FA (V 3.90) # 0x9445366139FA (V 3.80) # this is from source (http://www.adrift.org.uk/) and I have some taf # files, and checked them. #0 belong 0x3C423FC9 #>4 belong 0x6A87C2CF application/x-adrift #0 string \000\000\001\000 image/x-ico # Quark Xpress 3 Files: # (made the mimetype up) 0 string \0\0MMXPR3\0 application/x-quark-xpress-3 # EET archive # From: Tilman Sauerbeck <ti...@co...> 0 belong 0x1ee7ff00 application/x-eet # From: Denis Knauf, via gentoo. 0 string fLaC audio/x-flac 0 string CWS application/x-shockwave-flash # Gnumeric spreadsheet # This entry is only semi-helpful, as Gnumeric compresses its files, so # they will ordinarily reported as "compressed", but at least -z helps 39 string =<gmr:Workbook application/x-gnumeric |
From: Malcolm B. <mb...@us...> - 2009-04-22 15:08:04
|
Update of /cvsroot/lxr/lxr In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv17535 Modified Files: INSTALL Log Message: Minor fixes to install instructions Index: INSTALL =================================================================== RCS file: /cvsroot/lxr/lxr/INSTALL,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- INSTALL 21 Apr 2009 14:48:58 -0000 1.27 +++ INSTALL 22 Apr 2009 15:07:49 -0000 1.28 @@ -75,6 +75,10 @@ Edit the lxr config file ------------------------ + +Copy the template lxr.conf file from the templates directory to the +root of the lxr installation. + Go through the config file and fill in the relevant values. If you have glimpse installed, you should set @@ -152,14 +156,14 @@ Using Glimpse with LXR -------------------------------- -Create a directory for the swish index files to go in, and put the +Create a directory for the glimpse index files to go in, and put the path of this directory in the 'glimpsedir' variable. Generate index. --------------- It is now time to generate the index. This is done using the program "genxref". genxref takes two arguments --url= and --version= where is -the url where the lxr cgi scripts are found. +the url where the lxr web front-end appears. 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 @@ -238,7 +242,6 @@ Copy .htaccess_cgi to .htaccess - 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. @@ -290,6 +293,9 @@ module that handles most of the languages LXR recognises. Configuration here enables support for new languages. +- Local.pm: various routines that may need to be customised to provide + useful file summaries in the directory and file listing views. + Getting help if it doesn't work: -------------------------------- |
From: AdrianIssott <adr...@us...> - 2009-04-21 20:03:08
|
Update of /cvsroot/lxr/lxr/lib/LXR/Index In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv5839/lib/LXR/Index Modified Files: DBI.pm Log Message: Feature 1691378 (Rearchitect the DB backends) Part III * Explicitly stating the LXR::Index by providing stub implementations (moved from LXR::Index::DBI) * Updated LXR::Files and LXR::Lang stub implementations to be consistent with the style used in LXR::Index * No functional changes Index: DBI.pm =================================================================== RCS file: /cvsroot/lxr/lxr/lib/LXR/Index/DBI.pm,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- DBI.pm 19 Apr 2009 16:52:40 -0000 1.22 +++ DBI.pm 21 Apr 2009 20:03:04 -0000 1.23 @@ -16,6 +16,9 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# This is an abstract package as it doesn't redefine any of the +# subroutines defined by LXR::Index and instead relies on +# there being derived classes that provide a concrete implementation package LXR::Index::DBI; $CVSID = '$Id$ '; @@ -37,94 +40,6 @@ $index = new LXR::Index::Oracle($dbname); } return $index; -} - -sub getindex { - my ($self, $symname, $release) = @_; - my @indexes; - return @indexes; -} - -sub index { - my ($self, $symname, $fileid, $line, $langid, $type, $relsym) = @_; - return; -} - -sub toindex { - my ($self, $fileid) = @_; - my $filefoundboolean; - return $filefoundboolean; -} - -sub setindexed { - my ($self, $fileid) = @_; - return; -} - -sub fileid { - my ($self, $filename, $revision) = @_; - my $fileid; - return $fileid; -} - -sub getreference { - my ($self, $symname, $release) = @_; - my @references; - return @references; -} - -sub reference { - my ($self, $symname, $fileid, $line) = @_; - return; -} - -sub toreference { - my ($self, $fileid) = @_; - my $referencefoundboolean; - return $referencefoundboolean; -} - -sub setreferenced { - my ($self, $fileid) = @_; - return; -} - -sub release { - my ($self, $fileid, $release) = @_; - return; -} - -sub symid { - my ($self, $symname) = @_; - my $symid; - return $symid; -} - -sub symname { - my ($self, $symid) = @_; - my $symname; - return $symname; -} - -sub issymbol { - my ($self, $symname, $release) = @_; - my $symbolfoundboolean; - return $symbolfoundboolean; -} - -sub getdecid { - my ($self, $lang, $string) = @_; - my $decid; - return $decid; -} - -sub empty_cache { - return; -} - -sub purge { - my ($self, $version) = @_; - return; -} +} 1; |
From: AdrianIssott <adr...@us...> - 2009-04-21 20:03:08
|
Update of /cvsroot/lxr/lxr/lib/LXR In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv5839/lib/LXR Modified Files: Index.pm Files.pm Lang.pm Log Message: Feature 1691378 (Rearchitect the DB backends) Part III * Explicitly stating the LXR::Index by providing stub implementations (moved from LXR::Index::DBI) * Updated LXR::Files and LXR::Lang stub implementations to be consistent with the style used in LXR::Index * No functional changes Index: Index.pm =================================================================== RCS file: /cvsroot/lxr/lxr/lib/LXR/Index.pm,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- Index.pm 21 Jul 2004 20:44:30 -0000 1.11 +++ Index.pm 21 Apr 2009 20:03:04 -0000 1.12 @@ -39,6 +39,113 @@ return $index; } -# TODO: Add skeleton code here to define the Index interface +# +# Stub implementations of this interface +# + +sub getindex { + my ($self, $symname, $release) = @_; + my @indexes; + warn __PACKAGE__."::getindex not implemented. Parameters @_"; + return @indexes; +} + +sub index { + my ($self, $symname, $fileid, $line, $langid, $type, $relsym) = @_; + warn __PACKAGE__."::index not implemented. Parameters @_"; + return; +} + +sub toindex { + my ($self, $fileid) = @_; + my $filefoundboolean; + warn __PACKAGE__."::toindex not implemented. Parameters @_"; + return $filefoundboolean; +} + +sub setindexed { + my ($self, $fileid) = @_; + warn __PACKAGE__."::setindexed not implemented. Parameters @_"; + return; +} + +sub fileid { + my ($self, $filename, $revision) = @_; + my $fileid; + warn __PACKAGE__."::fileid not implemented. Parameters @_"; + return $fileid; +} + +sub getreference { + my ($self, $symname, $release) = @_; + my @references; + warn __PACKAGE__."::getreference not implemented. Parameters @_"; + return @references; +} + +sub reference { + my ($self, $symname, $fileid, $line) = @_; + warn __PACKAGE__."::reference not implemented. Parameters @_"; + return; +} + +sub toreference { + my ($self, $fileid) = @_; + my $referencefoundboolean; + warn __PACKAGE__."::toreference not implemented. Parameters @_"; + return $referencefoundboolean; +} + +sub setreferenced { + my ($self, $fileid) = @_; + warn __PACKAGE__."::setreferenced not implemented. Parameters @_"; + return; +} + +sub release { + my ($self, $fileid, $release) = @_; + warn __PACKAGE__."::release not implemented. Parameters @_"; + return; +} + +sub symid { + my ($self, $symname) = @_; + my $symid; + warn __PACKAGE__."::symid not implemented. Parameters @_"; + return $symid; +} + +sub symname { + my ($self, $symid) = @_; + my $symname; + warn __PACKAGE__."::symname not implemented. Parameters @_"; + return $symname; +} + +sub issymbol { + my ($self, $symname, $release) = @_; + my $symbolfoundboolean; + warn __PACKAGE__."::issymbol not implemented. Parameters @_"; + return $symbolfoundboolean; +} + +sub getdecid { + my ($self, $lang, $string) = @_; + my $decid; + warn __PACKAGE__."::getdecid not implemented. Parameters @_"; + return $decid; +} + +sub empty_cache { + my ($self) = @_; + warn __PACKAGE__."::empty_cache not implemented. Parameters @_"; + return; +} + +sub purge { + my ($self, $version) = @_; + warn __PACKAGE__."::purge not implemented. Parameters @_"; + return; +} 1; Index: Files.pm =================================================================== RCS file: /cvsroot/lxr/lxr/lib/LXR/Files.pm,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- Files.pm 26 Mar 2009 17:15:28 -0000 1.11 +++ Files.pm 21 Apr 2009 20:03:04 -0000 1.12 @@ -48,74 +48,102 @@ return $files; } -# Stub implementations of the Files interface +# +# Stub implementations of this interface +# sub getdir { - my $self = shift; - warn "::getdir not implemented. Parameters @_"; + my ($self, $pathname, $release) = @_; + my @dircontents; + warn __PACKAGE__."::getdir not implemented. Parameters @_"; + return @dircontents; } sub getfile { - my $self = shift; - warn "::getfile not implemented. Parameters @_"; + my ($self, $pathname, $release) = @_; + warn __PACKAGE__."::getfile not implemented. Parameters @_"; + my $filecontents; + return $filecontents; } sub getannotations { - my $self = shift; - warn "::getannotations not implemented. Parameters @_"; + my ($self, $filename, $release) = @_; + warn __PACKAGE__."::getannotations not implemented. Parameters @_"; + my @annotations; + return @annotations; } sub getauthor { - my $self = shift; - warn "::getauthor not implemented. Parameters @_"; + my ($self, $filename, $revision) = @_; + warn __PACKAGE__."::getauthor not implemented. Parameters @_"; + my $author; + return $author; } sub filerev { - my $self = shift; - warn "::filerev not implemented. Parameters @_"; + my ($self, $filename, $release) = @_; + warn __PACKAGE__."::filerev not implemented. Parameters @_"; + my $filerev; + return $filerev; } sub getfilehandle { - my $self = shift; - warn "::getfilehandle not implemented. Parameters @_"; + my ($self, $filename, $release) = @_; + warn __PACKAGE__."::getfilehandle not implemented. Parameters @_"; + my $fh; + return $fh; } sub getfilesize { - my $self = shift; - warn "::getfilesize not implemented. Parameters @_"; + my ($self, $filename, $release) = @_; + warn __PACKAGE__."::getfilesize not implemented. Parameters @_"; + my $filesize; + return $filesize; } sub getfiletime { - my $self = shift; - warn "::getfiletime not implemented. Parameters @_"; + my ($self, $filename, $release) = @_; + warn __PACKAGE__."::getfiletime not implemented. Parameters @_"; + my $modificationTimeInSecondsSinceEpoch; + return $modificationTimeInSecondsSinceEpoch; } sub getindex { - my $self = shift; - warn "::getindex not implemented. Parameters @_"; + my ($self, $pathname, $release) = @_; + warn __PACKAGE__."::getindex not implemented. Parameters @_"; + my %index; + return %index; } sub isdir { - my $self = shift; - warn "::isdir not implemented. Parameters: @_"; + my ($self, $pathname, $release) = @_; + warn __PACKAGE__."::isdir not implemented. Parameters: @_"; + my $boolean; + return $boolean; } sub isfile { - my $self = shift; - warn "::isfile not implemented. Parameters: @_"; + my ($self, $pathname, $release) = @_; + warn __PACKAGE__."::isfile not implemented. Parameters: @_"; + my $boolean; + return $boolean; } +# FIXME: This function really sucks and should be removed :) sub tmpfile { - my $self = shift; - # FIXME: This function really sucks and should be removed :) - warn "::tmpfile not implemented. Parameters: @_"; + my ($self, $filename, $release) = @_; + warn __PACKAGE__."::tmpfile not implemented. Parameters: @_"; + my $pathToATmpCopyOfTheFile; + return $pathToATmpCopyOfTheFile; } +# FIXME: this function should probably not exist, since it doesn't make sense for +# all file access methods sub toreal { - # FIXME: this function should probably not exist, since it doesn't make sense for - # all file access methods + my ($self, $pathname, $release) = @_; warn "toreal called - obsolete"; - return undef; + my $path; + return $path; } 1; Index: Lang.pm =================================================================== RCS file: /cvsroot/lxr/lxr/lib/LXR/Lang.pm,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- Lang.pm 12 Apr 2009 16:10:37 -0000 1.34 +++ Lang.pm 21 Apr 2009 20:03:04 -0000 1.35 @@ -87,24 +87,33 @@ $$frag =~ s#\n#</span>\n<span class=\"comment\">#g; } +# +# Stub implementations of this interface +# + sub processcode { - my ($self) = @_; - print(STDERR ref($self), "->processcode not implemented.\n"); + my ($self, $code) = @_; + warn __PACKAGE__."::processcode not implemented. Parameters @_"; + return; } sub processreserved { - my ($self) = @_; - print(STDERR ref($self), "->processreserved not implemented.\n"); + my ($self, $frag) = @_; + warn __PACKAGE__."::processreserved not implemented. Parameters @_"; + return; } sub referencefile { - my ($self) = @_; - print(STDERR ref($self), "->referencefile not implemented.\n"); + my ($self, $name, $path, $fileid, $index, $config) = @_; + warn __PACKAGE__."::referencefile not implemented. Parameters @_"; + return; } sub language { my ($self) = @_; - print(STDERR ref($self), "->language not implemented.\n"); + my $languageName; + warn __PACKAGE__."::language not implemented. Parameters @_"; + return $languageName; } 1; |
From: AdrianIssott <adr...@us...> - 2009-04-21 19:12:32
|
Update of /cvsroot/lxr/lxr In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv30370 Modified Files: search Log Message: Fix for bug 2752574 (The LXR general text search doesn't work with Swish on Windows) Index: search =================================================================== RCS file: /cvsroot/lxr/lxr/search,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- search 8 Apr 2009 20:49:18 -0000 1.31 +++ search 21 Apr 2009 19:12:25 -0000 1.32 @@ -141,22 +141,18 @@ sub swishsearch { my ($searchtext, $filetext, $advanced, $casesensitive) = @_; - if (!-e $config->swishdir . "/" . $release . ".index") { - print - "<p align='center'><i>Version '$release' has not been indexed and is unavailable for searching.</i></p>"; + my $swishIndex = $config->swishdir . "/" . $release . ".index"; + if (!-e $swishIndex) { + print "<p align='center'><i>"; + print "Version '$release' has not been indexed and is unavailable for searching."; + print "</i></p>"; return; } - $ENV{'PATH'} = '/bin:/usr/local/bin:/usr/bin:/usr/sbin'; - unless (open(SWISH, "-|")) { - exec($config->swishbin, "-f", $config->swishdir . "/" . $release . ".index", - "-w", "'(" . $searchtext . ")'"); - open(STDERR, ">&STDOUT"); - print(STDERR "Couldn't exec " . $config->swishbin . ": $!\n"); - kill(9, $$); - } + + my $swishCommand = join(' ', $config->swishbin, "-f", $swishIndex, "-w", "'(" . $searchtext . ")'"); + my $ret = `$swishCommand`; + my @result = grep { not /^[\#\.]/ } split(/\n/, $ret); - my @result = grep { not /^[\#\.]/ } <SWISH>; - close(SWISH); my $retval = $?; my @ret; if ($retval == 0) { |
From: Malcolm B. <mb...@us...> - 2009-04-21 16:54:32
|
Update of /cvsroot/lxr/lxr/tests In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv14888/tests Modified Files: README Removed Files: AllTests.pm BKTest.pm CVSTest.pm ConfigTest.pm PlainTest.pm SecurityTest.pm TestRunner.pl lxr.conf test-versions Log Message: Move all the tests to the lxr-tools module Index: README =================================================================== RCS file: /cvsroot/lxr/lxr/tests/README,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- README 24 Mar 2009 20:02:12 -0000 1.3 +++ README 21 Apr 2009 16:54:13 -0000 1.4 @@ -1,12 +1,6 @@ -To run these tests: - -- Make sure Test::Unit is installed -- Execute TestRunner.pl AllTests - -Note: If you wish to run the Bitkeeper tests you will need to: -- Grab the lxr-tools module from CVS to the same top-level as the lxr tree -(so you have /mydir/lxr and /mydir/lxr-tools) -- untar the bk-test-repository.tgz file in lxr-tools/test-data -- uncomment the BKTest line in AllTests.pm +The test files for LXR are now found in the lxr-tools module. To run +the tests, grab the lxr-tools module from CVS and install it next to +the lxr directory (i.e. /path/lxr and /path/lxr-tools). +Then go to the lxr-tools directory and follow instructions there. --- AllTests.pm DELETED --- --- BKTest.pm DELETED --- --- CVSTest.pm DELETED --- --- ConfigTest.pm DELETED --- --- PlainTest.pm DELETED --- --- SecurityTest.pm DELETED --- --- TestRunner.pl DELETED --- --- lxr.conf DELETED --- --- test-versions DELETED --- |
From: Malcolm B. <mb...@us...> - 2009-04-21 16:54:27
|
Update of /cvsroot/lxr/lxr/tests/test-src/5.5.3 In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv14888/tests/test-src/5.5.3 Removed Files: aFile.txt Log Message: Move all the tests to the lxr-tools module --- aFile.txt DELETED --- |
From: Malcolm B. <mb...@us...> - 2009-04-21 16:54:27
|
Update of /cvsroot/lxr/lxr/tests/test-src/5.5.4/aDir In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv14888/tests/test-src/5.5.4/aDir Removed Files: anOtherFile.txt Log Message: Move all the tests to the lxr-tools module --- anOtherFile.txt DELETED --- |
From: Malcolm B. <mb...@us...> - 2009-04-21 16:54:27
|
Update of /cvsroot/lxr/lxr/tests/test-src/5.5.4 In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv14888/tests/test-src/5.5.4 Removed Files: aFile.txt anOtherFile.txt Log Message: Move all the tests to the lxr-tools module --- aFile.txt DELETED --- --- anOtherFile.txt DELETED --- |
From: Malcolm B. <mb...@us...> - 2009-04-21 16:52:46
|
Update of /cvsroot/lxr/lxr-tools/tests In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv14788 Modified Files: README Log Message: Update readme for new location in lxr-tools Index: README =================================================================== RCS file: /cvsroot/lxr/lxr-tools/tests/README,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- README 21 Apr 2009 15:25:00 -0000 1.1 +++ README 21 Apr 2009 16:52:33 -0000 1.2 @@ -4,8 +4,6 @@ - Execute TestRunner.pl AllTests Note: If you wish to run the Bitkeeper tests you will need to: -- Grab the lxr-tools module from CVS to the same top-level as the lxr tree -(so you have /mydir/lxr and /mydir/lxr-tools) - untar the bk-test-repository.tgz file in lxr-tools/test-data - uncomment the BKTest line in AllTests.pm |
From: Malcolm B. <mb...@us...> - 2009-04-21 16:49:11
|
Update of /cvsroot/lxr/lxr-tools/tests In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv14381 Modified Files: ConfigTest.pm PlainTest.pm TestRunner.pl lxr.conf Log Message: Updated to account for new location of files Index: ConfigTest.pm =================================================================== RCS file: /cvsroot/lxr/lxr-tools/tests/ConfigTest.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ConfigTest.pm 21 Apr 2009 15:25:00 -0000 1.1 +++ ConfigTest.pm 21 Apr 2009 16:48:58 -0000 1.2 @@ -5,8 +5,6 @@ use strict; use Test::Unit; -use lib ".."; -use lib "../lib"; use LXR::Config; Index: PlainTest.pm =================================================================== RCS file: /cvsroot/lxr/lxr-tools/tests/PlainTest.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- PlainTest.pm 21 Apr 2009 15:25:00 -0000 1.1 +++ PlainTest.pm 21 Apr 2009 16:48:58 -0000 1.2 @@ -18,7 +18,7 @@ use vars qw($root); -$root = "$FindBin::Bin/test-src/"; +$root = "../test-data/source/"; $config = new LXR::Config("http://test/lxr", "./lxr.conf"); @@ -70,9 +70,11 @@ my $f = $self->{'plain'}; my $file = $f->getfile("/aFile.txt", '5.5.4'); + $self->assert($file, "Getfile failed"); local ($/) = undef; open FILE, "<". "$root/5.5.4/aFile.txt" || die "Can't open file"; my $ref = <FILE>; + $self->assert($ref, "Couldn't read file"); $self->assert($file eq $ref, "Files not matching"); } Index: TestRunner.pl =================================================================== RCS file: /cvsroot/lxr/lxr-tools/tests/TestRunner.pl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- TestRunner.pl 21 Apr 2009 15:25:00 -0000 1.1 +++ TestRunner.pl 21 Apr 2009 16:48:58 -0000 1.2 @@ -4,6 +4,8 @@ use Test::Unit::Debug qw(debug_pkgs); use Test::Unit::TestRunner; +use lib "../../lxr/lib"; +use lib "../../lxr"; # Uncomment and edit to debug individual packages. #debug_pkgs(qw/Test::Unit::TestCase/); Index: lxr.conf =================================================================== RCS file: /cvsroot/lxr/lxr-tools/tests/lxr.conf,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- lxr.conf 21 Apr 2009 15:25:00 -0000 1.1 +++ lxr.conf 21 Apr 2009 16:48:58 -0000 1.2 @@ -7,22 +7,22 @@ # Path to glimpse executable. # Define this OR the swish-e variables depending which search engine you want to use. - 'glimpsebin' => '/test/lxr/bin/glimpse', + 'glimpsebin' => 'glimpse', # Location of SWISH-E indexer binary 'swishindex' => '/test/lxr/bin/swish-e', # Location of SWISH-E search binary - 'swishsearch' => '/test/lxr/bin/swish-e', + 'swishsearch' => 'swish-e', # Path to Exuberant Ctags executable - 'ectagsbin' => '/test/lxr/bin/ctags', + 'ectagsbin' => 'ctags', # Place where lxr can write temporary files 'tmpdir' => '/tmp', # Location of the Generic.pm config file - 'genericconf' => '../lib/LXR/Lang/generic.conf', + 'genericconf' => '../../lxr/lib/LXR/Lang/generic.conf', # Paths for CVS module 'cvspath' => '/bin:/usr/local/bin:/usr/bin:/usr/sbin', @@ -30,7 +30,6 @@ }, { - # Configuration for http://192.168.1.3/lxr. # baseurl is used to select configuration block. 'baseurl' => 'http://test/lxr', # Put your URL here @@ -43,16 +42,6 @@ # ennumerated. # From a file: 'range' => [ readfile('test-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. - # The default version to display 'default' => '1.0.6'}, @@ -61,12 +50,6 @@ 'range' => [qw(i386 alpha arm m68k mips ppc sparc sparc64)]}, }, - # 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', @@ -86,16 +69,12 @@ # 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' => '../test-data/source/', # The name to display for this source tree - 'sourcerootname' => 'Example', - + 'sourcerootname' => 'Test Configuration', 'sourceparams' => {'cachepath' => '/a/path/to/cache', 'param2' => 'secondparam'}, + # 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> @@ -108,10 +87,10 @@ # 'dbuser' => 'lxr', # For using glimpse, the directory to store the .glimpse files in is required - 'glimpsedir' => '/path/to/glimpse/databases', + 'glimpsedir' => '/tmp/lxr-glimpse', # Location of swish-e index database files if using swish-e - 'swishdir' => '/a/directory/here/', + 'swishdir' => '/tmp/lxr-swishe/', # where to look for include files inside the sourcetree. This is used to hyperlink |
From: Malcolm B. <mb...@us...> - 2009-04-21 16:07:51
|
Update of /cvsroot/lxr/lxr In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv9730 Modified Files: genxref Log Message: Revert change to remove path from #! path as this breaks on Unix Index: genxref =================================================================== RCS file: /cvsroot/lxr/lxr/genxref,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- genxref 8 Apr 2009 20:49:19 -0000 1.39 +++ genxref 21 Apr 2009 16:07:39 -0000 1.40 @@ -1,4 +1,4 @@ -#!perl +#!/usr/bin/perl # -*- tab-width: 4 -*-" # This program is free software; you can redistribute it and/or modify |
From: Malcolm B. <mb...@us...> - 2009-04-21 15:53:58
|
Update of /cvsroot/lxr/lxr-tools/test-data/source/5.5.4 In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv7990/source/5.5.4 Added Files: aFile.txt anOtherFile.txt Log Message: Add test data --- NEW FILE: aFile.txt --- Jaques: All the world's a stage, And all the men and women merely players; They have their exits and their entrances, And one man in his time plays many parts, His acts being seven ages. As You Like It Act 2, scene 7, 139143 --- NEW FILE: anOtherFile.txt --- Hamlet: I'll have grounds More relative than thisthe play's the thing Wherein I'll catch the conscience of the King. Hamlet Act 2, scene 2, 603605 |