Add support for indexing multiple trees from the same lxr directory.

This commit is contained in:
endico%mozilla.org 1999-03-10 22:58:57 +00:00
Родитель 3a118fd362
Коммит 30a2832cbc
15 изменённых файлов: 683 добавлений и 40 удалений

Просмотреть файл

@ -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:
<VirtualHost 207.200.73.38:80>
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
</VirtualHost>
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.

Просмотреть файл

@ -31,7 +31,7 @@
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=2 WIDTH="100%">
<TR>
<TD>
<FONT SIZE="+1"><A HREF="source/"><B>mozilla/</B></A></FONT>
<FONT SIZE="+1"><A HREF="source/"><B>/mozilla</B></A></FONT>
</TD>
<TD>
<FONT SIZE="-1">

Просмотреть файл

@ -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)));
}

Просмотреть файл

@ -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+)/) {

Просмотреть файл

@ -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 <foo.h>" 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

Просмотреть файл

@ -0,0 +1,172 @@
<HEAD>
<TITLE>Mozilla Cross-Reference</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000"
LINK="#0000EE" VLINK="#551A8B" ALINK="#FF0000">
<TABLE BGCOLOR="#000000" WIDTH="100%" BORDER=0 CELLPADDING=0 CELLSPACING=0>
<TR><TD><A HREF="http://www.mozilla.org/"><IMG
SRC="http://www.mozilla.org/images/mozilla-banner.gif" ALT=""
BORDER=0 WIDTH=600 HEIGHT=58></A></TD></TR></TABLE>
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=6 WIDTH="100%">
<TR>
<TH ALIGN=CENTER COLSPAN=3>
<BR>
<FONT SIZE="+3">Mozilla Cross-Reference</FONT>
<BR><BR>
</TH>
</TR>
<TR>
<TD WIDTH=35% ALIGN=TOP VALIGN=LEFT>
<TABLE BORDER CELLPADDING=10 CELLSPACING=0 WIDTH="100%" BGCOLOR="#EEEEEE">
<TR>
<TD>
<BR>
<P ALIGN=CENTER><FONT SIZE="+1"><B>Starting Points:</B></FONT>
<P>
<DL>
<DT>
<FONT SIZE="+1"><A HREF="/seamonkey/"><B>SeaMonkey</B></A></FONT>
</DT>
<DD>
<FONT SIZE="-1">
This module is SeaMonkeyAll, the Mozilla browser project.
</FONT>
</DD>
<P>
<DT>
<FONT SIZE="+1"><A HREF="/nspr/"><B>NSPR</B></A></FONT>
</DT>
<DD>
<FONT SIZE="-1">
This module is
<A HREF="http://www.mozilla.org/docs/refList/refNSPR/moddesc.html">NSPR</A>,
a cross platform library for operating system facilities
including threads, I/O, timing and memory management.
</FONT>
</DD>
<P>
<DT>
<FONT SIZE="+1"><A HREF="/grendel/"><B>Grendel</B></A></FONT>
</DT>
<DD>
<FONT SIZE="-1">
This module is Grendel, a mail reader written in java.
</FONT>
</DD>
<P>
<DT>
<FONT SIZE="+1"><A HREF="/ef/"><B>Electrical Fire</B></A></FONT>
</DT>
<DD>
<FONT SIZE="-1">
This is /mozilla/ef, a multi-platform Just-<WBR>In-<WBR>Time
Java compiler
</FONT>
</DD>
<P>
<DT>
<FONT SIZE="+1"><A HREF="/mailnews/"><B>Mail & News</B></A></FONT>
</DT>
<DD>
<FONT SIZE="-1">
This is the SeaMonkeyMailNews module, containing the new
<A HREF="http://www.mozilla.org/mailnews/">Messenger</A>
code which is being re-written from scratch.
</FONT>
</DD>
<P>
<DT>
<FONT SIZE="+1"><A HREF="/mozilla/"><B>Mozilla</B></A></FONT>
</DT>
<DD>
<FONT SIZE="-1">
This contains the entre CVS repository.
</FONT>
</DD>
<P>
<DT>
<FONT SIZE="+1"><A HREF="/classic/"><B>Classic</B></A></FONT>
</DT>
<DD>
<FONT SIZE="-1">
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.
</FONT>
</DD>
</DL>
</TD>
</TR>
</TABLE>
</TD>
<TD WIDTH=8></TD>
<TD ALIGN=TOP VALIGN=LEFT>
<P>This is a cross referenced display of the
<A HREF="http://www.mozilla.org/">Mozilla</A> source code.
The sources displayed are those that are currently checked
in to the mainline of the mozilla.org
<A HREF="http://www.mozilla.org/cvs.html">CVS server</A>;
these pages are updated many times a day, so they should
be pretty close to the latest-<WBR>and-<WBR>greatest.
<P>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.
<P>The individual files of the source code are formatted on the fly
and presented with clickable identifiers. An <I>identifier</I> 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.
<P>The <A HREF="search">free-text search</A> command is implemented
using <A HREF="http://glimpse.cs.arizona.edu">Glimpse</A>, so all the
capabilities of Glimpse are available.
<A HREF="search-help.html">Regular expression</A> searches are
especially useful.
<P>(Don't use use a web-crawler to try and download all of these pages;
the CGIs will feed you several <I>gigabytes</I> worth of generated HTML!)
<P>The pages here are generated by the
<A HREF="http://lxr.linux.no/">LXR</A> tool, which was originally
written to display the source code of the Linux kernel (LXR stands
for ``Linux Cross Reference.'') Check out the
<A HREF="http://lxr.linux.no/">main LXR site</a> for more information.
<P>Thanks to
<A HREF="mailto:lxr@linux.no">Arne Georg Gleditsch</A> and
<A HREF="mailto:lxr@linux.no">Per Kristian Gjermshus</A>, the
authors of the LXR tool, for writing it and making it available
to the world; and thanks to
<A HREF="http://cannibal.mi.org/~dawn/">Dawn Endico</A> for
doing almost all of the work to get LXR working with the Mozilla
sources.
</TD>
</TR>
</TABLE>
<P>

Просмотреть файл

@ -0,0 +1,166 @@
<HTML>
<HEAD>
<TITLE>mozilla cross-reference: search help</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000"
LINK="#0000EE" VLINK="#551A8B" ALINK="#FF0000">
<TABLE BGCOLOR="#000000" WIDTH="100%" BORDER=0 CELLPADDING=0 CELLSPACING=0>
<TR><TD><A HREF="http://www.mozilla.org/"><IMG
SRC="http://www.mozilla.org/images/mozilla-banner.gif" ALT=""
BORDER=0 WIDTH=600 HEIGHT=58></A></TD></TR></TABLE>
<H1 ALIGN=CENTER>search help<BR>
<FONT SIZE=3>
for the<br>
<A HREF="./"><I>mozilla cross-reference</I></A>
</FONT></H1>
<P><BR>
<BLOCKQUOTE><BLOCKQUOTE>
<I>
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
<A HREF="http://glimpse.cs.arizona.edu">Glimpse homepage</A>.
</I>
</BLOCKQUOTE></BLOCKQUOTE>
<A NAME="Patterns"></A><H2>Patterns</H2>
<UL>
glimpse supports a large variety of patterns, including simple
strings, strings with classes of characters, sets of strings,
wild cards, and regular expressions (see <A HREF="#Limitations">Limitations</A>).
</UL>
<P> <H3>Strings</H3>
<UL>
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): `;', `,', `#', `&gt;', `&lt;', `-', 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.
</UL>
<P> <H3>Classes of characters</H3>
<UL>
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).
</UL>
<P> <H3>Boolean operations</H3>
<UL>
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'.
</UL>
<P><H3>Wild cards</H3>
<UL>
The symbol '#' is used to denote a sequence
of any number (including 0)
of arbitrary characters (see <A HREF="#Limitations">Limitations</A>).
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 #.)
</UL>
<P><H3>Combination of exact and approximate matching</H3>
<UL>
Any pattern inside angle brackets &lt;&gt; must match the text exactly even
if the match is with errors. For example, &lt;mathemat&gt;ics matches
mathematical with one error (replacing the last s with an a), but
mathe&lt;matics&gt; does not match mathematical no matter how many errors are
allowed. (This option is buggy at the moment.)
</UL>
<H3>Regular expressions</H3>
<UL>
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.
</UL>
<A NAME="Limitations"></A><H2>Limitations</H2>
<UL>
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, <I>'linear programming'</I> will first consult the index
to find all files containing both <I>linear</I> and <I>programming</I>,
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.
<P>
As was mentioned in the section on <A HREF="#Patterns">Patterns</A> 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).
<P>
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.
</UL>
<P>
<HR>
<ADDRESS>
<A HREF="mailto:lxr@linux.no">
Arne Georg Gleditsch and Per Kristian Gjermshus</A>
</ADDRESS>
</BODY>
</HTML>

Просмотреть файл

@ -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 <argggh@ifi.uio.no>
@ -282,6 +282,3 @@ if (!($Path->{'file'} =~ /\.(html)$/)) {
&makefooter('sourcedir');
}
}
#$len = length($file);
#print ("length is: ", $len) ;

Просмотреть файл

@ -12,6 +12,8 @@
<TR><TD><A HREF="http://www.mozilla.org/"><IMG
SRC="http://www.mozilla.org/images/mozilla-banner.gif" ALT=""
BORDER=0 WIDTH=600 HEIGHT=58></A></TD></TR></TABLE>
<H1><A HREF="$baseurl">Mozilla Cross Reference</A></H1>
<P>
<B><FONT SIZE=+2><A HREF="$baseurl">Mozilla Cross Reference</A>
</FONT></B>
<I>$treename</I>
<P>

Просмотреть файл

@ -18,7 +18,7 @@
<TD ALIGN=LEFT VALIGN=CENTER>
<NOBR><FONT SIZE="+2"><B>
<A HREF="$baseurl">Mozilla Cross Reference:</A>
</B></FONT></NOBR>
</B></FONT></NOBR><I>$treename</I>
<BR><B>$banner</B>
</TD>
@ -27,7 +27,7 @@
<TR>
<TD NOWRAP BGCOLOR="#FAFAFA">
<BR>
<A HREF="$dotdoturl/bonsai/cvslog.cgi?file=mozilla$pathname">Full Change Log</A>
<A HREF="http://cvs-mirror.mozilla.org/webtools/bonsai/cvslog.cgi?file=mozilla$pathname">Full Change Log</A>
<BR><BR>
</TD>
</TR>
@ -44,9 +44,9 @@
changes to<BR>this file in<BR>the last:
</TD>
<TD NOWRAP>
<A HREF="$dotdoturl/bonsai/cvsquery.cgi?branch=HEAD&file=mozilla$pathname&date=day">day</A><BR>
<A HREF="$dotdoturl/bonsai/cvsquery.cgi?branch=HEAD&file=mozilla$pathname&date=week">week</A><BR>
<A HREF="$dotdoturl/bonsai/cvsquery.cgi?branch=HEAD&file=mozilla$pathname&date=month">month</A><BR>
<A HREF="http://cvs-mirror.mozilla.org/webtools/bonsai/cvsquery.cgi?branch=HEAD&file=mozilla$pathname&date=day">day</A><BR>
<A HREF="http://cvs-mirror.mozilla.org/webtools/bonsai/cvsquery.cgi?branch=HEAD&file=mozilla$pathname&date=week">week</A><BR>
<A HREF="http://cvs-mirror.mozilla.org/webtools/bonsai/cvsquery.cgi?branch=HEAD&file=mozilla$pathname&date=month">month</A><BR>
</TD>
</TR>
</TABLE>

Просмотреть файл

@ -18,7 +18,7 @@
<TD ALIGN=LEFT VALIGN=CENTER>
<NOBR><FONT SIZE="+2"><B>
<A HREF="$baseurl">Mozilla Cross Reference:</A>
</B></FONT></NOBR>
</B></FONT></NOBR><I>$treename</I>
<BR><B>$banner</B>
</TD>
@ -32,9 +32,9 @@
changes to<BR>this directory<BR>in the last:
</TD>
<TD NOWRAP>
<A HREF="$dotdoturl/bonsai/cvsquery.cgi?branch=HEAD&file=mozilla$pathname&date=day">day</A><BR>
<A HREF="$dotdoturl/bonsai/cvsquery.cgi?branch=HEAD&file=mozilla$pathname&date=week">week</A><BR>
<A HREF="$dotdoturl/bonsai/cvsquery.cgi?branch=HEAD&file=mozilla$pathname&date=month">month</A><BR>
<A HREF="http://cvs-mirror.mozilla.org/webtools/bonsai/cvsquery.cgi?branch=HEAD&file=mozilla$pathname&date=day">day</A><BR>
<A HREF="http://cvs-mirror.mozilla.org/webtools/bonsai/cvsquery.cgi?branch=HEAD&file=mozilla$pathname&date=week">week</A><BR>
<A HREF="http://cvs-mirror.mozilla.org/webtools/bonsai/cvsquery.cgi?branch=HEAD&file=mozilla$pathname&date=month">month</A><BR>
</TD>
</TR>
</TABLE>

121
webtools/lxr/update-lxr.sh Executable file
Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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