X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fnative_client%2Ftoolchain_build%2Fpnacl_commands.py;h=36e39d7e7dc3722eb4185aa7734b6ae8328545f1;hb=004985e17e624662a4c85c76a7654039dc83f028;hp=9fbd68e20bc023df46aba6649a36b2142ba20b08;hpb=2f108dbacb161091e42a3479f4e171339b7e7623;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/native_client/toolchain_build/pnacl_commands.py b/src/native_client/toolchain_build/pnacl_commands.py index 9fbd68e..36e39d7 100644 --- a/src/native_client/toolchain_build/pnacl_commands.py +++ b/src/native_client/toolchain_build/pnacl_commands.py @@ -6,6 +6,7 @@ """Runnables for toolchain_build_pnacl.py """ +import base64 import os import shutil import stat @@ -69,3 +70,35 @@ def InstallDriverScripts(subst, srcdir, dstdir, host_windows=False, url, rev = pynacl.repo_tools.SvnRevInfo(NACL_DIR) repotype = 'SVN' print >> f, '[%s] %s: %s' % (repotype, url, rev) + + +def CheckoutGitBundleForTrybot(repo, destination): + # For testing LLVM, Clang, etc. changes on the trybots, look for a + # Git bundle file created by llvm_change_try_helper.sh. + bundle_file = os.path.join(NACL_DIR, 'pnacl', 'not_for_commit', + '%s_bundle' % repo) + base64_file = '%s.b64' % bundle_file + if os.path.exists(base64_file): + input_fh = open(base64_file, 'r') + output_fh = open(bundle_file, 'wb') + base64.decode(input_fh, output_fh) + input_fh.close() + output_fh.close() + subprocess.check_call( + pynacl.repo_tools.GitCmd() + ['fetch'], + cwd=destination + ) + subprocess.check_call( + pynacl.repo_tools.GitCmd() + ['bundle', 'unbundle', bundle_file], + cwd=destination + ) + commit_id_file = os.path.join(NACL_DIR, 'pnacl', 'not_for_commit', + '%s_commit_id' % repo) + commit_id = open(commit_id_file, 'r').readline().strip() + subprocess.check_call( + pynacl.repo_tools.GitCmd() + ['checkout', commit_id], + cwd=destination + ) + +def CmdCheckoutGitBundleForTrybot(subst, repo, destination): + return CheckoutGitBundleForTrybot(repo, subst.SubstituteAbsPaths(destination))