# Pastebin jvQce7ME do_fetch:append() { import subprocess from bb.fetch2.git import Git sourcedir = d.getVar('S', True) workdir = d.getVar('WORKDIR', True) path = d.getVar('PATH', True) or '' http_proxy = d.getVar('http_proxy', True) or '' https_proxy = d.getVar('https_proxy', True) or '' vpython_virtualenv_root = d.getVar('VPYTHON_VIRTUALENV_ROOT', True) or '' try: Git.unpack(self, ud, sourcedir, d) except bb.fetch2.FetchError as e: bb.fatal("Failed to fetch depot_tools: %s" % e) # DEPOT_TOOLS_UPDATE=0 - disable auto update # XDG_CONFIG_HOME - Required since depot_tools_config_dir will return a path based on XDG_CONFIG_HOME cmd = f""" export DEPOT_TOOLS_UPDATE=0 export PATH={sourcedir}:{path} export XDG_CONFIG_HOME={workdir} export http_proxy={http_proxy} export https_proxy={https_proxy} export VPYTHON_VIRTUALENV_ROOT={vpython_virtualenv_root} gclient --version """ try: subprocess.check_output(cmd, shell=True, cwd=sourcedir, stderr=subprocess.STDOUT, universal_newlines=True) except subprocess.CalledProcessError as e: bb.fatal("Failed to run gclient command: %s" % e.output) try: bb.utils.remove(sourcedir, recurse=True) except bb.fetch2.FetchError as e: bb.fatal("Failed to remove depot_tools: %s" % e) }