Difference between revisions of "Package:Portage (Funtoo)"

m (Ebuild Functions: removed spurious space before period)
 
(Integrated http://www.funtoo.org/Repository_Configuration with this page, per a request in FL-1923.)
 
(10 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 +
{{Ebuild
 +
|Summary=This is the official package manager/ports system for Funtoo Linux.
 +
|CatPkg=sys-apps/portage
 +
|Maintainer=Drobbins, Mgorny, Oleg
 +
|Repository=Funtoo Overlay
 +
}}
 
== Introduction ==
 
== Introduction ==
  
Portage is the official package manager of Funtoo Linux. Daniel Robbins maintains a slightly different version from upstream Gentoo Linux, with support for mini-manifests and other features.
+
[http://en.wikipedia.org/wiki/Portage_(software) Portage] is the official package manager of Funtoo Linux. Daniel Robbins maintains a slightly different version from upstream Gentoo Linux, with support for mini-manifests and other features.
  
 
== Portage Commands ==
 
== Portage Commands ==
Line 9: Line 15:
 
; [[ebuild]]
 
; [[ebuild]]
 
: lower-level package build tool
 
: lower-level package build tool
 +
 +
;{{c|etc-update}}
 +
;{{c|dispatch-conf}}
 +
:tools to manage /etc/configurations
  
 
== Portage Specifications ==
 
== Portage Specifications ==
  
The latest progress and changes related to EAPI/PMS and Portage can often be found in the Gentoo Council meeting logs, which are listed on the [http://www.gentoo.org/proj/en/council/ Gentoo Council page].
+
The latest progress and changes related to EAPI/PMS and Portage can often be found in the Gentoo Council meeting logs, which are listed on the [https://wiki.gentoo.org/wiki/Project:Council Gentoo Council page].
  
The latest PMS specification to be approved by the Gentoo Council is available: [http://distfiles.gentoo.org/distfiles/pms-3.pdf eapi-3-approved-2010-01-18]. The PMS specification is an attempt to codify the inner workings of Portage, and is authored by Ciaran McCreesh and Stephen Bennett as a Gentoo-hosted project.
+
The latest PMS specification to be approved by the Gentoo Council is available: [http://dev.gentoo.org/~ulm/pms/5/pms.pdf eapi-5-approved-2012-09-20]. The PMS specification is an attempt to codify the inner workings of Portage, and is authored by Stephen Bennett, Christian Faulhammer, Ciaran McCreesh and Ulrich Müller as a Gentoo-hosted project.
  
 
== Portage Profiles ==
 
== Portage Profiles ==
  
Portage uses [[Portage Profiles|profiles]] to define settings for various architectures and types of Funtoo/Gentoo systems. See the [[Portage Profiles]] page for detailed information on how Portage handles profiles.
+
Portage uses [[Portage Profiles|profiles]] to define settings for various architectures and types of Funtoo/Gentoo systems. See the [[Portage Profiles]] page for detailed information on how Portage handles profiles. Look at [[Creating_Profiles]] to learn how to create them and at [[Funtoo_1.0_Profile]] to learn about the Funtoo 1.0 profile.
  
== Portage Variables ==
+
==Portage Variables ==
  
 
Portage's behavior can be controlled by a number of configuration settings other variables that can be defined within the ebuild itself. In addition, a number of these variables are defined for the ebuild automatically by Portage. These variables are now documented on their own page: [[Portage Variables]].
 
Portage's behavior can be controlled by a number of configuration settings other variables that can be defined within the ebuild itself. In addition, a number of these variables are defined for the ebuild automatically by Portage. These variables are now documented on their own page: [[Portage Variables]].
 
 
== Multiple ABI Support ==
 
== Multiple ABI Support ==
  
Line 36: Line 45:
 
The Funtoo Core Team is currently working on a general-purpose plug-in system so that the GNU info file regeneration, news update display, and scanning of files that need updating in /etc can be pulled out of the official Portage emerge code. In addition, this plug-in system will allow other types of things to be hooked into various phases of emerge. This will allow various new plug-ins to be developed and used on systems, such as periodic security checks, etc.
 
The Funtoo Core Team is currently working on a general-purpose plug-in system so that the GNU info file regeneration, news update display, and scanning of files that need updating in /etc can be pulled out of the official Portage emerge code. In addition, this plug-in system will allow other types of things to be hooked into various phases of emerge. This will allow various new plug-ins to be developed and used on systems, such as periodic security checks, etc.
  
=== TODO ===
+
== Portage Logs ==
 +
Logs of portage actions can be found at <code>/var/log/emerge.log</code> & <code>/var/log/portage/elog/summary.log-(date the log is generated)</code>
 +
 
 +
== TODO ==
  
 
Add support to portage, so that when an ebuild is merged, the /var/db/pkg entry contains a list of all currently-installed versions of all ebuilds upon which that ebuild RDEPENDs. This, combined with a comprehensive set of past USE settings (may need to implement this too,) can be used to detect when an ebuild needs to be rebuilt. This could help to address issues like those in [http://bugs.gentoo.org/167662 Gentoo Bug 167662] and allow easier implementation of support for things like perl-cleaner. Currently, perl-cleaner doesn't detect that vim uses perl and moving from -ithreads to ithreads causes vim to die, so it needs to be manually rebuilt.
 
Add support to portage, so that when an ebuild is merged, the /var/db/pkg entry contains a list of all currently-installed versions of all ebuilds upon which that ebuild RDEPENDs. This, combined with a comprehensive set of past USE settings (may need to implement this too,) can be used to detect when an ebuild needs to be rebuilt. This could help to address issues like those in [http://bugs.gentoo.org/167662 Gentoo Bug 167662] and allow easier implementation of support for things like perl-cleaner. Currently, perl-cleaner doesn't detect that vim uses perl and moving from -ithreads to ithreads causes vim to die, so it needs to be manually rebuilt.
Line 44: Line 56:
 
== Funtoo Features/Changes ==
 
== Funtoo Features/Changes ==
  
=== Summary ===
+
=== In Funtoo stable/current Portage ===
  
In [https://github.com/funtoo/portage-funtoo/tree/thin-manifest the thin-manifest branch], Funtoo changes have been isolated into the following commits:
+
==== emerge --sync from git ====
 +
If a git-based Portage tree is already in place, <tt>emerge --sync</tt> will run "git pull" to update the underlying Portage tree. If one is not in place, the contents of the SYNC variable will be used as the remote URI from which to clone a git tree (2.2). In addition, SYNC_USER and SYNC_UMASK (defaulting to root and 022) can be used to define the user account to use for cloning/syncing, as well as the umask to use. (2.2).
  
<pre>
+
==== Sed Wrapper Symlink and PATH fix ====
e5a6649e094eb7230aa8f56d97fe303f77b158e9 preserve bindist through use expansion
+
The Funtoo version of Portage has replaced the BSD-only sed wrapper with a symlink. This will eventually be deprecated. The sed wrapper was a way to provide BSD systems with a "sed" command that could be used inside ebuilds that worked similarly to GNU sed. A PATH fix has been applied so that /bin/sed will be detected first anyway.
5a092fdae8afbff679350dc5d8818e10ab35fd80 safetydance feature
+
16887ddce712da8b61887f9bce70e19b95e75c25 core funtoo git-sync implementation
+
2c6e2b427a2aa179b61667caf89497818ec34ae2 run pwconv and grpconv after emerge completes to ensure /etc/shadow and /etc/gshadow are valid.
+
ea565da9ab5f54580f66814a17aca39d8e568732 funtoo-specific man page changes
+
c8f130fa4b332d87f2202ddaf0222b89018914d0 Funtoo config file changes. This includes stuff related to rsync as well as /lib/firmware
+
dba5a350e16043a6ff6281ea80fc02c8f56efd4f remove emerge-webrsync -- not supported in funtoo
+
0d9dda7b2b3165b268545e3e8eb44aa8d3c20a57 small ebuild.sh fix to not source any stray directories
+
8500043b3075d26c77a7ec1b8c2745373ca0c3b5 disable warning for use of *, -* in KEYWORDS
+
86ed81605e73b8b6d6b06fc60a9a0bc0c13ee429 protect firmware as well as modules
+
e7b6512e582fbcd9af0eb82c617549b101c8ae97 slashbeast's localpatch feature
+
5af34ad9334310c0926e52d9e1801ee170e12184 simplify path setting in ebuild.sh by using getpath() function
+
42789a70184343008c4cb1fe20bc4398e881d285 remove bin/ebuild-helpers/sed
+
</pre>
+
  
These commits do not yet include the unified-path/funtoo-profile 1.0 patches.
+
==== mini-manifest ====
 +
Funtoo's Portage supports a special mode of operation where Manifests only contain digests for distfiles and not for files in the Portage tree. This is to eliminate redundant digests since git already provides SHA1 digests. This feature is currently enabled by adding "mini-manifest" to FEATURES in /etc/make.conf but the intention is to eventually move it to a repo-specific option (note: this has now been done, as "thin-manifest" functionality has been integrated into recent versions of Portage, and is being beta tested in Funtoo.) Funtoo provides a special "mini-manifest" tree that is smaller than the full-size Portage tree, and is intended to be used with the mini-manifest feature.
  
=== In Funtoo stable/current Portage ===
+
==== preserve bindist through USE filtering ====
 +
Normally, anything not in an ebuild's IUSE is stripped from the USE passed to ebuild.sh. This patch allows "bindist" to not be stripped, so it can be used as a means to disable pre-merge sanity checks that may exist in pkg_setup() and pkg_pretend() but will not otherwise affect the resultant build. If "bindist" will affect some functionality in the package, then it should be added to an ebuild's IUSE. This patch allows pkg_setup() and pkg_pretend() to look for "bindist", which indicates that the ebuild is being built for release, typically in an automated fashion, and thus runtime sanity checks that might otherwise run can be optionally skipped. This check is used by the udev-160-r1.ebuild to see if we should fail if we are merging udev on a system where the kernel will not support it. In Metro, this is not a big deal, but on a ''real'' production system, merging the udev on an incompatible system will render the kernel inoperable.
 +
 
 +
==== safetydance FEATURE ====
 +
A new FEATURE setting is used by Funtoo's udev ebuild called "safetydance" which can be used to manually bypass sanity checks. This is an alternative to the "bindist" approach above. udev-160 in Funtoo Linux supports both approaches and Metro sets "safetydance" by default.
 +
 
 +
==== GLEP 55 removal ====
 +
Some code to support GLEP 55 has been removed.
 +
 
 +
==== new metadata format (experimental) ====
 +
Some tweaks to ebuild.sh have been made so that it is easier to support new metadata formats in the future.
 +
 
 +
==== xz-utils auto-dependency ====
 +
There are several ebuilds in the Gentoo Portage repository that use .xz files but do not explicitly depend on xz-utils. A workaround has been added to ebuild.sh to add this dependency to metadata automatically if a .xz file exists in SRC_URI. This change is not yet in the official Portage sources but is being used on the Funtoo side when generating our git-based Portage trees.
 +
 
 +
=== In current development version (2.3.8) ===
 +
 
 +
==== emerge-webrsync removed ====
 +
Gentoo Portage supports already tree syncing method via downloading a .tar.bz2 file containing all the ebuilds. Funtoo supports git syncing only, so the relevant code is removed.
 +
 
 +
==== SYNC_UMASK, SYNC_USER support ====
 +
SYNC_USER and SYNC_UMASK can be used to define the user account to use for cloning/syncing, as well as the umask to use.
 +
 
 +
==== pwconv & grpconv are run after emerge ====
 +
Portage runs pwconv & grpconv post-emerge to ensure /etc/shadow and /etc/gshadow are valid.
 +
 
 +
==== preserve bindist through USE filtering ====
 +
Normally, anything not in an ebuild's IUSE is stripped from the USE passed to ebuild.sh. This patch allows "bindist" to not be stripped, so it can be used as a means to disable pre-merge sanity checks that may exist in pkg_setup() and pkg_pretend() but will not otherwise affect the resultant build. If "bindist" will affect some functionality in the package, then it should be added to an ebuild's IUSE. This patch allows pkg_setup() and pkg_pretend() to look for "bindist", which indicates that the ebuild is being built for release, typically in an automated fashion, and thus runtime sanity checks that might otherwise run can be optionally skipped. This check is used by the udev-160-r1.ebuild to see if we should fail if we are merging udev on a system where the kernel will not support it. In Metro, this is not a big deal, but on a ''real'' production system, merging the udev on an incompatible system will render the kernel inoperable.
 +
 
 +
==== Dynamic SLOT support re-enabled ====
 +
The ebuilds are allowed to change their SLOT value during build.
 +
 
 +
==== Changes to repository configuration ====
 +
Starting with Portage-2.3.8, a switch to a new repository configuration framework is complete and users may want to update their configuration files. This document aims to describe the goals for the new framework and how to use it.
 +
 
 +
 
 +
;Multiple repository layout
 +
: One of the most important changes is the switch from the old ''overlay'' layout to a new cleaner ''repository'' system. The new layout is more flexible and more predictable. For example, repositories can now use resources (eclasses, for example) provided by other repositories.
 +
 
 +
The old layout was based on the concept of one ''main tree'' and optionally a number of overlays. The main tree provided base system ebuilds, eclasses, profiles, while overlays mostly were able to provide their own ebuilds. The ebuild provided by overlays overrode the ebuilds in main tree to the extend of making it impossible to install the main tree version. Overlays could also provide eclasses for their own ebuilds and package.* entries that applied to all overlays and to the main tree. The Package Manager is responsible for updating the main tree, while overlays are managed externally.
 +
 
 +
The new layout is based on the concept of one or more configurable repositories. Each repository can either be stand-alone or depend upon other repositories. The distribution provides a repository called ''funtoo'' (a drop-in replacement for Gentoo's ''gentoo'' repository). Users can install more repositories at they will, the repositories providing their own ebuilds, eclasses and profiles as necessary and/or using them from other repositories. Users can explicitly choose the repository they want to install packages from. The Package Manager can update all repositories.
 +
 
 +
==== Portage configuration for the new repository layout ====
 +
 
 +
;New repository layout
 +
: The repository configuration should be stored in <code>/etc/portage/repos.conf</code>. It can be either a single file or a directory containing one or more ''.conf'' files.
 +
 
 +
The default configuration is installed as <code>/usr/share/portage/config/repos.conf</code>. This file is internal configuration file installed with portage ebuild and should '''not''' be modified. Instead, the configuration in <code>/etc/portage/repos.conf</code> can override the defaults specified there.
 +
 
 +
The configuration uses format similar to Windows .ini files. Each section heading (repository name in square brackets) signifies a single repository, followed by one or more key-value option pairs. For example, the following file copies default configuration for Funtoo repository:
 +
 
 +
{{file|name=/etc/portage/repos.conf/funtoo.conf|desc=Example configuration override for Funtoo repository to move it to non-standard location|body=
 +
[funtoo]
 +
# moved to non-standard location!
 +
location = /var/db/repos/funtoo
 +
sync-type = git
 +
sync-uri = git://github.com/funtoo/ports-2015.git
 +
auto-sync = yes
 +
}}
 +
 
 +
The most useful repository configuration options are listed below:
 +
;location: ''Obligatory.'' Specifies the directory where repository is/will be stored. If Portage knows how to sync the repository and the location does not exist, it will be created on next ''emerge --sync''. Otherwise, the directory must exist.
 +
;priority: Specifies the priority used for ordering ebuilds from different repositories. If two repositories provide an ebuild with matching versions, the repository with higher priority will be used.
 +
;auto-sync: Specifies whether ''emerge --sync'' should update the repository. Defaults to ''yes'' if ''sync-type'' is specified, ''no'' otherwise.
 +
;sync-depth: Specifies ''--depth'' for git clone. Used only on initial sync. Defaults to 1. Can be set to 0 to force full clone (not pass ''--depth'' at all).
 +
;sync-type: Specifies syncing/update method. Can be one of: ''cvs'', ''git'', ''rsync'', ''svn''.
 +
;sync-umask: Specifies the umask used when updating/syncing the repository.
 +
;sync-uri: Specifies remote URI from which the repository will be cloned/synced. Can use any syntax valid for a particular syncing method.
 +
;sync-user: Specifies the user[:group] used to update/sync the repository. If ''FEATURES=usersync'' is used, defaults to the credentials of directory owner.
 +
 
 +
Additionally a <code>[DEFAULT]</code> section may be specified. Options in this section are used as defaults for all repositories.
 +
 
 +
;Migrating existing configurations
 +
: The new configuration format provides replacement for existing configuration done through <code>/etc/portage/make.conf</code> and environment variables. While the variables are still supported for backwards compatibility, users are recommended to move to the new configuration scheme. Funtoo portage ebuild is planned to  make the migration unattended (repos.conf installed automatically to ease the config steps) with the following file:
 +
 +
{{file|name=/etc/portage/repos.conf/funtoo.conf|body=
 +
[funtoo]
 +
location = /usr/portage
 +
sync-type = git
 +
sync-uri = git://github.com/funtoo/ports-2015.git
 +
auto-sync = yes
 +
}}
 +
The following replacements are provided for existing variables:
 +
;PORTDIR: Used to specify main tree location. Replaced by ''location'' key in the section corresponding to the default repository (<code>[funtoo]</code> by default).
 +
;PORTDIR_OVERLAY: Used to specify locations of overlays. Each of the paths needs to be replaced with a separate repository section, with the path placed in ''location'' key. Additionally, ''priority'' may be used to force specific ordering of ebuild overrides.
 +
;SYNC: Used to specify URI for syncing the main repository, also implied a protocol for doing that. Replaced by the ''sync-uri'' and ''sync-type'' keys in the default repository section.
 +
;SYNC_UMASK: Used to specify umask for syncing repositories. Replaced by ''sync-umask'' key in repository configuration. Can be specified in <code>[DEFAULT]</code> section to apply to all repositories.
 +
;SYNC_USER: Used to specify user credentials for syncing repositories. Replaced by ''sync-user'' key in repository configuration. Can be specified in <code>[DEFAULT]</code> section to apply to all repositories.
  
;emerge --sync from git
+
{{file|name=/etc/portage/make.conf|desc=Example old make.conf file|body=
:If a git-based Portage tree is already in place, <tt>emerge --sync</tt> will run "git pull" to update the underlying Portage tree. If one is not in place, the contents of the SYNC variable will be used as the remote URI from which to clone a git tree (2.2). In addition, SYNC_USER and SYNC_UMASK (defaulting to root and 022) can be used to define the user account to use for cloning/syncing, as well as the umask to use. (2.2).
+
# user changed PORTDIR location
 +
PORTDIR="/var/db/repos/funtoo"
 +
PORTDIR_OVERLAY="/var/db/repos/foo /var/db/repos/bar"
  
;Sed Wrapper Symlink and PATH fix
+
SYNC="git://github.com/funtoo/ports-2015.git"
: The Funtoo version of Portage has replaced the BSD-only sed wrapper with a symlink. This will eventually be deprecated. The sed wrapper was a way to provide BSD systems with a "sed" command that could be used inside ebuilds that worked similarly to GNU sed. A PATH fix has been applied so that /bin/sed will be detected first anyway.
+
SYNC_USER="oleg"
 +
SYNC_UMASK="022"
 +
}}
  
;mini-manifest
+
{{file|name=/etc/portage/repos.conf|desc=Replacement repos.conf file|body=
:Funtoo's Portage supports a special mode of operation where Manifests only contain digests for distfiles and not for files in the Portage tree. This is to eliminate redundant digests since git already provides SHA1 digests. This feature is currently enabled by adding "mini-manifest" to FEATURES in /etc/make.conf but the intention is to eventually move it to a repo-specific option (note: this has now been done, as "thin-manifest" functionality has been integrated into recent versions of Portage, and is being beta tested in Funtoo.) Funtoo provides a special "mini-manifest" tree that is smaller than the full-size Portage tree, and is intended to be used with the mini-manifest feature.
+
[DEFAULT]
 +
sync-user = oleg
 +
sync-umask = 022
  
;preserve bindist through USE filtering
+
[funtoo]
: Normally, anything not in an ebuild's IUSE is stripped from the USE passed to ebuild.sh. This patch allows "bindist" to not be stripped, so it can be used as a means to disable pre-merge sanity checks that may exist in pkg_setup() and pkg_pretend() but will not otherwise affect the resultant build. If "bindist" will affect some functionality in the package, then it should be added to an ebuild's IUSE. This patch allows pkg_setup() and pkg_pretend() to look for "bindist", which indicates that the ebuild is being built for release, typically in an automated fashion, and thus runtime sanity checks that might otherwise run can be optionally skipped. This check is used by the udev-160-r1.ebuild to see if we should fail if we are merging udev on a system where the kernel will not support it. In Metro, this is not a big deal, but on a ''real'' production system, merging the udev on an incompatible system will render the kernel inoperable.
+
location = /var/db/repos/funtoo
 +
sync-type = git
 +
sync-uri = git://github.com/funtoo/ports-2015.git
  
;safetydance FEATURE
+
[foo]
:A new FEATURE setting is used by Funtoo's udev ebuild called "safetydance" which can be used to manually bypass sanity checks. This is an alternative to the "bindist" approach above. udev-160 in Funtoo Linux supports both approaches and Metro sets "safetydance" by default.
+
location = /var/db/repos/foo
 +
priority = 1
  
;GLEP 55 removal
+
[bar]
:Some code to support GLEP 55 has been removed.
+
location = /var/db/repos/bar
 +
priority = 2
 +
}}
  
;new metadata format (experimental)
+
The <code>repos.conf</code> configuration can be further extended with ''sync-type'' and ''sync-uri'' for overlays to get ''emerge --sync'' updating them automatically.
:Some tweaks to ebuild.sh have been made so that it is easier to support new metadata formats in the future.
+
  
;xz-utils auto-dependency
+
let's see a real example of tree and overlays added.  
:There are several ebuilds in the Gentoo Portage repository that use .xz files but do not explicitly depend on xz-utils. A workaround has been added to ebuild.sh to add this dependency to metadata automatically if a .xz file exists in SRC_URI. This change is not yet in the official Portage sources but is being used on the Funtoo side when generating our git-based Portage trees.
+
{{file|name=/etc/portage/repos.conf|desc=Replacement repos.conf file|body=
  
 +
[gentoo]
 +
location = /usr/portage
 +
sync-type = git
 +
sync-uri = git://github.com/funtoo/ports-2012.git
 +
 +
[funtoo-overlay]
 +
location = /root/git/funtoo-overlay
 +
 +
[funtoo-gnome]
 +
location = /root/git/funtoo-gnome-overlay
 +
}}
 +
funtoo-overlay and funtoo-gnome-overlay are an overlays added on top of regular portage tree.
 
[[Category:Projects]]
 
[[Category:Projects]]
 
[[Category:Portage]]
 
[[Category:Portage]]
 +
{{EbuildFooter}}

Latest revision as of 01:08, February 27, 2015

sys-apps/portage


Current Maintainer(s):Daniel Robbins
Michał Górny
Oleg Vinichenko
Source Repository:Funtoo Overlay

Summary: This is the official package manager/ports system for Funtoo Linux.

Use Flags

epydoc
Build html API documentation with epydoc.
python3
Use python3 as Python interpreter.

News

Drobbins

Better Experiences: Ego and Vim

Info on Funtoo's new personality tool called 'ego', and user-focused updates to vim's defaults.
27 April 2015 by Drobbins
Drobbins

How We're Keeping You At the Center of the Funtoo Universe

Read about recent developments that keep you, our users, at the forefront of our focus as Funtoo moves forward.
10 April 2015 by Drobbins
Mgorny

New OpenGL management in Funtoo

Funtoo is switching to an improved system for managing multiple OpenGL providers (Mesa/Xorg, AMD and NVIDIA). The update may involve blockers and file collisions.
30 March 2015 by Mgorny
View More News...

Portage (Funtoo)

Tip

This is a wiki page. To edit it, Create a Funtoo account. Then log in and then click here to edit this page. See our editing guidelines to becoming a wiki-editing pro.

Introduction

Portage is the official package manager of Funtoo Linux. Daniel Robbins maintains a slightly different version from upstream Gentoo Linux, with support for mini-manifests and other features.

Portage Commands

emerge
high-level dependency-based package merge/unmerge tool
ebuild
lower-level package build tool
etc-update
dispatch-conf
tools to manage /etc/configurations

Portage Specifications

The latest progress and changes related to EAPI/PMS and Portage can often be found in the Gentoo Council meeting logs, which are listed on the Gentoo Council page.

The latest PMS specification to be approved by the Gentoo Council is available: eapi-5-approved-2012-09-20. The PMS specification is an attempt to codify the inner workings of Portage, and is authored by Stephen Bennett, Christian Faulhammer, Ciaran McCreesh and Ulrich Müller as a Gentoo-hosted project.

Portage Profiles

Portage uses profiles to define settings for various architectures and types of Funtoo/Gentoo systems. See the Portage Profiles page for detailed information on how Portage handles profiles. Look at Creating_Profiles to learn how to create them and at Funtoo_1.0_Profile to learn about the Funtoo 1.0 profile.

Portage Variables

Portage's behavior can be controlled by a number of configuration settings other variables that can be defined within the ebuild itself. In addition, a number of these variables are defined for the ebuild automatically by Portage. These variables are now documented on their own page: Portage Variables.

Multiple ABI Support

Portage contains support for multiple ABIs (Application Binary Interfaces) co-existing on the same system. This functionality has been extensively documented and has been moved to its own page: Multiple ABI Support.

Ebuild Functions

An ebuild developer has the ability to define Ebuild Functions that define steps to perform during a particular part of the ebuild lifecycle. These steps are now documented on their own page: Ebuild Functions.

Funtoo Portage Development

The Funtoo Core Team is currently working on a general-purpose plug-in system so that the GNU info file regeneration, news update display, and scanning of files that need updating in /etc can be pulled out of the official Portage emerge code. In addition, this plug-in system will allow other types of things to be hooked into various phases of emerge. This will allow various new plug-ins to be developed and used on systems, such as periodic security checks, etc.

Portage Logs

Logs of portage actions can be found at /var/log/emerge.log & /var/log/portage/elog/summary.log-(date the log is generated)

TODO

Add support to portage, so that when an ebuild is merged, the /var/db/pkg entry contains a list of all currently-installed versions of all ebuilds upon which that ebuild RDEPENDs. This, combined with a comprehensive set of past USE settings (may need to implement this too,) can be used to detect when an ebuild needs to be rebuilt. This could help to address issues like those in Gentoo Bug 167662 and allow easier implementation of support for things like perl-cleaner. Currently, perl-cleaner doesn't detect that vim uses perl and moving from -ithreads to ithreads causes vim to die, so it needs to be manually rebuilt.

Add support for portage to understand which version of a particular app is the "active" version that it was built against, and record this information in /var/db/pkg. This can help to implement perl-cleaner-like support in Portage.

Funtoo Features/Changes

In Funtoo stable/current Portage

emerge --sync from git

If a git-based Portage tree is already in place, emerge --sync will run "git pull" to update the underlying Portage tree. If one is not in place, the contents of the SYNC variable will be used as the remote URI from which to clone a git tree (2.2). In addition, SYNC_USER and SYNC_UMASK (defaulting to root and 022) can be used to define the user account to use for cloning/syncing, as well as the umask to use. (2.2).

Sed Wrapper Symlink and PATH fix

The Funtoo version of Portage has replaced the BSD-only sed wrapper with a symlink. This will eventually be deprecated. The sed wrapper was a way to provide BSD systems with a "sed" command that could be used inside ebuilds that worked similarly to GNU sed. A PATH fix has been applied so that /bin/sed will be detected first anyway.

mini-manifest

Funtoo's Portage supports a special mode of operation where Manifests only contain digests for distfiles and not for files in the Portage tree. This is to eliminate redundant digests since git already provides SHA1 digests. This feature is currently enabled by adding "mini-manifest" to FEATURES in /etc/make.conf but the intention is to eventually move it to a repo-specific option (note: this has now been done, as "thin-manifest" functionality has been integrated into recent versions of Portage, and is being beta tested in Funtoo.) Funtoo provides a special "mini-manifest" tree that is smaller than the full-size Portage tree, and is intended to be used with the mini-manifest feature.

preserve bindist through USE filtering

Normally, anything not in an ebuild's IUSE is stripped from the USE passed to ebuild.sh. This patch allows "bindist" to not be stripped, so it can be used as a means to disable pre-merge sanity checks that may exist in pkg_setup() and pkg_pretend() but will not otherwise affect the resultant build. If "bindist" will affect some functionality in the package, then it should be added to an ebuild's IUSE. This patch allows pkg_setup() and pkg_pretend() to look for "bindist", which indicates that the ebuild is being built for release, typically in an automated fashion, and thus runtime sanity checks that might otherwise run can be optionally skipped. This check is used by the udev-160-r1.ebuild to see if we should fail if we are merging udev on a system where the kernel will not support it. In Metro, this is not a big deal, but on a real production system, merging the udev on an incompatible system will render the kernel inoperable.

safetydance FEATURE

A new FEATURE setting is used by Funtoo's udev ebuild called "safetydance" which can be used to manually bypass sanity checks. This is an alternative to the "bindist" approach above. udev-160 in Funtoo Linux supports both approaches and Metro sets "safetydance" by default.

GLEP 55 removal

Some code to support GLEP 55 has been removed.

new metadata format (experimental)

Some tweaks to ebuild.sh have been made so that it is easier to support new metadata formats in the future.

xz-utils auto-dependency

There are several ebuilds in the Gentoo Portage repository that use .xz files but do not explicitly depend on xz-utils. A workaround has been added to ebuild.sh to add this dependency to metadata automatically if a .xz file exists in SRC_URI. This change is not yet in the official Portage sources but is being used on the Funtoo side when generating our git-based Portage trees.

In current development version (2.3.8)

emerge-webrsync removed

Gentoo Portage supports already tree syncing method via downloading a .tar.bz2 file containing all the ebuilds. Funtoo supports git syncing only, so the relevant code is removed.

SYNC_UMASK, SYNC_USER support

SYNC_USER and SYNC_UMASK can be used to define the user account to use for cloning/syncing, as well as the umask to use.

pwconv & grpconv are run after emerge

Portage runs pwconv & grpconv post-emerge to ensure /etc/shadow and /etc/gshadow are valid.

preserve bindist through USE filtering

Normally, anything not in an ebuild's IUSE is stripped from the USE passed to ebuild.sh. This patch allows "bindist" to not be stripped, so it can be used as a means to disable pre-merge sanity checks that may exist in pkg_setup() and pkg_pretend() but will not otherwise affect the resultant build. If "bindist" will affect some functionality in the package, then it should be added to an ebuild's IUSE. This patch allows pkg_setup() and pkg_pretend() to look for "bindist", which indicates that the ebuild is being built for release, typically in an automated fashion, and thus runtime sanity checks that might otherwise run can be optionally skipped. This check is used by the udev-160-r1.ebuild to see if we should fail if we are merging udev on a system where the kernel will not support it. In Metro, this is not a big deal, but on a real production system, merging the udev on an incompatible system will render the kernel inoperable.

Dynamic SLOT support re-enabled

The ebuilds are allowed to change their SLOT value during build.

Changes to repository configuration

Starting with Portage-2.3.8, a switch to a new repository configuration framework is complete and users may want to update their configuration files. This document aims to describe the goals for the new framework and how to use it.


Multiple repository layout
One of the most important changes is the switch from the old overlay layout to a new cleaner repository system. The new layout is more flexible and more predictable. For example, repositories can now use resources (eclasses, for example) provided by other repositories.

The old layout was based on the concept of one main tree and optionally a number of overlays. The main tree provided base system ebuilds, eclasses, profiles, while overlays mostly were able to provide their own ebuilds. The ebuild provided by overlays overrode the ebuilds in main tree to the extend of making it impossible to install the main tree version. Overlays could also provide eclasses for their own ebuilds and package.* entries that applied to all overlays and to the main tree. The Package Manager is responsible for updating the main tree, while overlays are managed externally.

The new layout is based on the concept of one or more configurable repositories. Each repository can either be stand-alone or depend upon other repositories. The distribution provides a repository called funtoo (a drop-in replacement for Gentoo's gentoo repository). Users can install more repositories at they will, the repositories providing their own ebuilds, eclasses and profiles as necessary and/or using them from other repositories. Users can explicitly choose the repository they want to install packages from. The Package Manager can update all repositories.

Portage configuration for the new repository layout

New repository layout
The repository configuration should be stored in /etc/portage/repos.conf. It can be either a single file or a directory containing one or more .conf files.

The default configuration is installed as /usr/share/portage/config/repos.conf. This file is internal configuration file installed with portage ebuild and should not be modified. Instead, the configuration in /etc/portage/repos.conf can override the defaults specified there.

The configuration uses format similar to Windows .ini files. Each section heading (repository name in square brackets) signifies a single repository, followed by one or more key-value option pairs. For example, the following file copies default configuration for Funtoo repository:

/etc/portage/repos.conf/funtoo.conf - Example configuration override for Funtoo repository to move it to non-standard location
[funtoo]
# moved to non-standard location!
location = /var/db/repos/funtoo
sync-type = git
sync-uri = git://github.com/funtoo/ports-2015.git
auto-sync = yes

The most useful repository configuration options are listed below:

location
Obligatory. Specifies the directory where repository is/will be stored. If Portage knows how to sync the repository and the location does not exist, it will be created on next emerge --sync. Otherwise, the directory must exist.
priority
Specifies the priority used for ordering ebuilds from different repositories. If two repositories provide an ebuild with matching versions, the repository with higher priority will be used.
auto-sync
Specifies whether emerge --sync should update the repository. Defaults to yes if sync-type is specified, no otherwise.
sync-depth
Specifies --depth for git clone. Used only on initial sync. Defaults to 1. Can be set to 0 to force full clone (not pass --depth at all).
sync-type
Specifies syncing/update method. Can be one of: cvs, git, rsync, svn.
sync-umask
Specifies the umask used when updating/syncing the repository.
sync-uri
Specifies remote URI from which the repository will be cloned/synced. Can use any syntax valid for a particular syncing method.
sync-user
Specifies the user[:group] used to update/sync the repository. If FEATURES=usersync is used, defaults to the credentials of directory owner.

Additionally a [DEFAULT] section may be specified. Options in this section are used as defaults for all repositories.

Migrating existing configurations
The new configuration format provides replacement for existing configuration done through /etc/portage/make.conf and environment variables. While the variables are still supported for backwards compatibility, users are recommended to move to the new configuration scheme. Funtoo portage ebuild is planned to make the migration unattended (repos.conf installed automatically to ease the config steps) with the following file:
/etc/portage/repos.conf/funtoo.conf
[funtoo]
location = /usr/portage
sync-type = git
sync-uri = git://github.com/funtoo/ports-2015.git
auto-sync = yes

The following replacements are provided for existing variables:

PORTDIR
Used to specify main tree location. Replaced by location key in the section corresponding to the default repository ([funtoo] by default).
PORTDIR_OVERLAY
Used to specify locations of overlays. Each of the paths needs to be replaced with a separate repository section, with the path placed in location key. Additionally, priority may be used to force specific ordering of ebuild overrides.
SYNC
Used to specify URI for syncing the main repository, also implied a protocol for doing that. Replaced by the sync-uri and sync-type keys in the default repository section.
SYNC_UMASK
Used to specify umask for syncing repositories. Replaced by sync-umask key in repository configuration. Can be specified in [DEFAULT] section to apply to all repositories.
SYNC_USER
Used to specify user credentials for syncing repositories. Replaced by sync-user key in repository configuration. Can be specified in [DEFAULT] section to apply to all repositories.
/etc/portage/make.conf - Example old make.conf file
# user changed PORTDIR location
PORTDIR="/var/db/repos/funtoo"
PORTDIR_OVERLAY="/var/db/repos/foo /var/db/repos/bar"

SYNC="git://github.com/funtoo/ports-2015.git"
SYNC_USER="oleg"
SYNC_UMASK="022"
/etc/portage/repos.conf - Replacement repos.conf file
[DEFAULT]
sync-user = oleg
sync-umask = 022

[funtoo]
location = /var/db/repos/funtoo
sync-type = git
sync-uri = git://github.com/funtoo/ports-2015.git

[foo]
location = /var/db/repos/foo
priority = 1

[bar]
location = /var/db/repos/bar
priority = 2

The repos.conf configuration can be further extended with sync-type and sync-uri for overlays to get emerge --sync updating them automatically.

let's see a real example of tree and overlays added.

/etc/portage/repos.conf - Replacement repos.conf file
[gentoo]
location = /usr/portage
sync-type = git
sync-uri = git://github.com/funtoo/ports-2012.git
 
[funtoo-overlay]
location = /root/git/funtoo-overlay
 
[funtoo-gnome]
location = /root/git/funtoo-gnome-overlay

funtoo-overlay and funtoo-gnome-overlay are an overlays added on top of regular portage tree.