diff options
author | Eliot Horowitz <eliot@10gen.com> | 2010-09-03 11:58:53 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2010-09-03 11:58:53 -0400 |
commit | cbc4f28938fec3348c2a009b763587590d513198 (patch) | |
tree | de9bbcdac2f593dd988afc524cd68dcb06bf5b63 /buildscripts | |
parent | 25eb3f0c37cfc4e736bc47b25c47d4b22c6a7175 (diff) | |
download | mongo-cbc4f28938fec3348c2a009b763587590d513198.tar.gz |
some cleaning
Diffstat (limited to 'buildscripts')
-rwxr-xr-x | buildscripts/errorcodes.py | 19 | ||||
-rw-r--r-- | buildscripts/utils.py | 17 |
2 files changed, 19 insertions, 17 deletions
diff --git a/buildscripts/errorcodes.py b/buildscripts/errorcodes.py index d87b7adc520..6b14d0ec73d 100755 --- a/buildscripts/errorcodes.py +++ b/buildscripts/errorcodes.py @@ -5,28 +5,13 @@ import sys import re import utils -def getAllSourceFiles( arr=None , prefix="." ): - if arr is None: - arr = [] - - for x in os.listdir( prefix ): - if x.startswith( "." ) or x.startswith( "pcre-" ) or x.startswith( "32bit" ) or x.startswith( "mongodb-" ) or x.startswith("debian") or x.startswith( "mongo-cxx-driver" ): - continue - full = prefix + "/" + x - if os.path.isdir( full ) and not os.path.islink( full ): - getAllSourceFiles( arr , full ) - else: - if full.endswith( ".cpp" ) or full.endswith( ".h" ) or full.endswith( ".c" ): - arr.append( full ) - - return arr assertNames = [ "uassert" , "massert" ] def assignErrorCodes(): cur = 10000 for root in assertNames: - for x in getAllSourceFiles(): + for x in utils.getAllSourceFiles(): print( x ) didAnything = False fixed = "" @@ -50,7 +35,7 @@ def readErrorCodes( callback ): ps = [ re.compile( "([um]asser(t|ted)) *\( *(\d+)" ) , re.compile( "(User|Msg)Exceptio(n)\( *(\d+)" ) ] - for x in getAllSourceFiles(): + for x in utils.getAllSourceFiles(): lineNum = 1 for line in open( x ): for p in ps: diff --git a/buildscripts/utils.py b/buildscripts/utils.py index 640ac5dd986..8021d8779da 100644 --- a/buildscripts/utils.py +++ b/buildscripts/utils.py @@ -5,6 +5,23 @@ import time import os # various utilities that are handy +def getAllSourceFiles( arr=None , prefix="." ): + if arr is None: + arr = [] + + for x in os.listdir( prefix ): + if x.startswith( "." ) or x.startswith( "pcre-" ) or x.startswith( "32bit" ) or x.startswith( "mongodb-" ) or x.startswith("debian") or x.startswith( "mongo-cxx-driver" ): + continue + full = prefix + "/" + x + if os.path.isdir( full ) and not os.path.islink( full ): + getAllSourceFiles( arr , full ) + else: + if full.endswith( ".cpp" ) or full.endswith( ".h" ) or full.endswith( ".c" ): + arr.append( full ) + + return arr + + def getGitBranch(): if not os.path.exists( ".git" ): return None |