#! /bin/sh

for CTRLFILE in */CONTROL/control; do
    [ "$CTRLFILE" = '*/CONTROL/control' ] || \
	    egrep -q '^Architecture:\W+(all|any)\W*$' $CTRLFILE || \
	    sed -i -e 's/^Architecture:.*$/Architecture: __ARCH__/' $CTRLFILE
done

find . -type l -print | xargs -i{} sh -c "rm -f {}"
xargs -i{} sh -c 'rm -f {}' < MANIFEST
