~ubuntu-branches/ubuntu/feisty/dbskkd-cdb/feisty

« back to all changes in this revision

Viewing changes to debian/makeskkcdbdic

  • Committer: Bazaar Package Importer
  • Author(s): Takao KAWAMURA
  • Date: 2000-11-22 12:47:01 UTC
  • Revision ID: james.westby@ubuntu.com-20001122124701-ar0pruz9o72qfc1i
Tags: 1:1.01-10
* Source Package: Doesn't provide dbskk-cdb-dic.
* Updated Standars-Version: 3.2.1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
[[ $# == 0 ]] && echo "Usage: ${0##*/} SKK-JISYO [SKK-JISYO-CDB]" 1>&2 && exit 1
 
4
[[ ! -f $1 || ! -r $1 ]] && echo "${0##*/}: $1: can't read" 1>&2 && exit 2
 
5
[[ $# == 1 ]] && set $1 $1.cdb
 
6
dir=`dirname $2`
 
7
[[ ! -d $dir || ! -w $dir ]] && echo "${0##*/}: $dir: can't write" 1>&2 && exit 3
 
8
tmpf=`tempfile --directory=$dir`
 
9
trap "[[ -e $tmpf ]] && rm $tmpf; exit 4" INT TERM
 
10
awk '
 
11
    /^[^;]/ {
 
12
    s = substr($0, index($0, " ") + 1)
 
13
    print "+" length($1) "," length(s) ":" $1 "->" s
 
14
    }
 
15
    END {
 
16
        print ""
 
17
    }
 
18
' $1 | cdbmake $2 $tmpf
 
19
chmod 644 $2