我使用不喜歡git的代理。在大多數情況下,我可以使用export http_proxy
和git config --global url."http://".insteadOf git://
。在python腳本中使用代理後面的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://
by http://
,但此解決方案是......可怕的。我希望修改儘可能小並且容易複製。但最重要的是,我想要一個工作腳本。
編輯:根據this page,git的網址是git://git.yoctoproject.org/linux-yocto-3.14
但是通訊員HTTP URL是http://git.yoctoproject.org/git/linux-yocto-3.14
,所以我不能只是解析由http://
更換git://
。絕對不酷。