diff mbox

[2/5] check_GNU_style.sh: Check file presence

Message ID 5551AB89.6010601@mentor.com
State New
Headers show

Commit Message

Tom de Vries May 12, 2015, 7:28 a.m. UTC
Hi,

this patch checks that the files specified on the check_GNU_style.sh command 
line are present.

OK for trunk?

Thanks,
- Tom

Comments

Jeff Law May 12, 2015, 3:01 p.m. UTC | #1
On 05/12/2015 01:28 AM, Tom de Vries wrote:
> Hi,
>
> this patch checks that the files specified on the check_GNU_style.sh
> command line are present.
>
> OK for trunk?
>
> Thanks,
> - Tom
>
>
> 0002-check_GNU_style.sh-Check-file-presence.patch
>
>
> [PATCH 2/5] check_GNU_style.sh: Check file presence
>
> 2015-05-11  Tom de Vries<tom@codesourcery.com>
>
> 	* check_GNU_style.sh: Check if files exists.
OK.
jeff
diff mbox

Patch

[PATCH 2/5] check_GNU_style.sh: Check file presence

2015-05-11  Tom de Vries  <tom@codesourcery.com>

	* check_GNU_style.sh: Check if files exists.
---
 contrib/check_GNU_style.sh | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/contrib/check_GNU_style.sh b/contrib/check_GNU_style.sh
index eeff48f..2c4d9e2 100755
--- a/contrib/check_GNU_style.sh
+++ b/contrib/check_GNU_style.sh
@@ -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
 
-- 
1.9.1