File: update-anthy-dics

package info (click to toggle)
anthy 6300d-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 7,400 kB
  • ctags: 2,270
  • sloc: ansic: 17,009; sh: 13,554; lisp: 1,039; makefile: 252; ruby: 212; perl: 10
file content (38 lines) | stat: -rw-r--r-- 667 bytes parent folder | download
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
#!/bin/sh

DICDIR=/var/lib/anthy
METADICDIR=/usr/share/anthy/dic
CANNADIC='gcanna.ctd gcannaf.ctd'
EXTRADIC="$METADICDIR/*.t"
CONFIG='/etc/anthy/diclist'

OLDDIR=`pwd`
cd $METADICDIR

for file in $CANNADIC; do
	case $file in
	*.ctd)
		if test -f $file; then metadics="$metadics $file"; fi
		;;
	esac
done

addondics=$(sort -u $CONFIG| tr '\n' ' '| sed 's/\ $//')

for file in $addondics; do
	if test -f $file; then
		metadics="$metadics $file"
	fi
done

echo -n 'Updating anthy.dic...'

if test -f $DICDIR/anthy.dic; then
	rm -f $DICDIR/anthy.dic
fi

/usr/bin/mkanthydic -o $DICDIR/anthy.dic $metadics -uc $METADICDIR/udict > /dev/null 2>&1

cd $OLDDIR

echo 'done.'