This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH, contrib: improve dg-cmp-results.sh


A problem between keyboard and chair uncovered an annoyance with
dg-cmp-results.sh.  If either .sum file can't be opened, the script
prints the usage, rather than explain what the real problem is.

Okay for the trunk?

Cheers, Ben

2008-11-18  Ben Elliston  <bje@au.ibm.com>

        * dg-cmp-results.sh: Do not print usage if either .sum file cannot
        be opened; print a more meaningful error instead.

Index: dg-cmp-results.sh
===================================================================
--- dg-cmp-results.sh   (revision 141955)
+++ dg-cmp-results.sh   (working copy)
@@ -27,11 +27,21 @@ while test "$1" = "-v"; do
     shift
 done
 
-if test $# -ne 3 -o ! -f "$2" -o ! -f "$3"; then
+if test $# -ne 3 ; then
     usage
     exit 1
 fi
 
+if test ! -f "$2"; then
+    echo "unable to open $2" >&2
+    exit 1
+fi
+
+if test ! -f "$3"; then
+    echo "unable to open $3" >&2
+    exit 1
+fi
+
 # Command differences for various platforms.
 case `uname -s` in
 Darwin|NetBSD)



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]