File: mknmz-8

package info (click to toggle)
namazu2 2.0.21-22
  • links: PTS
  • area: main
  • in suites: buster
  • size: 7,032 kB
  • sloc: ansic: 14,161; perl: 10,789; sh: 9,355; lisp: 1,147; makefile: 914
file content (56 lines) | stat: -rwxr-xr-x 1,502 bytes parent folder | download | duplicates (8)
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
49
50
51
52
53
54
55
56
#! /bin/sh
#
# Test for mknmz's --html-split option with updating.
#
LOG=`pwd`/test-log
TARGET=$srcdir/data/html-split
echo '  *** starting ' $0 >>$LOG

if test ! -d idx10; then
    mkdir idx10
else
    rm -f idx10/NMZ.*
fi

TMPDATA=`pwd`/tmp-data
# Copy docments.
if test -d tmp-data; then
    rm -rf tmp-data
fi
cp -rp $TARGET tmp-data

# Index with --html-split option.
../scripts/mknmz --html-split -O idx10 $TMPDATA >> $LOG
test "$?" != "0" && exit 1  # error if not success
origdocnum=`../scripts/gtnmz idx10/NMZ.r`

# Update 1.html.
perl -i.bak -pe s/xyzzy// $TMPDATA/1.html
echo amarok >> $TMPDATA/1.html

# Update the index with --html-split option.
../scripts/mknmz --update=idx10 --check-filesize >> $LOG
test "$?" != "0" && exit 1  # error if not success
docnum=`../scripts/gtnmz idx10/NMZ.r`
test $docnum != $origdocnum && exit 1  # error if not equal

# Remove 2.html.
rm $TMPDATA/2.html

# Update the index with --html-split option.
../scripts/mknmz --update=idx10 --check-filesize >> $LOG
test "$?" != "0" && exit 1  # error if not success
docnum=`../scripts/gtnmz idx10/NMZ.r`
docnum2=`expr $docnum + $docnum`
test $docnum2 != $origdocnum && exit 1  # error if not equal

# Nothing changed.

# Update the index with --html-split option.
../scripts/mknmz --update=idx10 --check-filesize >> $LOG
test "$?" != "0" && exit 1  # error if not success
docnum=`../scripts/gtnmz idx10/NMZ.r`
docnum2=`expr $docnum + $docnum`
test $docnum2 != $origdocnum && exit 1  # error if not equal

exit 0