[svn-commits] tzafrir: linux/trunk r7702 - in /linux/trunk/build_tools: ./ kernel-cp

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Dec 16 12:58:49 CST 2009


Author: tzafrir
Date: Wed Dec 16 12:58:46 2009
New Revision: 7702

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=7702
Log:
kernel-cp: a local wrapper to the kernel's checkpatch script.

checkpatch.pl is a script intended to check style of code (normally:
before submitting kernel patches).

As using this script simplifies testing new code for coding style,
this commit officially closes issue #16191 .

Added:
    linux/trunk/build_tools/kernel-cp   (with props)
Modified:
    linux/trunk/build_tools/   (props changed)

Propchange: linux/trunk/build_tools/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Wed Dec 16 12:58:46 2009
@@ -1,3 +1,4 @@
 menuselect-deps
 make_firmware_object
 git_test.conf
+checkpatch.pl

Added: linux/trunk/build_tools/kernel-cp
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/build_tools/kernel-cp?view=auto&rev=7702
==============================================================================
--- linux/trunk/build_tools/kernel-cp (added)
+++ linux/trunk/build_tools/kernel-cp Wed Dec 16 12:58:46 2009
@@ -1,0 +1,48 @@
+#!/bin/sh
+
+# A simple wrapper to the kernel.org script checkpatch.pl
+
+# Usage:
+# 
+#   svn diff | ./build_tools/kernel-cp -
+#   ./build_tools/kernel-cp my.diff
+#   ./build_tools/kernel-cp --file drivers/dahdi/wctdm.c
+
+mydir=`dirname $0`
+
+check_patch_dir="$mydir/cp"
+rel_path="scripts/checkpatch.pl"
+check_patch="$mydir/checkpatch.pl"
+URL='http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob_plain;f=scripts/checkpatch.pl;hb=HEAD'
+
+# Required files in directories in the tree
+SUBDIRS="fs ipc lib arch init scripts drivers kernel Documentation include"
+
+set -e
+
+if [ "$1" = 'download' ]; then
+	if [ -x "$check_patch" ]; then
+		exit 0
+	fi
+	
+	wget -O "$check_patch" "$URL"
+	if [ `wc -c "$check_patch"` -lt 1000 ]; then
+		# already downloaded
+		# FIXME: redirection fails on downloading and you get a
+		# short HTML file as your "script".
+		echo >&2 "$0: Error: Download failed".
+		exit 1
+	fi
+	chmod +x "$check_patch"
+
+	exit 0
+fi
+
+if [ ! -x "$check_patch" ]; then
+	echo >&2 "Script $check_patch not found. Download it?"
+	echo >&2 ""
+	echo >&2 "  $0 download"
+	exit 1
+fi
+
+exec $check_patch --no-tree --no-signoff "$@"

Propchange: linux/trunk/build_tools/kernel-cp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: linux/trunk/build_tools/kernel-cp
------------------------------------------------------------------------------
    svn:executable = *

Propchange: linux/trunk/build_tools/kernel-cp
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: linux/trunk/build_tools/kernel-cp
------------------------------------------------------------------------------
    svn:mime-type = text/plain




More information about the svn-commits mailing list