From 582fc32574a3b158c81e49cb00e6ae59205e66ba Mon Sep 17 00:00:00 2001 From: Antonin Kral Date: Thu, 17 Mar 2011 00:05:43 +0100 Subject: Imported Upstream version 1.8.0 --- buildscripts/utils.py | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'buildscripts/utils.py') 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 ) -- cgit v1.2.3