summaryrefslogtreecommitdiffstats
path: root/build/build-bisect.py
diff options
context:
space:
mode:
authorrsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-20 00:56:38 +0000
committerrsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-20 00:56:38 +0000
commitd4bf358741a855e6e3642acc7646f2ab3b2aed36 (patch)
treefb18bad3e778f51c65d508ee7f3d4185a2f43dac /build/build-bisect.py
parent3d622ce02951bff753b4be213171ea95a62cc8f1 (diff)
downloadchromium_src-d4bf358741a855e6e3642acc7646f2ab3b2aed36.zip
chromium_src-d4bf358741a855e6e3642acc7646f2ab3b2aed36.tar.gz
chromium_src-d4bf358741a855e6e3642acc7646f2ab3b2aed36.tar.bz2
build-bisect.py: Minor tweaks and Mac fix
* Allow user-specified profile directories. * Fix Mac BUILD_EXE_NAME to be the actual binary, rather than the bundle. Review URL: http://codereview.chromium.org/209045 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26662 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build/build-bisect.py')
-rwxr-xr-xbuild/build-bisect.py26
1 files changed, 16 insertions, 10 deletions
diff --git a/build/build-bisect.py b/build/build-bisect.py
index 29bbfd4..005ad65 100755
--- a/build/build-bisect.py
+++ b/build/build-bisect.py
@@ -42,6 +42,7 @@ BUILD_VIEWVC_URL = "http://src.chromium.org/viewvc/chrome?view=rev&revision=%d"
import math
import optparse
import os
+import pipes
import re
import shutil
import sys
@@ -67,7 +68,7 @@ def SetArchiveVars(archive):
elif BUILD_ARCHIVE_TYPE in ('mac'):
BUILD_ZIP_NAME = 'chrome-mac.zip'
BUILD_DIR_NAME = 'chrome-mac'
- BUILD_EXE_NAME = "Chromium.app"
+ BUILD_EXE_NAME = "Chromium.app/Contents/MacOS/Chromium"
elif BUILD_ARCHIVE_TYPE in ('xp'):
BUILD_ZIP_NAME = 'chrome-win32.zip'
BUILD_DIR_NAME = 'chrome-win32'
@@ -91,8 +92,9 @@ def GetRevList(good, bad):
revlist.sort()
return revlist
-def TryRevision(rev):
- """Downloads revision |rev|, unzips it, and opens it for the user to test."""
+def TryRevision(rev, profile):
+ """Downloads revision |rev|, unzips it, and opens it for the user to test.
+ |profile| is the profile to use."""
# Do this in a temp dir so we don't collide with user files.
cwd = os.getcwd()
tempdir = tempfile.mkdtemp(prefix='bisect_tmp')
@@ -112,13 +114,11 @@ def TryRevision(rev):
os.system("unzip -q %s" % BUILD_ZIP_NAME)
# Tell the system to open the app.
- flags = '--user-data-dir=profile'
+ flags = '--user-data-dir=' + profile
print 'Running %s/%s/%s %s' % (os.getcwd(), BUILD_DIR_NAME, BUILD_EXE_NAME,
flags)
- if BUILD_ARCHIVE_TYPE in ('linux', 'linux-64'):
- os.system("%s/%s %s" % (BUILD_DIR_NAME, BUILD_EXE_NAME, flags))
- elif BUILD_ARCHIVE_TYPE in ('mac'):
- os.system("open %s/%s %s" % (BUILD_DIR_NAME, BUILD_EXE_NAME, flags))
+ if BUILD_ARCHIVE_TYPE in ('linux', 'linux-64', 'mac'):
+ os.system("%s/%s %s" % (BUILD_DIR_NAME, BUILD_EXE_NAME, pipes.quote(flags)))
elif BUILD_ARCHIVE_TYPE in ('xp'):
# TODO(mmoss) Does Windows need 'start' or something?
os.system("%s/%s %s" % (BUILD_DIR_NAME, BUILD_EXE_NAME, flags))
@@ -153,6 +153,9 @@ def main():
help = 'The bad revision to bisect to.')
parser.add_option('-g', '--good', type = 'int',
help = 'The last known good revision to bisect from.')
+ parser.add_option('-p', '--profile', '--user-data-dir', type = 'str',
+ help = 'Profile to use; this will not reset every run. ' +
+ 'Defaults to a clean profile.')
(opts, args) = parser.parse_args()
if opts.archive is None:
@@ -221,8 +224,11 @@ def main():
test = int((bad - good) / 2) + good
test_rev = revlist[test]
- # Let the user give this revision a spin.
- TryRevision(test_rev)
+ # Let the user give this rev a spin (in her own profile, if she wants).
+ profile = opts.profile
+ if not profile:
+ profile = 'profile' # In a temp dir.
+ TryRevision(test_rev, profile)
if AskIsGoodBuild(test_rev):
good = test + 1
else: