There is a work from Oswald Buddenhagen, his change, qtrepotools: add mirror script.
Mirror Script
You need to have an account of codereview(gerrit) and set up the ssh keys well, more info in Contribute to Qt.
Here is the qt-codereview-mirror shell script in github.
I set up this mirror script on a Ubuntu 13.04 machine. You need to check following before to run it:
- Install git and procmail package for git and lockfile:
1 |
sudo apt-get install git procmail |
- Make sure you have /data/repos directory.
You could have a try run for the above script. If it works well for you, you can add it into your crontab, see also Ubuntu: CronHowto.
Git Daemon
Next is to run a git server on your machine. I use git-daemon for this task.
1 |
git daemon --base-path=/data/repos --export-all & |
How to use your mirror?
- For Qt 4:
If you need to push change to upstream, then you should set up gerrit remote.
1 2 3 |
git clone git://yourmirror/qt/qt.git cd qt4 git remote add gerrit ssh://codereview.qt-project.org/qt/qt |
- For Qt 5:
init-repository will help you set up gerrit remote for each repo.
1 2 3 |
git clone git://yourmirror/qt/qt5.git cd qt5 ./init-repository -f --mirror git://yourmirror/ |