{"body":"do_fetch:append() {\n    import subprocess\n    from   bb.fetch2.git import Git\n\n    sourcedir = d.getVar('S', True)\n    workdir = d.getVar('WORKDIR', True)\n    path = d.getVar('PATH', True) or ''\n    http_proxy = d.getVar('http_proxy', True) or ''\n    https_proxy = d.getVar('https_proxy', True) or ''\n    vpython_virtualenv_root = d.getVar('VPYTHON_VIRTUALENV_ROOT', True) or ''\n\n    try:\n        Git.unpack(self, ud, sourcedir, d)\n    except bb.fetch2.FetchError as e:\n        bb.fatal(\"Failed to fetch depot_tools: %s\" % e)\n\n    # DEPOT_TOOLS_UPDATE=0 - disable auto update\n    # XDG_CONFIG_HOME - Required since depot_tools_config_dir will return a path based on XDG_CONFIG_HOME\n\n    cmd = f\"\"\"\n    export DEPOT_TOOLS_UPDATE=0\n    export PATH={sourcedir}:{path}\n    export XDG_CONFIG_HOME={workdir}\n    export http_proxy={http_proxy}\n    export https_proxy={https_proxy}\n    export VPYTHON_VIRTUALENV_ROOT={vpython_virtualenv_root}\n    gclient --version\n    \"\"\"\n\n    try:\n        subprocess.check_output(cmd, shell=True, cwd=sourcedir,\n                                stderr=subprocess.STDOUT, universal_newlines=True)\n    except subprocess.CalledProcessError as e:\n        bb.fatal(\"Failed to run gclient command: %s\" % e.output)\n\n    try:\n        bb.utils.remove(sourcedir, recurse=True)\n    except bb.fetch2.FetchError as e:\n        bb.fatal(\"Failed to remove depot_tools: %s\" % e)\n}\n","name":"","extension":"txt","url":"https://www.irccloud.com/pastebin/jvQce7ME","modified":1751573786,"id":"jvQce7ME","size":1390,"lines":40,"own_paste":false,"theme":"","date":1751573786}