def main(): parser = argparse.ArgumentParser(description="Update the mojo repo's " + "snapshot of things imported from chromium.") parser.add_argument("--mojo-dir", type=str) parser.add_argument("--chromium-dir", type=str) parser.add_argument("--dest-dir", type=str) args = parser.parse_args() dest_dir = os.path.abspath(args.dest_dir) if args.mojo_dir: rev(os.path.abspath(args.mojo_dir), dest_dir, dirs_from_mojo, 'mojo') if args.chromium_dir: rev(os.path.abspath(args.chromium_dir), dest_dir, dirs_from_chromium, 'chromium') try: patch.patch_and_filter(dest_dir, os.path.join('patches', 'chromium')) 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" return 1 return 0
def main(): parser = argparse.ArgumentParser( description="Update the mojo repo's " + "snapshot of things imported from chromium.") parser.add_argument("--mojo-dir", type=str) parser.add_argument("--chromium-dir", type=str) parser.add_argument("--dest-dir", type=str) args = parser.parse_args() dest_dir = os.path.abspath(args.dest_dir) if args.mojo_dir: rev(os.path.abspath(args.mojo_dir), dest_dir, dirs_from_mojo, 'mojo', revision_file='mojo/VERSION') if args.chromium_dir: rev(os.path.abspath(args.chromium_dir), dest_dir, dirs_from_chromium, 'chromium') try: patch.patch_and_filter(dest_dir, os.path.join('patches', 'chromium')) 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" ) return 1 return 0
def main(): parser = argparse.ArgumentParser(description="Update the mojo repo's " + "snapshot of things imported from chromium.") parser.add_argument("chromium_dir", help="chromium source dir") args = parser.parse_args() pre_roll_commit = system( ["git", "rev-parse", "HEAD"], cwd=mojo_root_dir).strip() rev(args.chromium_dir) try: patch.patch_and_filter() 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" return 1 print "Restoring files whose contents don't track Chromium" for f in files_not_to_roll: system(["git", "checkout", pre_roll_commit, "--", f], cwd=mojo_root_dir) if files_not_to_roll: commit("Restored pre-roll versions of files that don't get rolled") return 0