summaryrefslogtreecommitdiff
path: root/tools/patman/checkpatch.py
diff options
context:
space:
mode:
authorStefano Babic <[email protected]>2013-02-23 10:13:40 +0100
committerStefano Babic <[email protected]>2013-02-23 10:13:40 +0100
commit9cd9b34dc7f247fd0fce08ab688bf8197f1bfdbc (patch)
tree89561497322fff78d3d2e4a8e736f18ab4e0ddfb /tools/patman/checkpatch.py
parentbec0160e9f5adab1d451ded3a95b0114b14e1970 (diff)
parenta5627914daad144727655a72bd3c8a8958fbcdcf (diff)
Merge branch 'master' of git://git.denx.de/u-boot-arm
Diffstat (limited to 'tools/patman/checkpatch.py')
-rw-r--r--tools/patman/checkpatch.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/tools/patman/checkpatch.py b/tools/patman/checkpatch.py
index d831087d88b..d3a0477bbf1 100644
--- a/tools/patman/checkpatch.py
+++ b/tools/patman/checkpatch.py
@@ -23,13 +23,16 @@ import command
import gitutil
import os
import re
+import sys
import terminal
def FindCheckPatch():
+ top_level = gitutil.GetTopLevel()
try_list = [
os.getcwd(),
os.path.join(os.getcwd(), '..', '..'),
- os.path.join(gitutil.GetTopLevel(), 'tools'),
+ os.path.join(top_level, 'tools'),
+ os.path.join(top_level, 'scripts'),
'%s/bin' % os.getenv('HOME'),
]
# Look in current dir
@@ -45,8 +48,10 @@ def FindCheckPatch():
if os.path.isfile(fname):
return fname
path = os.path.dirname(path)
- print 'Could not find checkpatch.pl'
- return None
+
+ print >> sys.stderr, ('Cannot find checkpatch.pl - please put it in your ' +
+ '~/bin directory or use --no-check')
+ sys.exit(1)
def CheckPatch(fname, verbose=False):
"""Run checkpatch.pl on a file.
@@ -65,9 +70,6 @@ def CheckPatch(fname, verbose=False):
error_count, warning_count, lines = 0, 0, 0
problems = []
chk = FindCheckPatch()
- if not chk:
- raise OSError, ('Cannot find checkpatch.pl - please put it in your ' +
- '~/bin directory')
item = {}
stdout = command.Output(chk, '--no-tree', fname)
#pipe = subprocess.Popen(cmd, stdout=subprocess.PIPE)