exit 1
fi
-if [ $(find $(dirname $0) -name \*-real | wc -l) -gt 0 ]; then
+find --help > /dev/null || (echo >&2 "find utility malfunction, please check your environment" && exit 1)
+
+if [ $(find $(dirname $0) -maxdepth 30 -name \*-real | wc -l) -gt 0 ]; then
echo >&2 "$(basename $0): directory was already processed, aborting"
exit 1
fi
# Match gcc|g++|c++ with optional cross- preffix and -version ([0-9] and .) # suffix
GCC_REG='\b(gcc|g\+\+|c\+\+)([-\d\.]?)+'
-find -L $(dirname $0) -type f -a -perm -a=x | grep -E "($GCC_REG)$" | while read tool; do
+find -L $(dirname $0) -maxdepth 30 -type f -a -perm -a=x | grep -E "($GCC_REG)$" | while read tool; do
mv $tool $tool-real
cp $TMP $tool
done
GCC_REG_EXTRA='collect2'
-find -L GCC_LIBSUBDIR -type f -a -perm -a=x -name "$GCC_REG_EXTRA" | while read tool; do
+find -L GCC_LIBSUBDIR -maxdepth 30 -type f -a -perm -a=x -name "$GCC_REG_EXTRA" | while read tool; do
mv $tool $tool-real
cp $LD_TMP $tool
done
if [ -d /emul ]; then
- find -L /emul -type f -a -perm -a=x | grep -E "($GCC_REG|$GCC_REG_EXTRA)$" | while read tool; do
+ find -L /emul -maxdepth 30 -type f -a -perm -a=x | grep -E "($GCC_REG|$GCC_REG_EXTRA)$" | while read tool; do
ln -sf $(basename $tool) $tool-real
done
fi
rm $TMP
rm $LD_TMP
-
exit 1
fi
-find $(dirname $0) /usr/*/gcc -name \*-real | while read tool_real; do
+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 -name \*-real | while read tool_real; do
+ find /emul -maxdepth 30 -name \*-real | while read tool_real; do
rm $tool_real
done
fi
-