diff options
author | Martin Langhoff <martin@laptop.org> | 2010-11-04 21:16:34 (GMT) |
---|---|---|
committer | Martin Langhoff <martin@laptop.org> | 2010-11-04 21:16:34 (GMT) |
commit | 34660b0c9ddc93d8d0466365a0f936f3441ca2d5 (patch) | |
tree | d12caefce6b1037465003875bcda18ddc408be62 /woip | |
parent | e7583a1a31441f13c6938ef98917dba74359093c (diff) |
Integrate mklocatedb
Diffstat (limited to 'woip')
-rwxr-xr-x | woip/sh/process-updates | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/woip/sh/process-updates b/woip/sh/process-updates index 57258c5..060128b 100755 --- a/woip/sh/process-updates +++ b/woip/sh/process-updates @@ -1,6 +1,7 @@ #!/bin/sh set -e +set -o pipefail if [ ! -n "$1" ]; then echo "process <file.processed>" @@ -13,19 +14,33 @@ fi basename=${file%.processed} ifile="$basename.index.txt" -echo "Creating index..." -pushd woip/rb -ruby ./index.rb $file > $ifile +if [ ! -e $ifile ]; then + echo "Creating index..." + pushd woip/rb + ruby ./index.rb $file > $ifile.tmp + mv $ifile.tmp $ifile + popd +fi sfile="$basename.locate.db" -echo "Creating locate index..." -cat $ifile | LC_ALL=C /usr/libexec/locate.mklocatedb > $sfile +if [ ! -e $sfile ]; then + echo "Creating locate index..." + PATH=$PATH:./locate.freebsd/bigram/:./locate.freebsd/code + cat $ifile | LC_ALL=C ./locate.freebsd/locate/mklocatedb.sh > $sfile.tmp + mv $sfile.tmp $sfile +fi spfile="$basename.locate.prefixdb" -echo "Creating locate prefix index..." -../c/lsearcher -f $sfile -c $spfile -n +if [ ! -e $spfile ]; then + echo "Creating locate prefix index..." + woip/c/lsearcher -f $sfile -c $spfile.tmp -n + mv $spfile.tmp $spfile +fi bfile="$basename.blocks.db" -echo "Creating block index" -../c/bzipreader -f $ofile -l | awk '{print $2;}' | ../c/blocks $bfile +if [ ! -e $bfile ]; then + echo "Creating block index" + woip/c/bzipreader -f $file -l | awk '{print $2;}' | woip/c/blocks $bfile.tmp + mv $bfile.tmp $bfile +fi |