~ubuntu-branches/ubuntu/dapper/lurker/dapper

« back to all changes in this revision

Viewing changes to index/lurker-regenerate

  • Committer: Bazaar Package Importer
  • Author(s): Jonas Meurer
  • Date: 2004-09-26 16:27:51 UTC
  • Revision ID: james.westby@ubuntu.com-20040926162751-z1ohcjltv7ojtg6z
Tags: upstream-1.2
ImportĀ upstreamĀ versionĀ 1.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh -e
 
2
# Expects: <lurker-index> <config file>
 
3
 
 
4
idx="$1"
 
5
cfg="$2"
 
6
 
 
7
if test -z "$idx" || test ! -x $idx; then echo Cannot execute indexer; exit 1; fi
 
8
if test -z "$cfg" || test ! -f $cfg; then echo Cannot read config; exit 1; fi
 
9
 
 
10
idx=`which $idx`
 
11
if echo "$idx" | grep -q '^\.'; then idx="$PWD/$idx"; fi
 
12
if echo "$cfg" | grep -q '^[^/~]'; then cfg="$PWD/$cfg"; fi
 
13
 
 
14
dbdir=`grep "[  ]*dbdir" $cfg | cut -d= -f2`
 
15
dbdir=`echo $dbdir`
 
16
 
 
17
cd $dbdir
 
18
 
 
19
test -d .tmp || mkdir .tmp
 
20
cd .tmp
 
21
mv -i ../* .
 
22
rm -f db.* db
 
23
 
 
24
for l in *; do
 
25
  echo Reindexing $l
 
26
  gzip -dfc < $l | $idx -c $cfg -l $l -v -b 5
 
27
done
 
28
 
 
29
cd ..
 
30
rm -rf .tmp