一直很忙,忙的不可開交,以前我說有時間就來寫點東西,然後最近一直很忙,連論文,加新項目,事情挺多的,android源碼還是很久以前下載的,今天sync發現突然不行了,報錯:
error.GitError: device/common rev-list ('^7d4526582f88808a3194e1a3b304abb369d2745c', 'HEAD', '--'): fatal: bad object 7d4526582f88808a3194e1a3b304abb369d2745c
result = cmd.Execute(copts, cargs) File "/home/thinkinbunny/mydroid/.repo/repo/subcmds/sync.py", line 466, in Execute project.Sync_LocalHalf(syncbuf) File "/home/thinkinbunny/mydroid/.repo/repo/project.py", line 1007, in Sync_LocalHalf lost = self._revlist(not_rev(revid), HEAD) File "/home/thinkinbunny/mydroid/.repo/repo/project.py", line 1785, in _revlist return self.work_git.rev_list(*a, **kw) File "/home/thinkinbunny/mydroid/.repo/repo/project.py", line 1930, in rev_list p.stderr))error.GitError: platform/development rev-list ('^34ccdaa87b25c2456a76aafcf09a66b2fab236ff', 'HEAD', '--'): fatal: bad object 34ccdaa87b25c2456a76aafcf09a66b2fab236ffthinkinbunny@tib-N55SF:~/mydroid$ ./repo syncFetching projects: 100% (247/247), done. Syncing work tree: 4% (10/247) Traceback (most recent call last): File "/home/thinkinbunny/mydroid/.repo/repo/main.py", line 385, in <module> _Main(sys.argv[1:]) File "/home/thinkinbunny/mydroid/.repo/repo/main.py", line 365, in _Main result = repo._Run(argv) or 0 File "/home/thinkinbunny/mydroid/.repo/repo/main.py", line 137, in _Run result = cmd.Execute(copts, cargs) File "/home/thinkinbunny/mydroid/.repo/repo/subcmds/sync.py", line 466, in Execute project.Sync_LocalHalf(syncbuf) File "/home/thinkinbunny/mydroid/.repo/repo/project.py", line 1007, in Sync_LocalHalf lost = self._revlist(not_rev(revid), HEAD) File "/home/thinkinbunny/mydroid/.repo/repo/project.py", line 1785, in _revlist return self.work_git.rev_list(*a, **kw) File "/home/thinkinbunny/mydroid/.repo/repo/project.py", line 1930, in rev_list p.stderr))error.GitError: device/common rev-list ('^7d4526582f88808a3194e1a3b304abb369d2745c', 'HEAD', '--'): fatal: bad object 7d4526582f88808a3194e1a3b304abb369d2745cthinkinbunny@tib-N55SF:~/mydroid$ ./repo syncFetching projects: 100% (247/247), done. Syncing work tree: 10% (25/247) Traceback (most recent call last): File "/home/thinkinbunny/mydroid/.repo/repo/main.py", line 385, in <module> _Main(sys.argv[1:]) File "/home/thinkinbunny/mydroid/.repo/repo/main.py", line 365, in _Main result = repo._Run(argv) or 0 File "/home/thinkinbunny/mydroid/.repo/repo/main.py", line 137, in _Run result = cmd.Execute(copts, cargs) File "/home/thinkinbunny/mydroid/.repo/repo/subcmds/sync.py", line 466, in Execute project.Sync_LocalHalf(syncbuf) File "/home/thinkinbunny/mydroid/.repo/repo/project.py", line 1007, in Sync_LocalHalf lost = self._revlist(not_rev(revid), HEAD) File "/home/thinkinbunny/mydroid/.repo/repo/project.py", line 1785, in _revlist return self.work_git.rev_list(*a, **kw) File "/home/thinkinbunny/mydroid/.repo/repo/project.py", line 1930, in rev_list p.stderr))error.GitError: platform/docs/source.android.com rev-list ('^bce007aa754159a3c4b3894c581c53940ebc2e08', 'HEAD', '--'): fatal: bad object bce007aa754159a3c4b3894c581c53940ebc2e08thinkinbunny@tib-N55SF:~/mydroid$ ./repo syncFetching projects: 100% (247/247), done. Traceback (most recent call last): File "/home/thinkinbunny/mydroid/.repo/repo/main.py", line 385, in <module> _Main(sys.argv[1:]) File "/home/thinkinbunny/mydroid/.repo/repo/main.py", line 365, in _Main result = repo._Run(argv) or 0 File "/home/thinkinbunny/mydroid/.repo/repo/main.py", line 137, in _Run result = cmd.Execute(copts, cargs) File "/home/thinkinbunny/mydroid/.repo/repo/subcmds/sync.py", line 466, in Execute project.Sync_LocalHalf(syncbuf) File "/home/thinkinbunny/mydroid/.repo/repo/project.py", line 1007, in Sync_LocalHalf lost = self._revlist(not_rev(revid), HEAD) File "/home/thinkinbunny/mydroid/.repo/repo/project.py", line 1785, in _revlist return self.work_git.rev_list(*a, **kw) File "/home/thinkinbunny/mydroid/.repo/repo/project.py", line 1930, in rev_list p.stderr))error.GitError: platform/external/bluetooth/bluez rev-list ('^5477d33e187d66961453399c53093bd18297013e', 'HEAD', '--'): fatal: bad object 5477d33e187d66961453399c53093bd18297013e
多次嘗試無果,google之,發現google group上有這個問題,很多人問,不過都是不了了之,以前吧,百度過這個問題,在這個神奇的過度,人人都學會了CC和CV,然後就是,說是刪除.repo目錄,總之有點扯淡,刪除了repo跟重新下載有什麼區別呢?扯淡啊。可惡的bug。
建立了目錄重新下載,最近狗日的寬頻通吃屎,速度老慢。我可不想在假期下載一天源碼。
折騰了一個上午,發現瞭解決方案。其實很簡單,android源碼實際上還是用git下載的。至於repo是什麼東東,自己查唄,不浪費資源了。
其本來有圖,無奈windows發不了圖。
我就說說基本解決方案:
除了repo .repo其餘的都刪除,cts之類的什麼刪除就行了,不需要心疼,前提是你的網路通,至於出現bad object,原因不曉得,感覺是東西太老的,無法替換掉,刪除了這些,sync會重新沖repo目錄拷貝解析出來。如果刪除了repo,後果就是你要重新下載 了。應該很長時間的。至於repo下面的東西沒什麼影響,但是不要刪除了,不然更新就蛋疼了
最近遇到了一個大麻煩,發現以上的辦法不管用了,最近換了房子,沒網,要答辯了,把本子帶公司,打算收拾下,順便更新代碼出錯了,不記錄了,沒法重現了。
提供一個終極方案:
比如原來捏到源碼目錄是mydroid,現在建立一個droid
$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo$ chmod a+x ~/bin/repo
repo init -u https://android.googlesource.com/platform/manifest
稍等,這個目錄下面會有一個隱藏目錄 repo,把這個目錄全部複製mydroid覆蓋就行,然後droid就沒用了,然後再更新,這樣是最省事的,網速牛逼的非要把repo刪除也沒辦法,對於ip的並發google做了限制的。不能下載的
repo init -u https://android.googlesource.com/a/platform/manifest
只能這樣下載了http://source.android.com/source/downloading.html 仔細閱讀這個就好了。至於repo的各種問題可以說是bug吧。
同步出錯就是某些檔案校正失敗,最簡單的方法就是建立一個目錄初始設定檔案覆蓋舊的,語文不及格,表的的不是很明白,將就看吧