2014年8月28日 星期四

repo error: syntax error near unexpected token `newline' repo problem

curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo


執行 repo init -u git://android.googlesource.com/platform/manifest.git 可能會出現下面的錯誤

~/bin/repo: line 1: syntax error near unexpected token `newline'
~/bin/repo: line 1: `<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"

可能是下載的 repo 壞掉了。從官方下載的 repo 檔案可能壞掉了,只要重新下載一次就好了。


curl http://git-repo.googlecode.com/files/repo-1.13 > ~/bin/repo


[1]http://blog.csdn.net/kai46385076/article/details/17460563


Update(2016/06/22)
有另一種可能是要將 https 改為 http

REPO_URL='https://gerrit.googlesource.com/git-repo'
改為
REPO_URL='http://gerrit.googlesource.com/git-repo'