diff options
author | Antonin Kral <a.kral@bobek.cz> | 2011-03-17 00:07:52 +0100 |
---|---|---|
committer | Antonin Kral <a.kral@bobek.cz> | 2011-03-17 00:07:52 +0100 |
commit | 98b8b639326ab4c89eed73739d9903993c4c8959 (patch) | |
tree | 0462df078bf740093774d033b75f0ea24a31fa97 /buildscripts/utils.py | |
parent | f5d6e97ca8d2f3e7c4cdd5c9afbf8e756ef65bc2 (diff) | |
parent | 582fc32574a3b158c81e49cb00e6ae59205e66ba (diff) | |
download | mongodb-98b8b639326ab4c89eed73739d9903993c4c8959.tar.gz |
Merge commit 'upstream/1.8.0
Diffstat (limited to 'buildscripts/utils.py')
-rw-r--r-- | buildscripts/utils.py | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/buildscripts/utils.py b/buildscripts/utils.py index 1ca2fdd..8021d87 100644 --- a/buildscripts/utils.py +++ b/buildscripts/utils.py @@ -5,10 +5,27 @@ 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 - + version = open( ".git/HEAD" ,'r' ).read().strip() if not version.startswith( "ref: " ): return version @@ -45,7 +62,6 @@ def getGitVersion(): return version return open( f , 'r' ).read().strip() - def execsys( args ): import subprocess if isinstance( args , str ): @@ -65,7 +81,6 @@ def getprocesslist(): r = re.compile( "[\r\n]+" ) return r.split( raw ) - def removeIfInList( lst , thing ): if thing in lst: lst.remove( thing ) |