Migrating Portage to Git

Added by Elena Gavrilova about 3 years ago

language Russian

A week ago or so, we were vividly discussing the Portage Tree on Git issue on our mail list. The idea was unanimously accepted.

Beginning with Stage 20111114, Portage is by default synchronized with our Git server, located in Saint-Petersburg. The Git repository stores a Portage copy with truncated Manifest and Changelog data, thus compensating for the extra space occuped by Git. Running a complete eix-sync over a 10 Mbit channel after, say, two days without syncing should take 30 seconds or so. Repeated syncing will mostly consist of updating portage cache and should require 20 seconds approximately.

To be able to run our Portage copy, we had to modify the overlay location. From now on Calculate Portage and Calculate Overlay are located, respectively, at: git://git.calculate.ru/calculate/portage и overlay.

Speed is not the only thing we're gaining. While preparing binary updates, we're normally correcting masks, USE flags and even dependencies. So after an upgrade, Portage keeps being updated, generating new masks and flag changes: some packages would be replaced with newer ones, some USE flags would be modified even though package versions are not... At best, all this would make the system compile packages that already have binary files; at worst, autounmask would be used. Using stages solves this problem definitely: Portage, the overlay and binary packages will be, from now on, completely corresponding.

Calculate Portage does not modify the original Portage. Therefore, you can always switch back to Gentoo Portage, still synchronized via RSYNC.

Another novelty is that fetching Git via the http protocol is supported. If you have no direct access to the Internet, you can configure Portage and the overlay so that they be updated via Proxy. All you have to do is change the path to the repository from git:// to http://.

To modify the path to Calculate Overlay, just remove and then add again the overlay:

layman -d calculate
layman -a calculate

For Portage migration on Git, execute:

cd /usr
git clone --depth 1 git://git.calculate.ru/calculate/portage portage-git
rm -rf portage
mv portage-git portage
emerge -u portage
eix-sync

To enable updating via Proxy, please execute:

echo "proxy : http://PROXY:8080" >>/etc/layman/layman.cfg
git config --global http.proxy PROXY:8080
sed -ri 's|(url = )git://|\1http://|' /var/lib/layman/calculate/.git/config
sed -ri 's|(url = )git://|\1http://|' /usr/portage/.git/config

To fetch files through Proxy you may need to modify wget settings in /etc/wgetrc.

Syncing via the http protocol will be much slower, because the "--depth 1" option is not supported for the time being. Hence, all commits will be fetched - which will result, yet, in somewhat slower traffic. This seems to be however a better solution than using RSYNC.

In further versions, we expect to make cl-install configure updating via Proxy.

Enjoy!


Comments

Thank you!