#!/bin/sh

set -e

if [ $# -gt 0 ]; then
	echo >&2 "$(basename $0): unexpected arguments"
	exit 1
fi

find $(dirname $0) /usr/*/gcc -maxdepth 30 -name \*-real | while read tool_real; do
	tool=$(echo "$tool_real" | sed -e 's/-real$//')
	mv $tool_real $tool
done
if [ -d /emul ]; then
	find /emul -maxdepth 30 -name \*-real | while read tool_real; do
		rm $tool_real
	done
fi
