#!/bin/sh
set -e

. optvars

FIRSTDEL=1
for DIR in $KUMATUXETCDIRSNOTHIRD
do
    for FILE in `ls $KUMATUXETC/$DIR/`
    do
	if [ $FIRSTDEL = 1 ]
	then
	    $KUMATUXMESSAGE "Deleting \`$KUMATUXETCDIRSNOTHIRD' in $KUMATUXETC/..."    
	    FIRSTDEL=0
	fi
	rm -v $KUMATUXETC/$DIR/$FILE
    done
done
if [ $FIRSTDEL = 0 ]
then
    $KUMATUXMESSAGE "\`$KUMATUXETCDIRSNOTHIRD' in $KUMATUXETC/ deleted."
fi

FIRSTDEL=1

for DIR in $KUMATUXPYTHONVERSIONS
do
    for FILE in `ls $KUMATUXETC/$KUMATUXETCPYTHON/$DIR/`
    do
	if [ $FIRSTDEL = 1 ]
	then
	    $KUMATUXMESSAGE "Deleting \`$KUMATUXPYTHONVERSIONS' in $KUMATUXETC/$KUMATUXETCPYTHON/..."
	    FIRSTDEL=0
	fi
	rm -v $KUMATUXETC/$KUMATUXETCPYTHON/$DIR/$FILE
    done
done
if [ $FIRSTDEL = 0 ]
then
    $KUMATUXMESSAGE "\`$KUMATUXPYTHONVERSIONS' in $KUMATUXETC/$KUMATUXETCPYTHON/ deleted."
fi
