From c6aa0c4241ab80bc6e8339c516b7ce85277d4fb0 Mon Sep 17 00:00:00 2001
From: Michael Hanselmann <hansmi@google.com>
Date: Tue, 27 Oct 2009 15:24:46 +0100
Subject: [PATCH] Makefile.am: Add more checks to distcheck-hook

Also use grep only to convert find's output to an exit status.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
---
 Makefile.am | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 1ceaa412d..cbfa69c1c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -451,8 +451,16 @@ check-local:
 
 # a dist hook rule for catching revision control directories
 distcheck-hook:
-	if find $(top_distdir) | grep -F -e '.svn' -e '.git'; then \
-		echo "Found revision control files in final archive" 1>&2 ; \
+	if find $(top_distdir) -name .svn -or -name .git | grep .; then \
+		echo "Found revision control files in final archive." 1>&2; \
+		exit 1; \
+	fi
+	if find $(top_distdir) -name '*.py[co]' | grep .; then \
+		echo "Found Python byte code in final archive." 1>&2; \
+		exit 1; \
+	fi
+	if find $(top_distdir) -name '*~' | grep .; then \
+		echo "Found backup files in final archive." 1>&2; \
 		exit 1; \
 	fi
 
-- 
GitLab