Difference between pages "Portage Git Mirror" and "Emerge/pt-br"

From Funtoo
(Difference between pages)
Jump to navigation Jump to search
m (found the --sync settings for portage in the install guide)
 
 
Line 1: Line 1:
=Setting up local git mirror =
== Principiando com o emerge ==
Emerge é o front-end para o gerenciador de Portage do funtoo. Com o emerge é fácil instalar, atualizar ou remover pacotes.


This tutorial explains how to save bandwidth when several local computers need to pull updates from a single remote git repository.
=== Atualizar a Base de Dados de Pacote ===
'''Sincronize base de dados de pacote local. Isso atualizará sua arvore Portage local com a ultima versão do Funtoo ebuilds.'''
<console>
###i## emerge --sync
</console>


== Use case ==
=== Buscar pacotes ===
'''Busca pacotes por nome.'''
<console>
###i## emerge -s firefox
###i## emerge --search firefox
</console>


This tutorial will be about hosting a local mirror of funtoo git based portage tree.
'''Busca pacotes pode descrição.'''
<console>
###i## emerge -S web browser
###i## emerge --searchdesc web browser
</console>


Following terms should be adapted
=== Install packages ===
'''Instalar pacote.'''
<console>
###i## emerge firefox
</console>


{{TableStart}}
'''Instalar múltiplos pacotes.'''
<tr class="header">
<console>
<th align="left">Terms</th>
###i## emerge firefox thunderbird
<th align="left">Definition</th>
</console>
</tr>
<tr class="odd">
<td align="left">git.lan</td>
<td align="left">The git-daemon local mirror host</td>
</tr>
<tr class="even">
<td align="left">localhost</td>
<td align="left">Any local host</td>
</tr>
<tr class="odd">
<td align="left">nobody</td>
<td align="left">Owner user of .git files</td>
</tr>
<tr class="even">
<td align="left">/home/git-mirrors</td>
<td align="left">Base path of git-daemon</td>
</tr>
{{TableEnd}}


== Local mirror ==
'''Instalar pacotes. Pedir por confirmação antes de realizar quaisquer alterações. Exibe saída em verbose.'''
<console>
###i## emerge -av firefox
###i## emerge --ask firefox
</console>


==== Prepare directories and get portage tree====
=== Remove packages ===
'''Remove package.'''
<console>
<console>
###i## mkdir /home/git-mirrors
###i## emerge -C firefox
###i## chown nobody /home/git-mirrors
###i## emerge --unmerge firefox
###i## su -s /bin/sh nobody
$##bl## cd /home/git-mirrors
$##bl## git clone --mirror --bare git://github.com/funtoo/ports-2012.git portage.git
</console>
</console>
For a security reason we use a nobody user .
==== git-daemon configuration====
{{file|name=/etc/conf.d/git-daemon|desc=|body=
GITDAEMON_OPTS="--syslog --verbose --enable=receive-pack --export-all"
GITDAEMON_OPTS="${GITDAEMON_OPTS} --base-path=/home/git-mirrors /home/git-mirrors --interpolated-path=/home/git-mirrors"
GIT_USER=nobody
GIT_GROUP=nobody
}}


====Service configuration====
'''Remove package. Ask for confirmation before performing any changes.'''
To start daemon with a mirror machine boot add <code>git-daemon</code> to default runlevel
<console>
<console>
###i## rc-update add git-daemon default
###i## emerge -aC firefox
</console>
</console>
To make changes start immediately just run <code>rc</code>
 
'''Remove orphaned packages. Ask for confirmation before performing any changes.'''
<console>
<console>
###i## rc
###i## emerge -a --depclean
</console>
</console>


=== Pull from remote ===
=== Update packages ===
'''Update all packages.'''
<console>
###i## emerge -uDN @world
</console>


Add the following to <code>/etc/cron.daily/funtoo-sync.sh</code>:
'''Update all packages. Ask for confirmation before performing any changes. Show verbose output.'''
<console>
###i## emerge -uavDN @world
</console>


<pre>
'''When upgrading to a new version of perl, it is necessary to also run <code>perl-cleaner</code> afterwards:'''
#!/bin/sh
cd /home/git-mirrors/portage.git
su nobody -s "/bin/sh" -c "git fetch"
</pre>
 
== Cloning from local git-daemon ==
 
Local clone from <code>git.lan</code>:
<console>
<console>
###i## mv /usr/portage /usr/portage.old
###i## emerge -auvDN @world
###i## git clone git://git.lan/portage.git /usr/portage
###i## perl-cleaner --all
###i## cd /usr/portage
###i## git checkout funtoo.org
</console>
</console>


== Downstream Clients Settings ==
{{Note|This requirement of running <code>perl-cleaner</code> will eventually go away, once all perl-related ebuilds are updated to EAPI 5. EAPI 5 is a version of the Ebuild specification that supports smart updating of perl-related bits.}}
{{file|name=/etc/portage/make.conf|lang=|desc=define client sync source for emerge --sync|body=
SYNC="git://git.lan/portage.git"}}
 
[[Category:HOWTO]]

Revision as of 16:52, February 7, 2015

Principiando com o emerge

Emerge é o front-end para o gerenciador de Portage do funtoo. Com o emerge é fácil instalar, atualizar ou remover pacotes.

Atualizar a Base de Dados de Pacote

Sincronize base de dados de pacote local. Isso atualizará sua arvore Portage local com a ultima versão do Funtoo ebuilds.

root # emerge --sync

Buscar pacotes

Busca pacotes por nome.

root # emerge -s firefox
root # emerge --search firefox

Busca pacotes pode descrição.

root # emerge -S web browser
root # emerge --searchdesc web browser

Install packages

Instalar pacote.

root # emerge firefox

Instalar múltiplos pacotes.

root # emerge firefox thunderbird

Instalar pacotes. Pedir por confirmação antes de realizar quaisquer alterações. Exibe saída em verbose.

root # emerge -av firefox
root # emerge --ask firefox

Remove packages

Remove package.

root # emerge -C firefox
root # emerge --unmerge firefox

Remove package. Ask for confirmation before performing any changes.

root # emerge -aC firefox

Remove orphaned packages. Ask for confirmation before performing any changes.

root # emerge -a --depclean

Update packages

Update all packages.

root # emerge -uDN @world

Update all packages. Ask for confirmation before performing any changes. Show verbose output.

root # emerge -uavDN @world

When upgrading to a new version of perl, it is necessary to also run perl-cleaner afterwards:

root # emerge -auvDN @world
root # perl-cleaner --all
   Note

This requirement of running perl-cleaner will eventually go away, once all perl-related ebuilds are updated to EAPI 5. EAPI 5 is a version of the Ebuild specification that supports smart updating of perl-related bits.