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

(Difference between pages)
m (found the --sync settings for portage in the install guide)
 
(Install packages)
 
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.'''
Add the following to <code>/etc/cron.daily/funtoo-sync.sh</code>:
+
<console>
 +
###i## emerge -uDN @world
 +
</console>
  
<pre>
+
'''Update all packages. Ask for confirmation before performing any changes. Show verbose output.'''
#!/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 -uavDN @world
###i## git clone git://git.lan/portage.git /usr/portage
+
###i## cd /usr/portage
+
###i## git checkout funtoo.org
+
 
</console>
 
</console>
  
== Downstream Clients Settings ==
+
'''When upgrading to a new version of perl, it is necessary to also run <code>perl-cleaner</code> afterwards:'''
{{file|name=/etc/portage/make.conf|lang=|desc=define client sync source for emerge --sync|body=
+
<console>
SYNC="git://git.lan/portage.git"}}
+
###i## emerge -auvDN @world
 +
###i## perl-cleaner --all
 +
</console>
  
[[Category:HOWTO]]
+
{{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.}}

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.

# emerge --sync

Buscar pacotes

Busca pacotes por nome.

# emerge -s firefox
# emerge --search firefox

Busca pacotes pode descrição.

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

Install packages

Instalar pacote.

# emerge firefox

Instalar múltiplos pacotes.

# emerge firefox thunderbird

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

# emerge -av firefox
# emerge --ask firefox

Remove packages

Remove package.

# emerge -C firefox
# emerge --unmerge firefox

Remove package. Ask for confirmation before performing any changes.

# emerge -aC firefox

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

# emerge -a --depclean

Update packages

Update all packages.

# emerge -uDN @world

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

# emerge -uavDN @world

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

# emerge -auvDN @world
# 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.