我使用不喜欢 git 的代理。在大多数情况下,我可以使用export http_proxy
and git config --global url."http://".insteadOf git://
。
但是当我使用 Yocto 的 python 脚本时,这种解决方法不再起作用。我系统地停在Getting branches from remote repo git://git.yoctoproject.org/linux-yocto-3.14.git...
. 我怀疑这些线路是负责任的:
gitcmd = "git ls-remote %s *heads* 2>&1" % (giturl)
tmp = subprocess.Popen(gitcmd, shell=True, stdout=subprocess.PIPE).stdout.read()
我认为在这些行之后,其他人会尝试连接到 git url。我使用的脚本(yocto-bsp
)调用了其他脚本,这些脚本调用脚本,所以很难说。我之前尝试过添加os.system(git config --global url."http://".insteadOf git://)
,但它确实是花生。
当然,我可以尝试手动(或使用解析脚本)修改所有 url 以手动替换git://
,http://
但这个解决方案是......可怕的。我希望修改尽可能小并且易于复制。但最重要的是,我想要一个工作脚本。
编辑:根据this page,git url是git://git.yoctoproject.org/linux-yocto-3.14
但对应的http url是http://git.yoctoproject.org/git/linux-yocto-3.14
,所以我不能只解析替换git://
为http://
。绝对不酷。