Improve roll.py to make it actually work

This commit is contained in:
Adam Barth
2015-07-16 21:10:55 -07:00
parent 07b4510b6c
commit f99a1c19a6
2 changed files with 7 additions and 8 deletions

View File

@@ -7,18 +7,17 @@ import os
import subprocess
import utils
def patch_and_filter():
"""Applies the *.patch files in the current dir and some hardcoded filters."""
os.chdir(utils.mojo_root_dir)
def patch_and_filter(dest_dir):
os.chdir(dest_dir)
utils.filter_file("build/landmines.py",
lambda line: not "gyp_environment" in line)
utils.commit("filter gyp_environment out of build/landmines.py")
patch()
patch(dest_dir)
def patch(relative_patches_dir=os.curdir):
def patch(dest_dir, relative_patches_dir=os.curdir):
"""Applies the *.patch files in |relative_patches_dir|.
Args:
@@ -32,7 +31,7 @@ def patch(relative_patches_dir=os.curdir):
relative_patches_dir)
assert os.path.isdir(patches_dir)
os.chdir(utils.mojo_root_dir)
os.chdir(dest_dir)
for p in utils.find(["*.patch"], patches_dir):
print "applying patch %s" % os.path.basename(p)
try:

View File

@@ -29,12 +29,12 @@ _build_deps = [
'build',
'third_party/android_testrunner',
'third_party/binutils',
'third_party/instrumented_libraries',
'third_party/pymock',
'tools/android',
'tools/clang',
'tools/generate_library_loader',
'tools/gritsettings',
'tools/relocation_packer',
'tools/valgrind',
]
@@ -147,7 +147,7 @@ def main():
rev(args.chromium_dir, args.dest_dir, dirs_from_chromium, 'chromium')
try:
patch.patch_and_filter()
patch.patch_and_filter(args.dest_dir)
except subprocess.CalledProcessError:
print "ERROR: Roll failed due to a patch not applying"
print "Fix the patch to apply, commit the result, and re-run this script"