Android platform을 repo를 이용하여 git에서 다운로드 할 때 자꾸 remote end hung up unexpectedly 라는 오류가 나면서 접속이 끊기는 경우가 있습니다.
이럴 땐 다음과 같은 방법으로 피해(?)를 최소화 할 수 있습니다:
1. repo init 하여 초기화 해 놓은 디렉토리로 이동합니다.
2. vi .repo/repo/subcmds/sync.py 를 이용하여 sync.py 파일을 편집합니다
3. _Fetch를 검색하여 다음과 같이 수정합니다.
def _Fetch(self, projects):
fetched = set()
pm = Progress('Fetching projects', len(projects))
for project in projects:
pm.update()
while True:
if project.Sync_NetworkHalf():
fetched.add(project.gitdir)
break
else:
print >>sys.stderr, 'error: Cannot fetch %s' % project.name
pm.end()
return fetched
기존의 소스와 달라진 점이 있다면
"while True:"와 "break"를 추가한 것과 "sys.exit(1)" 을 삭제한 것이 다릅니다. 즉 그냥 소스 코드 다운로드 될 때 까지 무한 루프 돌겠다 이거죠.


Attribution/Share Alike 2.0 license








