aboutsummaryrefslogtreecommitdiff
path: root/contrib/compare-debug
diff options
context:
space:
mode:
authoraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>2007-10-01 20:27:22 +0000
committeraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>2007-10-01 20:27:22 +0000
commit800c7017973bde64af30dc7bf500f11281cd035f (patch)
tree2dec807c5f78b44e065b0a9adc33c4463efc88f7 /contrib/compare-debug
parent25710991e69a2bbaaee09a0589e694ee92882449 (diff)
* compare-debug: Avoid spurious errors when .stripped files
exist. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@128911 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'contrib/compare-debug')
-rwxr-xr-xcontrib/compare-debug30
1 files changed, 15 insertions, 15 deletions
diff --git a/contrib/compare-debug b/contrib/compare-debug
index c583a59c520..f1500b60788 100755
--- a/contrib/compare-debug
+++ b/contrib/compare-debug
@@ -36,31 +36,31 @@ if test ! -f "$2"; then
exit 1
fi
-if test -f "$1".stripped; then
- echo "$1".stripped already exists, overwriting >&2
- exit 1
-fi
+suf1=stripped
+while test -f "$1.$suf1"; do
+ suf1=$suf1.
+done
-if test -f "$2".stripped; then
- echo "$2".stripped already exists, overwriting >&2
- exit 1
-fi
+suf2=stripped
+while test -f "$2.$suf2"; do
+ suf2=$suf2.
+done
-trap 'rm -f "$1".stripped "$2".stripped' 0 1 2 15
+trap 'rm -f "$1.$suf1" "$2.$suf2"' 0 1 2 15
-cp "$1" "$1".stripped
-strip "$1".stripped
+cp "$1" "$1.$suf1"
+strip "$1.$suf1"
-cp "$2" "$2".stripped
-strip "$2".stripped
+cp "$2" "$2.$suf2"
+strip "$2.$suf2"
-if cmp "$1".stripped "$2".stripped; then
+if cmp "$1.$suf1" "$2.$suf2"; then
status=0
else
status=1
fi
-rm -f "$1".stripped "$2".stripped
+rm -f "$1.$suf1" "$2.$suf2"
trap "exit $status; exit" 0 1 2 15