#!/bin/sh
set -e

. optvars

for PACKAGE in `ls $KUMATUXOPT/ | grep tegaki-wagomu_`
do
    if [ `echo $PACKAGE | sed 's/_.*//' | sed 's/\(tegaki-wagomu\)_.*/\1/'` = tegaki-wagomu ]
    then
	for FILE in `ls $KUMATUXOPT/$PACKAGE/share/tegaki/engines/`
	do
    	    $KUMATUXCHECK/delete.sh /usr/share/tegaki/engines/$FILE $KUMATUXOPT/$PACKAGE/share/tegaki/engines/$FILE
	done
    fi
done
