X-Git-Url: http://git.chise.org/gitweb/?p=m17n%2Fm17n-docs.git;a=blobdiff_plain;f=utils%2Fdbdata.sh;h=2978cf9e6a0eb530da74529f9d7fd8807b85b4ad;hp=0bea10b6f5333aa18ed2e10c3f75933a3c8ad037;hb=f1f28b8d79c8062b656f5f17dc081eda6eec5270;hpb=26da46c8e150370680a7c07f24d8142f514bdac1 diff --git a/utils/dbdata.sh b/utils/dbdata.sh index 0bea10b..2978cf9 100755 --- a/utils/dbdata.sh +++ b/utils/dbdata.sh @@ -7,37 +7,44 @@ FILE=$1 while shift 1; do IM=`grep '^(input-method' $FILE` if test -n "$IM"; then - if false; then - sed -n -e '/^(input-method/s/(input-method \([^ ]*\) \([^ )]*\)\( \([^)]*\)\)*)/\1 \2 \4/p' $FILE | (read LANG NAME EXTRA + if grep -q '^;;;' $FILE; then + sed -n -e '/^(input-method/s/(input-method \([^ ]*\) \([^ )]*\)\( \([^)]*\)\)*)/\1 \2 \4/p' $FILE | (read LNG NAME EXTRA if test -z "NAME"; then NAME=$EXTRA fi - if test "$LANG" = "t"; then - LANG=generic + if test "$LNG" = "t"; then + LNG=generic fi if test "$NAME" = "nil"; then - echo "
  • $FILE (extra-name:$EXTRA, only for inclusion)" + HEADER="
  • $FILE (extra-name:$EXTRA, only for inclusion)" + HEADER2="" else - base=`basename $FILE` + title=`sed -n -e '/^(title/s/(title \("[^"]*"\).*$/\1/p' $FILE` + file=`basename $FILE` + base=`basename $file .mim` dir=`dirname $FILE` - icon="$dir/icons/$base" + dir=`dirname $dir` + icon="$dir/icons/$base.png" if [ -f "$icon" ] ; then - [ -f "images/icon-$base" ] || cp "$icon" "images/icon-$base" + [ -f "images/icon-$base.png" ] || cp "$icon" "images/icon-$base.png" fi - echo "
  • $FILE (language:$LANG name:$NAME @htmlonly" - echo "" - echo "@endhtmlonly" - echo ")" - fi) - if grep -q '^;;;' $FILE; then + HEADER="
  • $base (language:$LNG name:$NAME @htmlonly" + if test -n "$title"; then + HEADER="$HEADER title:$title" + fi + HEADER2="" + HEADER3="@endhtmlonly" + HEADER4=")" + fi + echo "$HEADER" + if test -n "$HEADER2"; then + echo "$HEADER2"; echo "$HEADER3"; echo "$HEADER4" + fi echo - sed -n -e '/^;;;/ p' $FILE | sed -e '/^[^;]/ s/$/
    /' -e '/^;;;/ s/^;;; *//' | sed -e 's,^||,,' -e 's,||$,,' -e 's,|,,g' + sed -n -e '/^;;;/ p' $FILE | sed -e '/^[^;]/ s/$/
    /' -e '/^;;;/ s/^;;; *//' | sed -e 's,^||,,' -e 's,||$,,' -e 's,|,,g') else M17NDIR=/usr/share/m17n $IMDOC $FILE "$IM" fi - else - M17NDIR=/usr/share/m17n $IMDOC $FILE - fi else echo sed -n -e '/^;;;/ p' $FILE | sed -e '/^[^;]/ s/$/
    /' -e '/^;;;/ s/^;;; *//'