check_GNU_style.sh: Check file presence
authorTom de Vries <tom@codesourcery.com>
Tue, 12 May 2015 16:23:11 +0000 (16:23 +0000)
committerTom de Vries <vries@gcc.gnu.org>
Tue, 12 May 2015 16:23:11 +0000 (16:23 +0000)
2015-05-12  Tom de Vries  <tom@codesourcery.com>

* check_GNU_style.sh: Check if files exists.

From-SVN: r223085

contrib/ChangeLog
contrib/check_GNU_style.sh

index 774e46f96f884ee77679bc55c2770d5194317d96..605950a1c484856c6eceb7b8a97709dee162939e 100644 (file)
@@ -1,3 +1,7 @@
+2015-05-12  Tom de Vries  <tom@codesourcery.com>
+
+       * check_GNU_style.sh: Check if files exists.
+
 2015-05-12  Tom de Vries  <tom@codesourcery.com>
 
        * check_GNU_style.sh: Don't use a filename prefix if we're only
index eeff48f8c4c3bdbf4560c0b4b82419011a87badd..2c4d9e24fe69da83925ded3f1cb8c9d0562f90a1 100755 (executable)
@@ -39,6 +39,13 @@ test $# -eq 0 && usage
 nfiles=$#
 files="$*"
 
+for f in $files; do
+    if [ "$f" != "-" ] && [ ! -f "$f" ]; then
+       echo "error: could not read file: $f"
+       exit 1
+    fi
+done
+
 inp=check_GNU_style.inp
 tmp=check_GNU_style.tmp