blob: f3313baa5c25f27218f80803dfe2442fe45be0ea (
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
|
#!/bin/zsh
file="../ga.wp.txt.bz2"
bz="../c/bzipreader -f $file"
pfile="../gawiki-latest-pages-articles.xml.bz2.processed"
pushd ../c; make clean; make; popd
function fail() {
echo "FAIL:" $* >/dev/stdout
exit -1
}
if ! (eval "$bz -x -n 1 2>/dev/null" | grep -q Daoine); then
fail decompression
fi
if ! (eval "$bz -x -b 0" | grep -q Esperanto); then
fail decompression with 0 offset
fi
last=`eval "$bz -l | tail -1 | awk '{print \\$2;}'"`
if ! (eval "$bz -x -b $last" | grep -q Nikon); then
fail decompression with $last offset
fi
mv $pfile ../ga.tmp
rm ../gawiki-*
mv ../ga.tmp $pfile
../sh/process `echo "$pfile" | sed -E 's/\.proc.+//'`
|