[PATCH] include cardlist auto-fixes into commit message

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This changes the cardlist script to produce a diff, like the whitespace script
does.

This way changes by the cardlist script will appear in the commit message
comments.

It also means that make cardlist will tell you, via patch, what files actually
got changed.
# HG changeset patch
# User Trent Piepho <xyzzy@xxxxxxxxxxxxx>
# Node ID 6c8288368037a4e00b24a9fe909d5b784f2a2131
# Parent  161bf97fdc5c36ded9705cdc389f659012217ef8
Make cardlist script produce a diff, rather than changing files

From: Trent Piepho <xyzzy@xxxxxxxxxxxxx>

The cardlist script will produce a diff on stdout that will update the
cardlists, the same way the whitespace script works.  The make commit
code is adjusted so that it will include the any changes made by the
cardlist script into the commit message along with any whitespace
changes.  The make cardlist target is also updated to work with the new
script, with the side effect that patch will tell you what, if any, files
were actually changed.

Signed-off-by: Trent Piepho <xyzzy@xxxxxxxxxxxxx>

diff -r 161bf97fdc5c -r 6c8288368037 Makefile
--- a/Makefile	Fri Jun 23 18:41:45 2006 -0700
+++ b/Makefile	Fri Jun 23 18:51:02 2006 -0700
@@ -26,7 +26,7 @@ install:
 	$(MAKE) -C $(BUILD_DIR) $(MAKECMDGOALS)
 
 commit cvscommit hgcommit change changes changelog:: whitespace
-	cd $(BUILD_DIR); scripts/cardlist; cd ..
+	v4l/scripts/cardlist | tee -a $(TMP)/v4l_hg_whitespace | patch -p0
 	v4l/scripts/prep_commit_msg.pl $(TMP)/v4l_hg_whitespace > \
 		$(TMP)/v4l_hg_commit.msg
 	$(EDITOR) $(TMP)/v4l_hg_commit.msg
diff -r 161bf97fdc5c -r 6c8288368037 v4l/Makefile
--- a/v4l/Makefile	Fri Jun 23 18:41:45 2006 -0700
+++ b/v4l/Makefile	Fri Jun 23 18:51:02 2006 -0700
@@ -208,7 +208,7 @@ kernel-links makelinks::
 # Cardlist updating rule
 
 card cardlist cardlists::
-	scripts/cardlist
+	cd .. ; v4l/scripts/cardlist | patch -p0
 
 #################################################
 # Cleaning rules
diff -r 161bf97fdc5c -r 6c8288368037 v4l/scripts/cardlist
--- a/v4l/scripts/cardlist	Fri Jun 23 18:41:45 2006 -0700
+++ b/v4l/scripts/cardlist	Fri Jun 23 18:51:02 2006 -0700
@@ -1,17 +1,14 @@
 #!/bin/sh
 
-scripts/bttv.pl ../linux/drivers/media/video/bt8xx/bttv.h  ../linux/drivers/media/video/bt8xx/bttv-cards.c \
-	| perl -ne 's/[ \t]+$//; print' > ../linux/Documentation/video4linux/CARDLIST.bttv
+update_list() {
+	out="linux/Documentation/video4linux/$4"
+	v4l/scripts/$1 linux/drivers/media/$2 linux/drivers/media/$3 | \
+		perl -pe 's/[ \t]+$//;' | \
+		diff -u --label="$out" --label="$out" $out -
+}
 
-scripts/cx88.pl ../linux/drivers/media/video/cx88/cx88.h ../linux/drivers/media/video/cx88/cx88-cards.c \
-	| perl -ne 's/[ \t]+$//; print' > ../linux/Documentation/video4linux/CARDLIST.cx88
-
-scripts/em28xx.pl ../linux/drivers/media/video/em28xx/em28xx.h ../linux/drivers/media/video/em28xx/em28xx-cards.c \
-	| perl -ne 's/[ \t]+$//; print' > ../linux/Documentation/video4linux/CARDLIST.em28xx
-
-scripts/tuner.pl ../linux/include/media/tuner.h ../linux/drivers/media/video/tuner-types.c \
-	| perl -ne 's/[ \t]+$//; print' > ../linux/Documentation/video4linux/CARDLIST.tuner
-
-scripts/saa7134.pl ../linux/drivers/media/video/saa7134/saa7134.h ../linux/drivers/media/video/saa7134/saa7134-cards.c \
-	| perl -ne 's/[ \t]+$//; print' > ../linux/Documentation/video4linux/CARDLIST.saa7134
-
+update_list bttv.pl video/bt8xx/bttv.h video/bt8xx/bttv-cards.c CARDLIST.bttv
+update_list cx88.pl video/cx88/cx88.h video/cx88/cx88-cards.c CARDLIST.cx88
+update_list em28xx.pl video/em28xx/em28xx.h video/em28xx/em28xx-cards.c CARDLIST.em28xx
+update_list tuner.pl ../../include/media/tuner.h video/tuner-types.c CARDLIST.tuner
+update_list saa7134.pl video/saa7134/saa7134.h video/saa7134/saa7134-cards.c CARDLIST.saa7134
_______________________________________________

linux-dvb@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux