Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/woip/sh/process
diff options
context:
space:
mode:
Diffstat (limited to 'woip/sh/process')
-rwxr-xr-xwoip/sh/process48
1 files changed, 48 insertions, 0 deletions
diff --git a/woip/sh/process b/woip/sh/process
new file mode 100755
index 0000000..9ca4476
--- /dev/null
+++ b/woip/sh/process
@@ -0,0 +1,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