summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Crosta <dcrosta@10gen.com>2012-03-26 11:38:52 -0400
committerDan Crosta <dcrosta@10gen.com>2012-03-26 11:40:46 -0400
commit64f3b376ca0bd04712bb6e02a508a3a0f4fbab63 (patch)
tree2829f73896e3c88411dd631e3d7d8bcab77a9258
parentbb76d2d736570a975ff4f609cae899e11d04eb9e (diff)
downloadmongo-64f3b376ca0bd04712bb6e02a508a3a0f4fbab63.tar.gz
python-2.4 compatible version of cleanbb.py
-rw-r--r--buildscripts/cleanbb.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/buildscripts/cleanbb.py b/buildscripts/cleanbb.py
index 261519a4977..bfeafd2d8e9 100644
--- a/buildscripts/cleanbb.py
+++ b/buildscripts/cleanbb.py
@@ -1,13 +1,15 @@
import sys
-import os
+import os, os.path
import utils
import time
from optparse import OptionParser
-cwd = os.getcwd();
-if cwd.find("buildscripts" ) > 0 :
- cwd = cwd.partition( "buildscripts" )[0]
+# set cwd to the root mongo dir, one level up from this
+# file's location (if we're not already running from there)
+cwd = os.getcwd()
+if os.path.basename(cwd) == 'buildscripts':
+ cwd = os.path.dirname(cwd)
print( "cwd [" + cwd + "]" )
@@ -38,7 +40,7 @@ def killprocs( signal="" ):
if not shouldKill( x ):
continue
- pid = x.partition( " " )[0]
+ pid = x.split( " " )[0]
print( "killing: " + x )
utils.execsys( "/bin/kill " + signal + " " + pid )
killed = killed + 1