summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Crosta <dcrosta@late.am>2012-01-20 15:59:21 -0800
committerDan Crosta <dcrosta@late.am>2012-01-20 15:59:21 -0800
commitc3449caf1a69c0954647a6a421764e3ad59cccbe (patch)
tree94a577f83e5a318cbd19e62a2eef015f63d8f72e
parentc91aa2519e94083fde79177803d15b7717a59707 (diff)
downloadmongo-c3449caf1a69c0954647a6a421764e3ad59cccbe.tar.gz
SERVER-4591: python-2.4 compatible version of rpartition
-rw-r--r--SConstruct17
1 files changed, 14 insertions, 3 deletions
diff --git a/SConstruct b/SConstruct
index 4f2aa3fe998..c6c8ef3be6f 100644
--- a/SConstruct
+++ b/SConstruct
@@ -25,6 +25,17 @@ import buildscripts.bb
import stat
from buildscripts import utils
+
+def _rpartition(string, sep):
+ """A replacement for str.rpartition which is missing in Python < 2.5
+ """
+ idx = string.rfind(sep)
+ if idx == -1:
+ return '', '', string
+ return string[:idx], sep, string[idx + 1:]
+
+
+
buildscripts.bb.checkOk()
def findSettingsSetup():
@@ -38,7 +49,7 @@ def getThirdPartyShortNames():
if not x.endswith( ".py" ) or x.find( "#" ) >= 0:
continue
- lst.append( x.rpartition( "." )[0] )
+ lst.append( _rpartition( x, "." )[0] )
return lst
@@ -1480,7 +1491,7 @@ if installSetup.headers:
if installSetup.clientSrc:
for x in allClientFiles:
x = str(x)
- env.Install( installDir + "/mongo/" + x.rpartition( "/" )[0] , x )
+ env.Install( installDir + "/mongo/" + _rpartition( x, "/" )[0] , x )
#lib
if installSetup.libraries:
@@ -1559,7 +1570,7 @@ def s3push( localName , remoteName=None , remotePrefix=None , fixName=True , pla
remoteName = localName
if fixName:
- (root,dot,suffix) = localName.rpartition( "." )
+ (root,dot,suffix) = _rpartition( localName, "." )
name = remoteName + "-" + getSystemInstallName()
name += remotePrefix
if dot == "." :