blob: 9ca4476ddb51bfae49e8b50e757dc1d1b006219a (
plain)
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
|
#!/bin/zsh
if [ ! -n "$1" ]; then
echo "process <file>"
exit -1
else
file=$1
fi
ofile="$file.processed"
if [ ! -f $ofile ]; then
echo "Creating processed version of $file..."
bzcat $file | ruby ../rb/xmlprocess.rb | bzip2 > $ofile
else
echo "$ofile already exists"
fi
ifile="$file.index.txt"
if [ ! -f $ifile ]; then
echo "Creating index..."
ruby ../rb/index.rb $ofile > $ifile
else
echo "$ifile already exists"
fi
sfile="$file.locate.db"
if [ ! -f $sfile ]; then
echo "Creating locate index..."
cat $ifile | LC_ALL=C /usr/libexec/locate.mklocatedb > $sfile
else
echo "$sfile already exists"
fi
spfile="$file.locate.prefixdb"
if [ ! -f $spfile ]; then
echo "Creating locate prefix index..."
../c/lsearcher -f $sfile -c $spfile -n
else
echo "$spfile already exists"
fi
bfile="$file.blocks.db"
if [ ! -f $bfile ]; then
echo "Creating block index"
../c/bzipreader -f $ofile -l | awk '{print $2;}' | ../c/blocks $bfile
else
echo "$bfile already exists"
fi
|