android_repo_mirror
AOSP의 mirror를 aosp-mirror 폴더에 땡긴다.
$ mkdir aosp-mirror $ cd $_ $ repo init -u git://android.git.kernel.org/platform/manifest.git --mirror $ repo sync -j40
다음 명령어로 프로젝트 리스트를 뽑아 gitosis등에 빈 저장소로 채워 둔다.
$ repo forall -c 'echo "[repo $REPO_PROJECT]"' > repo.list
이제 다음과 같은 스크립트를 만든다;
#/bin/bash echo "" echo "Starting update \"$1\"..." echo "Pusing..." git push --mirror gitosis@your.gitosis.address:$1.git if [ "$?" = "0" ]; then exit 0 else echo $1 >> /home/suapapa/workspace/mirror-logs/aosp_fail_projects.list fi
위 스크립트를 $PATH 밑에 push_mirror.sh 로 저장했다면 다음과 같이 전체 프로젝트를 gitosis 저장소에 업데이트 할 수 있다.
$ repo forall -c 'push_mirror.sh $REPO_PROJECT'
mirror 된 gitosis 저장소에 갱신된 내용, 추가된 branch 는 다음번 git push –mirror 할 때 사라져 버리므로, 작업용으로는 새 저장소를 만들어 clone해 써야 한다. 새 서버, remote 의 주소를 사용한 manifest 프로젝트를 만들어 다음과 같이 사용할 수 있다.
$ mkdir aosp; cd aosp $ repo init -u gitosis@your.gitosis.address:android-manifests.git -b gingerbread $ repo sync -j40
다른 repo 를 사용할 때도 아래와 같이 –reference 옵션을 사용하면 훨씬 빠르게 받을 수 있다.
$ mkdir cm7; cd cm7 $ repo init -u git://github.com/CyanogenMod/android.git -b gingerbread --reference=/home/suapapa/workspace/aosp/ $ repo sync -j40
android_repo_mirror.txt · Last modified: 2013/08/03 05:04 (external edit)