[RFC/PATCH] dontdiff: generate from gitignore

From: Randy Dunlap
Date: Fri Sep 12 2008 - 13:20:12 EST


From: Randy Dunlap <randy.dunlap@xxxxxxxxxx>

Generate the "dontdiff" file from the .gitignore files.
Save it in scripts/dontdiff.

Signed-off-by: Randy Dunlap <randy.dunlap@xxxxxxxxxx>
---
Makefile | 10 +++++++++-
scripts/.gitignore | 1 +
scripts/mkdontdiff | 23 +++++++++++++++++++++++
3 files changed, 33 insertions(+), 1 deletion(-)

--- linux-2.6.27-rc6-git2.orig/Makefile
+++ linux-2.6.27-rc6-git2/Makefile
@@ -398,7 +398,7 @@ endif
no-dot-config-targets := clean mrproper distclean \
cscope TAGS tags help %docs check% \
include/linux/version.h headers_% \
- kernelrelease kernelversion
+ kernelrelease kernelversion dontdiff

config-targets := 0
mixed-targets := 0
@@ -1251,6 +1251,7 @@ help:
@echo ' dir/ - Build all files in dir and below'
@echo ' dir/file.[ois] - Build specified target only'
@echo ' dir/file.ko - Build module including final link'
+ @echo ' dontdiff - Create a "dontdiff" file'
@echo ' prepare - Set up for building external modules'
@echo ' tags/TAGS - Generate tags file for editors'
@echo ' cscope - Generate cscope index'
@@ -1519,6 +1520,13 @@ endef
tags: FORCE
$(call cmd,tags)

+quiet_cmd_dontdiff = MAKE dontdiff
+ cmd_dontdiff = $(shell $(CONFIG_SHELL) \
+ $(srctree)/scripts/mkdontdiff $(srctree))
+
+dontdiff: FORCE
+ $(call cmd,dontdiff)
+

# Scripts to check various things for consistency
# ---------------------------------------------------------------------------
--- /dev/null
+++ linux-2.6.27-rc6-git2/scripts/mkdontdiff
@@ -0,0 +1,23 @@
+#! /bin/sh
+set -f
+
+TMPFILE=`mktemp ./.tmpdd.XXXXXX`
+srctree=$1
+DDFILE=$srctree/scripts/dontdiff
+
+find . -name .gitignore | xargs cat | grep -v '^[#!]' | grep -v '^[:space:]*$' | sort | uniq > $TMPFILE
+
+rm -f $DDFILE
+touch $DDFILE
+
+while read PATTERN ; do
+ if echo "$PATTERN" | grep -q '/' ; then
+ filename=`basename $PATTERN`
+ else
+ filename="$PATTERN"
+ fi
+
+ echo $filename >> $DDFILE
+done < $TMPFILE
+
+rm $TMPFILE
--- linux-2.6.27-rc6-git2.orig/scripts/.gitignore
+++ linux-2.6.27-rc6-git2/scripts/.gitignore
@@ -2,6 +2,7 @@
# Generated files
#
conmakehash
+dontdiff
kallsyms
pnmtologo
bin2c

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/