diff mbox

check: allow comments in exclude files

Message ID a860d00b5fdc3d88b0ce692585d0046e259c71c4.1470001873.git.osandov@fb.com (mailing list archive)
State New, archived
Headers show

Commit Message

Omar Sandoval July 31, 2016, 9:53 p.m. UTC
From: Omar Sandoval <osandov@fb.com>

Sometimes it's useful to keep track of why we're excluding a particular
test. Technically, we can include whatever explanation we want in the
exclude file since we just grep for the test names, but properly
supporting comments is a little more robust. This patch makes it so that
the rest of a line after a '#' is ignored.

Signed-off-by: Omar Sandoval <osandov@fb.com>
---
 check | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Dave Chinner Aug. 2, 2016, 11:20 p.m. UTC | #1
On Sun, Jul 31, 2016 at 02:53:44PM -0700, Omar Sandoval wrote:
> From: Omar Sandoval <osandov@fb.com>
> 
> Sometimes it's useful to keep track of why we're excluding a particular
> test. Technically, we can include whatever explanation we want in the
> exclude file since we just grep for the test names, but properly
> supporting comments is a little more robust. This patch makes it so that
> the rest of a line after a '#' is ignored.
> 
> Signed-off-by: Omar Sandoval <osandov@fb.com>

seems reasonable to me.

Reviewed-by: Dave Chinner <dchinner@redhat.com>
diff mbox

Patch

diff --git a/check b/check
index 9fbc305e9021..69341d8c4f72 100755
--- a/check
+++ b/check
@@ -224,14 +224,14 @@  while [ $# -gt 0 ]; do
 	-X)	xfile=$2; shift ;
 		for d in $SRC_GROUPS $FSTYP; do
 			[ -f $SRC_DIR/$d/$xfile ] || continue
-			for f in `cat $SRC_DIR/$d/$xfile`; do
+			for f in `sed "s/#.*$//" $SRC_DIR/$d/$xfile`; do
 				echo $d/$f >> $tmp.xlist
 			done
 		done
 		;;
 	-E)	xfile=$2; shift ;
 		if [ -f $xfile ]; then
-			cat "$xfile" >> $tmp.xlist
+			sed "s/#.*$//" "$xfile" >> $tmp.xlist
 	        fi
 		;;
 	-s)	RUN_SECTION="$RUN_SECTION $2"; shift ;;