Git local overlay

From Funtoo
This is the approved revision of this page, as well as being the most recent.
Jump to: navigation, search

Here is How To: Work with local overlay synchronized with your git repository.

[edit] Setup git local overlay

[edit] Create local overlay

Create the necessary directory structure

# mkdir -p /usr/local/portage/profiles 
# echo "$HOSTNAME" >> /usr/local/portage/profiles/repo_name

This enables access to /usr/local/portage for users in the portage group

# chown root:portage /usr/local/portage

Assign the portage group as default for newly created files in /usr/local/portage

# chmod g+s /usr/local/portage

Enable users in the portage group to write to /usr/local/portage

# chmod 775 /usr/local/portage

Edit /etc/portage/make.conf

# echo "PORTDIR_OVERLAY=/usr/local/portage" >> /etc/portage/make.conf

Create the relevant directory structure (I use the game rain-slick as example)

$ mkdir -p /usr/local/portage/games-rpg/rain-slick

Copy the ebuild to your overlay

$ cp rain-slick-1.5.ebuild /usr/local/portage/games-rpg/rain-slick

Issue the following commands to install rain-slick from your overlay

$ cd /usr/local/portage/games-rpg/rain-slick
$ ebuild rain-slick-1.5.ebuild digest
$ su
# emerge rain-slick

[edit] Synchronize with git repository

If you are not related with git and ssh you can check this GitHub manual. If you have not git repository with local overlay yet you can assign it alike :

$ cd /usr/local/portage/
$ git add /usr/local/portage/profiles/repo_name
$ git commit -m 'git init'
$ git remote add origin git@github.com:YourGitHubAccount/YourGitHubRepository.git
$ git push -u origin master

If you already have git overlay repository or want to use some you can assign it alike :

$ cd /usr/local/portage/
$ git init
$ git remote add origin git@github.com:YourGitHubAccount/YourGitHubRepository.git
$ git fetch
$ git branch master origin/master
$ git checkout master