#! /bin/sh
set -e

INNARDS=installed.files

cp /usr/doc/metro-motif-demosrc/${INNARDS}* /tmp/

if [ -f /tmp/${INNARDS}.gz ]
then
    gunzip /tmp/${INNARDS}.gz
else
    if [ -f /tmp/${INNARDS}.Z ]
    then
        uncompress /tmp/${INNARDS}.Z
    fi
fi

if [ -f /tmp/installed.files ]
then
    (cat /tmp/installed.files; echo) | # make sure there is a LF at the end
    while read fname
    do
        if [ -f /usr/src/$fname ]
        then
           rm -f /usr/src/$fname
        fi
    done
else
    echo can't find /tmp/installed.files, can't remove files.
    echo the file /usr/doc/installed.files may be deleted.
    echo you may need to reinstall the package before removing the package. 
fi

ldconfig

