[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC 01/20] depcomp: be more idiomatic in checking for zero exit statuse
From: |
Stefano Lattarini |
Subject: |
[RFC 01/20] depcomp: be more idiomatic in checking for zero exit statuses |
Date: |
Thu, 18 Oct 2012 22:40:35 +0200 |
* lib/depcomp: Prefer "if test $stat -ne 0; then ..." over the longer
"if test $stat -eq 0; then :; else ...".
Signed-off-by: Stefano Lattarini <address@hidden>
---
lib/depcomp | 26 +++++++++-----------------
1 file changed, 9 insertions(+), 17 deletions(-)
diff --git a/lib/depcomp b/lib/depcomp
index ee84bf2..db3090e 100755
--- a/lib/depcomp
+++ b/lib/depcomp
@@ -1,7 +1,7 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
-scriptversion=2012-07-12.20; # UTC
+scriptversion=2012-10-18.11; # UTC
# Copyright (C) 1999-2012 Free Software Foundation, Inc.
@@ -133,8 +133,7 @@ gcc3)
done
"$@"
stat=$?
- if test $stat -eq 0; then :
- else
+ if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
@@ -156,8 +155,7 @@ gcc)
fi
"$@" -Wp,"$gccflag$tmpdepfile"
stat=$?
- if test $stat -eq 0; then :
- else
+ if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
@@ -199,8 +197,7 @@ sgi)
"$@" -MDupdate "$tmpdepfile"
fi
stat=$?
- if test $stat -eq 0; then :
- else
+ if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
@@ -262,8 +259,7 @@ aix)
fi
stat=$?
- if test $stat -eq 0; then :
- else
+ if test $stat -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
@@ -310,8 +306,7 @@ icc)
# with horizontal tabulation characters.
"$@" -MD -MF "$tmpdepfile"
stat=$?
- if test $stat -eq 0; then :
- else
+ if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
@@ -427,8 +422,7 @@ hp2)
"$@" +Maked
fi
stat=$?
- if test $stat -eq 0; then :
- else
+ if test $stat -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2"
exit $stat
fi
@@ -490,8 +484,7 @@ tru64)
fi
stat=$?
- if test $stat -eq 0; then :
- else
+ if test $stat -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
exit $stat
fi
@@ -518,8 +511,7 @@ msvc7)
"$@" $showIncludes > "$tmpdepfile"
stat=$?
grep -v '^Note: including file: ' "$tmpdepfile"
- if test "$stat" = 0; then :
- else
+ if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
--
1.8.0.rc2.11.gd25c58c
- [RFC 00/20] Refactoring and modernizations in the depcomp script, Stefano Lattarini, 2012/10/18
- [RFC 01/20] depcomp: be more idiomatic in checking for zero exit statuses,
Stefano Lattarini <=
- [RFC 02/20] depcomp: remove useless quoting in variable definitions, Stefano Lattarini, 2012/10/18
- [RFC 03/20] depcomp: use "rmdir", not "rm -rf", to remove the empty lock directory, Stefano Lattarini, 2012/10/18
- [RFC 04/20] depcomp: correctly propagate exit status in exit trap, Stefano Lattarini, 2012/10/18
- [RFC 05/20] depcomp: safer quoting in variable expansion, Stefano Lattarini, 2012/10/18
- [RFC 06/20] depcomp: cosmetic fixlets to a comment, Stefano Lattarini, 2012/10/18
- [RFC 07/20] depcomp: don't rely on character ranges working as in C locale, Stefano Lattarini, 2012/10/18
- [RFC 08/20] depcomp: reduce code duplication, Stefano Lattarini, 2012/10/18
- [RFC 09/20] depcomp: avoid an extra fork when possible, Stefano Lattarini, 2012/10/18