diff --git a/mozilla/webtools/lxr/INSTALL b/mozilla/webtools/lxr/INSTALL index 713a10c0759..b0d513e8dd7 100644 --- a/mozilla/webtools/lxr/INSTALL +++ b/mozilla/webtools/lxr/INSTALL @@ -76,18 +76,41 @@ If it doesn't work: - Check that all the Perl scripts find their library files, also when executed by the webserver. + +Multiple Trees + + To have the same lxr source directory index multiple trees, use + a web server (such as apache) that supports virtual hosts and/or + aliases. At mozilla.org, we set the document root of lxr.mozilla.org + to the lxr/root directory and for each tree, set up an alias with + the tree name pointing to the main lxr directory. + + From our httpd.conf: + + DocumentRoot /opt/webtools/lxr.mozilla.org/root + ServerName lxr.mozilla.org + Alias /classic /opt/webtools/lxr.mozilla.org + Alias /ef /opt/webtools/lxr.mozilla.org + Alias /grendel /opt/webtools/lxr.mozilla.org + Alias /mailnews /opt/webtools/lxr.mozilla.org + Alias /mozilla /opt/webtools/lxr.mozilla.org + Alias /nspr /opt/webtools/lxr.mozilla.org + Alias /seamonkey /opt/webtools/lxr.mozilla.org + + + The lxr.conf file: LXR does not care much about your directory structure, all relevant paths can be configured from the lxr.conf file. This file is located - in the same directory as the perl script files. This makes it - possible to have different source trees in different directories on - the web server. + in the same directory as the perl script files. LXR recognizes the following options in the configuration file. baseurl - The url for the root directory of your source. + The url for the root directory of your source. Tree name (if any) + is appened to this. + htmlhead The header of all html files. This is a template that @@ -111,6 +134,10 @@ The lxr.conf file: several version you could include a variable in the path. sourceroot: /usr/local/lxr/source/$v/linux/ + To index more than one tree, include one sourceroot entry for + each tree. Each entry is a tree name/directory pair. + sourceroot: classic /export2/lxr-data/classic/mozilla + virtroot This is prepended to the path name when forming the url in links. @@ -127,7 +154,7 @@ The lxr.conf file: dbdir Where to find the database files that lxr needs (fileidx xref and - the glimpse files). + the glimpse files). The tree name (if any) is appended to this. glimpsebin Location of the glimpse binary on your system. diff --git a/mozilla/webtools/lxr/index.html b/mozilla/webtools/lxr/index.html index bbf5176ece5..be42d5b76cb 100644 --- a/mozilla/webtools/lxr/index.html +++ b/mozilla/webtools/lxr/index.html @@ -31,7 +31,7 @@
- mozilla/ + /mozilla diff --git a/mozilla/webtools/lxr/lib/LXR/Common.pm b/mozilla/webtools/lxr/lib/LXR/Common.pm index a31e843da60..9a1095f1104 100755 --- a/mozilla/webtools/lxr/lib/LXR/Common.pm +++ b/mozilla/webtools/lxr/lib/LXR/Common.pm @@ -1,4 +1,4 @@ -# $Id: Common.pm,v 1.15 1999-01-31 11:18:32 jwz%mozilla.org Exp $ +# $Id: Common.pm,v 1.16 1999-03-10 22:58:54 endico%mozilla.org Exp $ package LXR::Common; @@ -526,6 +526,11 @@ sub pathname { } +sub treename { + return $Conf->{'treename'}; +} + + sub titleexpand { if ($who eq 'source' || $who eq 'sourcedir' || $who eq 'diff') { return($Conf->sourcerootname.$Path->{'virtf'}); @@ -739,6 +744,7 @@ sub makeheader { ('dotdoturl', \&dotdoturl), ('thisurl', \&thisurl), ('pathname', \&pathname), + ('treename', \&treename), ('modes', \&modeexpand), ('variables', \&varexpand))); } diff --git a/mozilla/webtools/lxr/lib/LXR/Config.pm b/mozilla/webtools/lxr/lib/LXR/Config.pm index 2d2ba2799f5..f6111ab8e49 100755 --- a/mozilla/webtools/lxr/lib/LXR/Config.pm +++ b/mozilla/webtools/lxr/lib/LXR/Config.pm @@ -1,4 +1,4 @@ -# $Id: Config.pm,v 1.3 1998-07-28 19:17:42 jwz%netscape.com Exp $ +# $Id: Config.pm,v 1.4 1999-03-10 22:58:55 endico%mozilla.org Exp $ package LXR::Config; @@ -16,9 +16,53 @@ sub new { my $self = {}; bless($self); $self->_initialize(@parms); - return($self); + return(treeify($self)); } +sub treeify { + my ($self) = @_; + + #If there are multiple definitions of sourceroot in lxr.conf then + #this installation is configured for multiple trees. For a single + #tree "sourceroot" is a single directory where the source can be + #found. If the file contains multiple definitions of sourceroot then + #each definition is a tree,directory pair. + + if ($self->{'sourceroot'} =~ /\S\s+\S/) { + #remove the extra space that i stupidly added when parsing lxr.conf + $self->{'sourceroot'} =~ s/^\s+//;; + $self->{'oldroot'} = $self->{'sourceroot'}; + + #since there's whitespace within the root directory definition + #there is one or more tree defined. (Using directory names with + #embedded spaces here would be a bad thing.) + my %treehash = split(/\s+/, $self->{'sourceroot'}); + + #To compute which tree we're looking at, grab the second to last + #component from the script name which will be of the form: + # /seamonkey/source + $self->{'treename'} = $ENV{'SCRIPT_NAME'}; + $self->{'treename'} =~ s/.*\/([^\/]+)\/[\w]*/$1/; + + #Match the tree name against our list of trees and extract the proper + #directory. Set "sourceroot" to this directory. + $self->{'sourceroot'} = $treehash{$self->{'treename'}}; + + #set srcrootname to tree name + $self->{'sourcerootname'} = $self->{'treename'}; + + #append tree name to virtroot + $self->{'virtroot'} = $self->{'virtroot'} . "/" . $self->{'treename'} ; + + #append tree name to baserul + $self->{'baseurl'} = $self->{'baseurl'} . $self->{'treename'}; + + #append tree name to dbdir + $self->{'dbdir'} = $self->{'dbdir'} . "/" . $self->{'treename'} ; + + } + return($self); +} sub makevalueset { my $val = shift; @@ -115,8 +159,12 @@ sub _initialize { $dir eq 'searchhead' || $dir eq 'searchtail' || $dir eq 'htmldir') { - if ($arg =~ /(\S+)/) { + if ($arg =~ /([^\n]+)/) { + if ($dir eq 'sourceroot') { + $self->{$dir} = $self->{$dir} . " " . $1; + }else{ $self->{$dir} = $1; + } } } elsif ($dir eq 'map') { if ($arg =~ /(\S+)\s+(\S+)/) { diff --git a/mozilla/webtools/lxr/lxr.conf b/mozilla/webtools/lxr/lxr.conf index a4b60e88287..1cf2b4a3e8f 100644 --- a/mozilla/webtools/lxr/lxr.conf +++ b/mozilla/webtools/lxr/lxr.conf @@ -7,11 +7,12 @@ # Define typed variable "a". First value is default. #variable: a, Architecture, (-) -# Define the base url for the LXR files. -baseurl: http://cvs-mirror.mozilla.org/webtools/lxr/ +# Define the base url for the LXR files. Tree name (if any) is appened +# to this. +baseurl: http://lxr.mozilla.org/ # url prefix for bonsai -bonsaihome: /webtools/bonsai +bonsaihome: http://cvs-mirror.mozilla.org/webtools/bonsai # These are the templates for the HTML heading, directory listing and # footer, respectively. @@ -23,19 +24,40 @@ sourcehead: template-source-head sourcedirhead: template-sourcedir-head -# The source is here. -sourceroot: /opt/lxr-data/mozilla/ +# If there's only one tree being indexed then allow this older +# syntax for backward compatability. "sourceroot" should +# be the directory containing the source we're indexing. +#sourceroot: /home/mozillatrees/nspr/nspr + +# If we're indexing more than one tree then include one sourceroot +# entry per tree where each entry is a tree/directory pair. +sourceroot: classic /export2/lxr-data/classic/mozilla +sourceroot: ef /export2/lxr-data/ef/mozilla +sourceroot: mailnews /export2/lxr-data/mailnews/mozilla +sourceroot: mozilla /export2/lxr-data/mozilla/mozilla +sourceroot: nspr /export2/lxr-data/nspr/mozilla +sourceroot: seamonkey /export2/lxr-data//seamonkey/mozilla +sourceroot: grendel /export2/lxr-data/grendel/mozilla + +# name of the source. srcrootname: mozilla # prepend this to url -virtroot: /webtools/lxr +virtroot: # "#include " is mapped to this directory (in the LXR source # tree) incprefix: /include # The database files go here. -dbdir: /opt/lxr-data/db +#dbdir: /opt/lxr-data/db + +# If using multiple trees, give the parent directory containing +# dirs for each tree. For mozilla, /export/lxr-data contains +# a directory for each tree. Each of these directories contains +# the tree's databases, and a mozilla directory containing the +# source. +dbdir: /export2/lxr-data # Glimpse can be found here. glimpsebin: /opt/local/bin/glimpse diff --git a/mozilla/webtools/lxr/root/index.html b/mozilla/webtools/lxr/root/index.html new file mode 100644 index 00000000000..36034782cdd --- /dev/null +++ b/mozilla/webtools/lxr/root/index.html @@ -0,0 +1,172 @@ + + Mozilla Cross-Reference + + + + +
+ + + + + + + + + + +
+
+ Mozilla Cross-Reference +

+
+ + + + + +
+ +
+

Starting Points: +

+ +

+
+ SeaMonkey +
+
+ + This module is SeaMonkeyAll, the Mozilla browser project. + +
+ +

+ +

+ NSPR +
+
+ + This module is + NSPR, + a cross platform library for operating system facilities + including threads, I/O, timing and memory management. + +
+ +

+ +

+ Grendel +
+
+ + This module is Grendel, a mail reader written in java. + +
+ +

+ +

+ Electrical Fire +
+
+ + This is /mozilla/ef, a multi-platform Just-In-Time + Java compiler + +
+ +

+ +

+ Mail & News +
+
+ + This is the SeaMonkeyMailNews module, containing the new + Messenger + code which is being re-written from scratch. + +
+ +

+ +

+ Mozilla +
+
+ + This contains the entre CVS repository. + +
+ +

+ +

+ Classic +
+
+ + This is Mozilla Classic. Its a snapshot of the MozillaSource + module from Oct 26, 1998 just before the change was made to xpfe. + This is here for reference. No work is done on this branch. + + +
+
+ + +
+ +
+ +

This is a cross referenced display of the +Mozilla source code. +The sources displayed are those that are currently checked +in to the mainline of the mozilla.org +CVS server; +these pages are updated many times a day, so they should +be pretty close to the latest-and-greatest. + +

It's possible to search through the entire Mozilla source text; +or to search for files whose name matches a pattern; or to search +for the definitions of particular functions, variables, etc. + +

The individual files of the source code are formatted on the fly +and presented with clickable identifiers. An identifier is a +macro, typedef, struct, enum, union, function, function prototype or +variable. Clicking on them shows you a summary of how and where they +are used. + +

The free-text search command is implemented +using Glimpse, so all the +capabilities of Glimpse are available. +Regular expression searches are +especially useful. + +

(Don't use use a web-crawler to try and download all of these pages; +the CGIs will feed you several gigabytes worth of generated HTML!) + +

The pages here are generated by the +LXR tool, which was originally +written to display the source code of the Linux kernel (LXR stands +for ``Linux Cross Reference.'') Check out the +main LXR site for more information. + +

Thanks to + Arne Georg Gleditsch and + Per Kristian Gjermshus, the + authors of the LXR tool, for writing it and making it available + to the world; and thanks to + Dawn Endico for + doing almost all of the work to get LXR working with the Mozilla + sources. + +

+ +

diff --git a/mozilla/webtools/lxr/root/search-help.html b/mozilla/webtools/lxr/root/search-help.html new file mode 100644 index 00000000000..a709f1e2737 --- /dev/null +++ b/mozilla/webtools/lxr/root/search-help.html @@ -0,0 +1,166 @@ + + +mozilla cross-reference: search help + + + + +
+ +

search help
+ +for the
+mozilla cross-reference +

+ +


+

+ +This text is copied from the Glimpse manual page. I have tried to remove +things that do not apply to the lxr searcher, but beware, some things might +have slipped through. I'll try to put together something better when I get +the time. For more information on glimpse go to the +Glimpse homepage. + +
+ +

Patterns

+
    +glimpse supports a large variety of patterns, including simple +strings, strings with classes of characters, sets of strings, +wild cards, and regular expressions (see Limitations). + +
+

Strings

+
    + +Strings are any sequence of characters, including the special symbols +`^' for beginning of line and `$' for end of line. The following +special characters (`$', `^', `*', `[', `^', `|', `(', `)', `!', and +`\' ) as well as the following meta characters special to glimpse (and +agrep): `;', `,', `#', `>', `<', `-', and `.', should be preceded by +`\\' if they are to be matched as regular characters. For example, +\\^abc\\\\ corresponds to the string ^abc\\, whereas ^abc corresponds +to the string abc at the beginning of a line. + +
+

Classes of characters

+
    + +a list of characters inside [] (in order) corresponds to any character +from the list. For example, [a-ho-z] is any character between a and h +or between o and z. The symbol `^' inside [] complements the list. +For example, [^i-n] denote any character in the character set except +character 'i' to 'n'. +The symbol `^' thus has two meanings, but this is consistent with +egrep. +The symbol `.' (don't care) stands for any symbol (except for the +newline symbol). + +
+

Boolean operations

+
    + +Glimpse +supports an `AND' operation denoted by the symbol `;' +an `OR' operation denoted by the symbol `,', +a limited version of a 'NOT' operation (starting at version 4.0B1) +denoted by the symbol `~', +or any combination. +For example, pizza;cheeseburger' will output all lines containing +both patterns. +'{political,computer};science' will match 'political science' +or 'science of computers'. + +
+

Wild cards

+
    + +The symbol '#' is used to denote a sequence +of any number (including 0) +of arbitrary characters (see Limitations). +The symbol # is equivalent to .* in egrep. +In fact, .* will work too, because it is a valid regular expression +(see below), but unless this is part of an actual regular expression, +# will work faster. +(Currently glimpse is experiencing some problems with #.) + +
+

Combination of exact and approximate matching

+
    + +Any pattern inside angle brackets <> must match the text exactly even +if the match is with errors. For example, <mathemat>ics matches +mathematical with one error (replacing the last s with an a), but +mathe<matics> does not match mathematical no matter how many errors are +allowed. (This option is buggy at the moment.) + +
+

Regular expressions

+
    + +Since the index is word based, a regular expression must match words +that appear in the index for glimpse to find it. Glimpse first strips +the regular expression from all non-alphabetic characters, and +searches the index for all remaining words. It then applies the +regular expression matching algorithm to the files found in the index. +For example, glimpse 'abc.*xyz' will search the index for all files +that contain both 'abc' and 'xyz', and then search directly for +'abc.*xyz' in those files. (If you use glimpse -w 'abc.*xyz', then +'abcxyz' will not be found, because glimpse will think that abc and +xyz need to be matches to whole words.) The syntax of regular +expressions in glimpse is in general the same as that for agrep. The +union operation `|', Kleene closure `*', and parentheses () are all +supported. Currently '+' is not supported. Regular expressions are +currently limited to approximately 30 characters (generally excluding +meta characters). The maximal number of errors +for regular expressions that use '*' or '|' is 4. + +
+

Limitations

+
    + +The index of glimpse is word based. A pattern that contains more than +one word cannot be found in the index. The way glimpse overcomes this +weakness is by splitting any multi-word pattern into its set of words +and looking for all of them in the index. +For example, 'linear programming' will first consult the index +to find all files containing both linear and programming, +and then apply agrep to find the combined pattern. +This is usually an effective solution, but it can be slow for +cases where both words are very common, but their combination is not. + +

    +As was mentioned in the section on Patterns above, some characters +serve as meta characters for glimpse and need to be +preceded by '\\' to search for them. The most common +examples are the characters '.' (which stands for a wild card), +and '*' (the Kleene closure). +So, "glimpse ab.de" will match abcde, but "glimpse ab\\.de" +will not, and "glimpse ab*de" will not match ab*de, but +"glimpse ab\\*de" will. +The meta character - is translated automatically to a hypen +unless it appears between [] (in which case it denotes a range of +characters). + +

    +There is no size limit for simple patterns and simple patterns +within Boolean expressions. +More complicated patterns, such as regular expressions, +are currently limited to approximately 30 characters. +Lines are limited to 1024 characters. + +

+

+


+ +
+ + Arne Georg Gleditsch and Per Kristian Gjermshus +
+ + + diff --git a/mozilla/webtools/lxr/source b/mozilla/webtools/lxr/source index 601201f5608..17e5334dd86 100755 --- a/mozilla/webtools/lxr/source +++ b/mozilla/webtools/lxr/source @@ -1,5 +1,5 @@ #!/usr/bonsaitools/bin/perl -# $Id: source,v 1.12 1999-01-21 00:42:23 endico%mozilla.org Exp $ +# $Id: source,v 1.13 1999-03-10 22:58:50 endico%mozilla.org Exp $ # source -- Present sourcecode as html, complete with references # # Arne Georg Gleditsch @@ -282,6 +282,3 @@ if (!($Path->{'file'} =~ /\.(html)$/)) { &makefooter('sourcedir'); } } - -#$len = length($file); -#print ("length is: ", $len) ; diff --git a/mozilla/webtools/lxr/template-head b/mozilla/webtools/lxr/template-head index 8ca9c35020b..70f940e59c5 100644 --- a/mozilla/webtools/lxr/template-head +++ b/mozilla/webtools/lxr/template-head @@ -12,6 +12,8 @@
- -

Mozilla Cross Reference

+

+Mozilla Cross Reference + +$treename

diff --git a/mozilla/webtools/lxr/template-source-head b/mozilla/webtools/lxr/template-source-head index d120000e8fa..c314634daac 100644 --- a/mozilla/webtools/lxr/template-source-head +++ b/mozilla/webtools/lxr/template-source-head @@ -18,7 +18,7 @@ Mozilla Cross Reference: - + $treename
$banner @@ -27,7 +27,7 @@
- Full Change Log + Full Change Log

@@ -44,9 +44,9 @@ changes to
this file in
the last: - day
- week
- month
+ day
+ week
+ month
diff --git a/mozilla/webtools/lxr/template-sourcedir-head b/mozilla/webtools/lxr/template-sourcedir-head index 171bfd5db8f..a672ce77ca5 100644 --- a/mozilla/webtools/lxr/template-sourcedir-head +++ b/mozilla/webtools/lxr/template-sourcedir-head @@ -18,7 +18,7 @@ Mozilla Cross Reference: - + $treename
$banner @@ -32,9 +32,9 @@ changes to
this directory
in the last: - day
- week
- month
+ day
+ week
+ month
diff --git a/mozilla/webtools/lxr/update-lxr.sh b/mozilla/webtools/lxr/update-lxr.sh new file mode 100755 index 00000000000..7109760c8eb --- /dev/null +++ b/mozilla/webtools/lxr/update-lxr.sh @@ -0,0 +1,121 @@ +#!/bin/sh +# Run this from cron to update the glimpse database that lxr uses +# to do full-text searches. +# Created 12-Jun-98 by jwz. +# Updated 2-27-99 by endico. Added multiple tree support. +# Updated 3-6-99 by endico. Combine src, xref and source files +# together into one script. + +CVSROOT=/cvsroot +export CVSROOT + +PATH=/opt/local/bin:/opt/cvs-tools/bin:/usr/ucb:$PATH +export PATH + +TREE=$1 +export TREE + +lxr_dir=`pwd` +echo $lxr_dir +db_dir=`sed -n 's@^dbdir:[ ]*\(.*\)@\1@p' < $lxr_dir/lxr.conf`/$TREE + +if [ "$TREE" = '' ] +then + #since no tree is defined, assume sourceroot is defined the old way + #grab sourceroot from config file indexing only a single tree where + #format is "sourceroot: dirname" + src_dir=`sed -n 's@^sourceroot:[ ]*\(.*\)@\1@p' < $lxr_dir/lxr.conf` + +else + #grab sourceroot from config file indexing multiple trees where + #format is "sourceroot: treename dirname" + src_dir=`sed -n 's@^sourceroot:[ ]*\(.*\)@\1@p' < $lxr_dir/lxr.conf | grep $TREE | sed -n "s@^$TREE \(.*\)@\1@p"` +fi + +if [ -f $db_dir/update.log ] + then + mv $db_dir/update.log $db_dir/update.log.0 + fi + +log=$db_dir/update.log + +exec > $log 2>&1 +set -x + +date + +# +# update the lxr sources +# +pwd +time cvs -d $CVSROOT update -dP + +date + +# +# then update the Mozilla sources +# +cd $src_dir +cd .. + +case "$1" in + +'classic') + time cvs -Q -d $CVSROOT checkout -P -rMozillaSourceClassic_19981026_BRANCH MozillaSource + ;; +'ef') + time cvs -Q -d $CVSROOT checkout -P mozilla/ef + time cvs -Q -d $CVSROOT checkout -P mozilla/nsprpub + ;; +'grendel') + time cvs -Q -d $CVSROOT checkout -P Grendel + ;; +'mailnews') + time cvs -Q -d $CVSROOT checkout -P SeaMonkeyMailNews + ;; +'mozilla') + time cvs -Q -d $CVSROOT checkout -P mozilla + ;; +'nspr') + time cvs -Q -d $CVSROOT checkout -P NSPR + ;; +'seamonkey') + time cvs -Q -d $CVSROOT checkout -P SeaMonkeyAll + ;; +esac + + +date +uptime + +# +# generate cross reference database +# +cd $db_dir/tmp + +set -e +time $lxr_dir/genxref $src_dir +chmod -R a+r . +mv xref fileidx ../ + +date +uptime + + +# +# generate glimpse index +# +cd $db_dir/tmp + +# don't index CVS files +echo '/CVS/' > .glimpse_exclude + +set -e +time glimpseindex -H . $src_dir +chmod -R a+r . +mv .glimpse* ../ + +date +uptime + +exit 0 diff --git a/mozilla/webtools/lxr/update-search.sh b/mozilla/webtools/lxr/update-search.sh index 5a3a374e74e..617a9579499 100755 --- a/mozilla/webtools/lxr/update-search.sh +++ b/mozilla/webtools/lxr/update-search.sh @@ -2,13 +2,30 @@ # Run this from cron to update the glimpse database that lxr uses # to do full-text searches. # Created 12-Jun-98 by jwz. +# Updated 2-27-99 by endico. Added multiple tree support. PATH=/opt/local/bin:/opt/cvs-tools/bin:/usr/ucb:$PATH export PATH +TREE=$1 +export TREE + lxr_dir=. -db_dir=`sed -n 's@^dbdir:[ ]*\(.*\)@\1@p' < $lxr_dir/lxr.conf` -src_dir=`sed -n 's@^sourceroot:[ ]*\(.*\)@\1@p' < $lxr_dir/lxr.conf` +db_dir=`sed -n 's@^dbdir:[ ]*\(.*\)@\1@p' < $lxr_dir/lxr.conf`/$TREE + +if [ "$TREE" = '' ] +then + #since no tree is defined, assume sourceroot is defined the old way + #grab sourceroot from config file indexing only a single tree where + #format is "sourceroot: dirname" + src_dir=`sed -n 's@^sourceroot:[ ]*\(.*\)@\1@p' < $lxr_dir/lxr.conf` + +else + #grab sourceroot from config file indexing multiple trees where + #format is "sourceroot: treename dirname" + src_dir=`sed -n 's@^sourceroot:[ ]*\(.*\)@\1@p' < $lxr_dir/lxr.conf | grep $TREE | sed -n "s@^$TREE \(.*\)@\1@p"` +fi + log=$db_dir/glimpseindex.log exec > $log 2>&1 @@ -18,11 +35,15 @@ date cd $db_dir/tmp +# don't index CVS files +echo '/CVS/' > .glimpse_exclude + set -e time glimpseindex -H . $src_dir chmod -R a+r . mv .glimpse* ../ date +uptime exit 0 diff --git a/mozilla/webtools/lxr/update-src.sh b/mozilla/webtools/lxr/update-src.sh index 3dbb651714d..14f79ce2f31 100755 --- a/mozilla/webtools/lxr/update-src.sh +++ b/mozilla/webtools/lxr/update-src.sh @@ -1,6 +1,7 @@ #!/bin/sh # Run this from cron to update the source tree that lxr sees. # Created 12-Jun-98 by jwz. +# Updated 27-Feb-99 by endico. Added multiple tree support. CVSROOT=:pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot export CVSROOT @@ -8,9 +9,25 @@ export CVSROOT PATH=/opt/local/bin:/opt/cvs-tools/bin:$PATH export PATH +TREE=$1 +export TREE + lxr_dir=. -db_dir=`sed -n 's@^dbdir:[ ]*\(.*\)@\1@p' < $lxr_dir/lxr.conf` -src_dir=`sed -n 's@^sourceroot:[ ]*\(.*\)@\1@p' < $lxr_dir/lxr.conf` +db_dir=`sed -n 's@^dbdir:[ ]*\(.*\)@\1@p' < $lxr_dir/lxr.conf`/$TREE + +if [ "$TREE" = '' ] +then + #since no tree is defined, assume sourceroot is defined the old way + #grab sourceroot from config file indexing only a single tree where + #format is "sourceroot: dirname" + src_dir=`sed -n 's@^sourceroot:[ ]*\(.*\)@\1@p' < $lxr_dir/lxr.conf` + +else + #grab sourceroot from config file indexing multiple trees where + #format is "sourceroot: treename dirname" + src_dir=`sed -n 's@^sourceroot:[ ]*\(.*\)@\1@p' < $lxr_dir/lxr.conf | grep $TREE | sed -n "s@^$TREE \(.*\)@\1@p"` +fi + log=$db_dir/cvs.log exec > $log 2>&1 @@ -28,9 +45,35 @@ date cd $src_dir cd .. -# jwz: let's check out "mozilla" instead of merely "MozillaSource". -time cvs -Q -d $CVSROOT checkout -P mozilla +# endico: check out the source +case "$1" in + +'classic') + time cvs -Q -d $CVSROOT checkout -P -rMozillaSourceClassic_19981026_BRANCH MozillaSource + ;; +'ef') + time cvs -Q -d $CVSROOT checkout -P mozilla/ef + time cvs -Q -d $CVSROOT checkout -P mozilla/nsprpub + ;; +'grendel') + time cvs -Q -d $CVSROOT checkout -P Grendel + ;; +'mailnews') + time cvs -Q -d $CVSROOT checkout -P SeaMonkeyMailNews + ;; +'mozilla') + time cvs -Q -d $CVSROOT checkout -P mozilla + ;; +'nspr') + time cvs -Q -d $CVSROOT checkout -P NSPR + ;; +'seamonkey') + time cvs -Q -d $CVSROOT checkout -P SeaMonkeyAll + ;; +esac + date +uptime exit 0 diff --git a/mozilla/webtools/lxr/update-xref.sh b/mozilla/webtools/lxr/update-xref.sh index 962cb07e10c..0a37959ab65 100755 --- a/mozilla/webtools/lxr/update-xref.sh +++ b/mozilla/webtools/lxr/update-xref.sh @@ -2,13 +2,30 @@ # Run this from cron to update the identifier database that lxr uses # to turn function names into clickable links. # Created 12-Jun-98 by jwz. +# Updated 27-Feb-99 by endico. Added multiple tree support. PATH=/opt/local/bin:/opt/cvs-tools/bin:$PATH export PATH +TREE=$1 +export TREE + lxr_dir=. -db_dir=`sed -n 's@^dbdir:[ ]*\(.*\)@\1@p' < $lxr_dir/lxr.conf` -src_dir=`sed -n 's@^sourceroot:[ ]*\(.*\)@\1@p' < $lxr_dir/lxr.conf` +db_dir=`sed -n 's@^dbdir:[ ]*\(.*\)@\1@p' < $lxr_dir/lxr.conf`/$TREE + +if [ "$TREE" = '' ] +then + #since no tree is defined, assume sourceroot is defined the old way + #grab sourceroot from config file indexing only a single tree where + #format is "sourceroot: dirname" + src_dir=`sed -n 's@^sourceroot:[ ]*\(.*\)@\1@p' < $lxr_dir/lxr.conf` + +else + #grab sourceroot from config file indexing multiple trees where + #format is "sourceroot: treename dirname" + src_dir=`sed -n 's@^sourceroot:[ ]*\(.*\)@\1@p' < $lxr_dir/lxr.conf | grep $TREE | sed -n "s@^$TREE \(.*\)@\1@p"` +fi + log=$db_dir/genxref.log exec > $log 2>&1 @@ -25,5 +42,6 @@ chmod -R a+r . mv xref fileidx ../ date +uptime exit 0