DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Untracked file

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136
#!/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=:pserver:anonymous@cvs-mirror.mozilla.org:/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
    ;;
'gnome')
    CVSROOT=:pserver:anonymous@cvs-mirror.mozilla.org:/cvs/gnome
    export CVSROOT
    time cvs -Q -d $CVSROOT checkout -P gnome
    ;;
esac

date
uptime

if [ -f $db_dir/update.log ]
  then
  ERROR=`grep "server aborted" $db_dir/update.log | grep -v grep`
  if [ "$ERROR"  != "" ]
    then
    echo $ERROR | /usr/ucb/Mail -s "lxr: $1 aborted" root
    exit
    fi
  fi


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