eval $__export_funcs_var+=\" $*\"
}
-# adds all parameters to E_DEPEND and E_RDEPEND, which get added to DEPEND
-# and RDEPEND after the ebuild has been processed. This is important to
-# allow users to use DEPEND="foo" without frying dependencies added by an
-# earlier inherit. It also allows RDEPEND to work properly, since a lot
-# of ebuilds assume that an unset RDEPEND gets its value from DEPEND.
-# Without eclasses, this is true. But with them, the eclass may set
-# RDEPEND itself (or at least used to) which would prevent RDEPEND from
-# getting its value from DEPEND. This is a side-effect that made eclasses
-# have unreliable dependencies.
-
-newdepend() {
- debug-print-function newdepend $*
- debug-print "newdepend: E_DEPEND=$E_DEPEND E_RDEPEND=$E_RDEPEND"
-
- while [ -n "$1" ]; do
- case $1 in
- "/autotools")
- do_newdepend DEPEND sys-devel/autoconf sys-devel/automake sys-devel/make
- ;;
- "/c")
- do_newdepend DEPEND sys-devel/gcc virtual/libc
- do_newdepend RDEPEND virtual/libc
- ;;
- *)
- do_newdepend DEPEND $1
- ;;
- esac
- shift
- done
-}
-
-newrdepend() {
- debug-print-function newrdepend $*
- do_newdepend RDEPEND $1
-}
-
-newpdepend() {
- debug-print-function newpdepend $*
- do_newdepend PDEPEND $1
-}
-
-do_newdepend() {
- # This function does a generic change determining whether we're in an
- # eclass or not. If we are, we change the E_* variables for deps.
- debug-print-function do_newdepend $*
- [ -z "$1" ] && die "do_newdepend without arguments"
-
- # Grab what we're affecting... Figure out if we're affecting eclasses.
- [[ ${ECLASS_DEPTH} > 0 ]] && TARGET="E_$1"
- [[ ${ECLASS_DEPTH} > 0 ]] || TARGET="$1"
- shift # $1 was a variable name.
-
- while [ -n "$1" ]; do
- # This bit of evil takes TARGET and uses it to evaluate down to a
- # variable. This is a sneaky way to make this infinately expandable.
- # The normal translation of this would look something like this:
- # E_DEPEND="${E_DEPEND} $1" :::::: Cool, huh? :)
- eval export ${TARGET}=\"\${${TARGET}} \$1\"
- shift
- done
-}
-
# this is a function for removing any directory matching a passed in pattern from
# PATH
remove_path_entry() {
handler might be changed in future versions.</para></footnote>.
That option defines which handler class should be used to
create the set. Other universal options available for single sets are:
+ </para>
<itemizedlist>
- <listitem><varname>name</varname> (which is usually not needed as the name
+ <listitem><para><varname>name</varname> (which is usually not needed as the name
of the set is generated from the section name if <varname>name</varname>
- is missing)</listitem>
- <listitem><varname>world-candidate</varname>, which determines if
- given package should be added to the <varname>world</varname> set</listitem>
- <listitem><varname>extend</varname> to include the contents of other package sets
+ is missing)</para></listitem>
+ <listitem><para><varname>world-candidate</varname>, which determines if
+ given package should be added to the <varname>world</varname> set</para></listitem>
+ <listitem><para><varname>extend</varname> to include the contents of other package sets</para>
</listitem>
- <listitem><varname>remove</varname> to remove the contents of other package sets
+ <listitem><para><varname>remove</varname> to remove the contents of other package sets</para>
</listitem>
- <listitem><varname>intersect</varname> to only include packages that are also
- included in one or more other package sets</listitem>
+ <listitem><para><varname>intersect</varname> to only include packages that are also
+ included in one or more other package sets</para></listitem>
</itemizedlist>
+ <para>
Some handler classes might require additional options for their configuration,
these will be covered later in this chapter.
</para>
For descriptive purposes the file can be accompanied by a file with the
same name plus a <filename>.metadata</filename> suffix which can contain
metadata sections for description, author, location and so on. Each section
- has the form <msgtext>key: value</msgtext> where <varname>value</varname>
+ has the form key: value where <varname>value</varname>
can contain multiple lines. Therefore sections have to be separated by
blank lines. For example:
<programlisting>
<title>Single Set Configuration</title>
<para>
In a single set configuration this class supports the following options:
+ </para>
<itemizedlist>
- <listitem><varname>filename</varname>: Required. Specifies the path to the file
- that should be used for the package set.</listitem>
- <listitem><varname>greedy</varname>: Optional, defaults to <parameter>false</parameter>.
+ <listitem><para><varname>filename</varname>: Required. Specifies the path to the file
+ that should be used for the package set.</para></listitem>
+ <listitem><para><varname>greedy</varname>: Optional, defaults to <parameter>false</parameter>.
Determines if atoms in the package should include all installed slots (when set to
<parameter>true</parameter>) or if no slot expansion is wanted (when set to
<parameter>false</parameter>). This option only affects packages that have multiple
- slots available (e.g. <parameter>sys-kernel/gentoo-sources</parameter>).</listitem>
+ slots available (e.g. <parameter>sys-kernel/gentoo-sources</parameter>).</para></listitem>
</itemizedlist>
- </para>
</sect3>
<sect3>
<title>Multi Set Configuration</title>
<para>
In a multi set configuration this class supports the following options:
+ </para>
<itemizedlist>
- <listitem><varname>directory</varname>: Optional, defaults to
+ <listitem><para><varname>directory</varname>: Optional, defaults to
<filename>/etc/portage/sets</filename>. Specifies the path to a directory
containing package set files. For each file (excluding metadata files) in
- that location a separate package set is created.
+ that location a separate package set is created.</para>
</listitem>
- <listitem><varname>name_pattern</varname>: Optional, defaults to
+ <listitem><para><varname>name_pattern</varname>: Optional, defaults to
<parameter>$name</parameter>. This describes the naming pattern
to be used for creating the sets. It must contain either
<parameter>$name</parameter> or <parameter>${name}</parameter>, which
- will be replaced by the filename (without any directory components).
+ will be replaced by the filename (without any directory components).</para>
</listitem>
</itemizedlist>
- </para>
</sect3>
</sect2>
<title>Single Set Configuration</title>
<para>
In a single set configuration this class supports the following options:
+ </para>
<itemizedlist>
- <listitem><varname>filename</varname>: See
- <xref linkend='config-set-classes-StaticFileSet'>StaticFileSet</xref>
+ <listitem><para><varname>filename</varname>: See
+ <xref linkend='config-set-classes-StaticFileSet'/>StaticFileSet</para>
</listitem>
</itemizedlist>
- </para>
</sect3>
<sect3>
<title>Multi Set Configuration</title>
<para>
In a multi set configuration this class supports the following options:
+ </para>
<itemizedlist>
- <listitem><varname>directory</varname>: Optional, defaults to
+ <listitem><para><varname>directory</varname>: Optional, defaults to
<filename>/etc/portage</filename>. Specifies the path to a directory
containing one or more of the following portage configuration files:
<filename>package.use</filename>, <filename>package.keywords</filename>,
<filename>package.mask</filename> or <filename>package.unmask</filename>.
- No other files in that directory will be used.
+ No other files in that directory will be used.</para>
</listitem>
- <listitem><varname>name_pattern</varname>: Optional, defaults to
+ <listitem><para><varname>name_pattern</varname>: Optional, defaults to
<parameter>package_$suffix</parameter>. This describes the naming
pattern to be used for creating the sets. It must contain either
<parameter>$suffix</parameter> or <parameter>${suffix}</parameter>,
which will be replaced by the file suffix (e.g.
- <parameter>use</parameter> or <parameter>mask</parameter>).
+ <parameter>use</parameter> or <parameter>mask</parameter>).</para>
</listitem>
</itemizedlist>
- </para>
</sect3>
</sect2>
<title>Single Set Configuration</title>
<para>
In single set configurations this class supports the following options:
+ </para>
<itemizedlist>
- <listitem><varname>use_emerge_resolver</varname>: Optional, defaults to
+ <listitem><para><varname>use_emerge_resolver</varname>: Optional, defaults to
<parameter>false</parameter>. This option determines which resolver
strategy should be used for the set atoms. When set to
<parameter>true</parameter>, it will use the default emerge algorithm
and use the highest visible version that matches the GLSA. If set
to <parameter>false</parameter> it will use the default glsa-check
algorithm and use the lowest version that matches the GLSA and is
- higher than the currently installed version (least change policy).
+ higher than the currently installed version (least change policy).</para>
</listitem>
</itemizedlist>
- </para>
</sect3>
</sect2>
<sect2 id='config-set-classes-NewGlsaSet'>
<title>portage.sets.security.NewGlsaSet</title>
<para>
- Like <xref linkend='config-set-classes-SecuritySet'>SecuritySet</xref>,
+ Like <xref linkend='config-set-classes-SecuritySet'/>SecuritySet,
but ignores all GLSAs that were already applied or injected previously.
</para>
<para>
In single set configurations this class supports the following options:
<itemizedlist>
- <listitem><varname>use_emerge_resolver</varname>: See
- <xref linkend='config-set-classes-SecuritySet'>SecuritySet</xref>
+ <listitem><para><varname>use_emerge_resolver</varname>: See
+ <xref linkend='config-set-classes-SecuritySet'/>SecuritySet</para>
</listitem>
</itemizedlist>
</para>
<sect2 id='config-set-classes-NewAffectedSet'>
<title>portage.sets.security.NewAffectedSet</title>
<para>
- Like <xref linkend='config-set-classes-SecuritySet'>SecuritySet</xref>,
+ Like <xref linkend='config-set-classes-SecuritySet'/>SecuritySet,
but ignores all GLSAs that were already applied or injected previously,
and all GLSAs that don't affect the current system. Practically there
should be no difference to <classname>NewGlsaSet</classname> though.
<title>Single Set Configuration</title>
<para>
In single set configurations this class supports the following options:
+ </para>
<itemizedlist>
- <listitem><varname>use_emerge_resolver</varname>: See
- <xref linkend='config-set-classes-SecuritySet'>SecuritySet</xref>
+ <listitem><para><varname>use_emerge_resolver</varname>: See
+ <xref linkend='config-set-classes-SecuritySet'/>SecuritySet</para>
</listitem>
</itemizedlist>
- </para>
</sect3>
</sect2>
<sect2 id='config-set-classes-AffectedSet'>
<title>portage.sets.security.AffectedSet</title>
<para>
- Like <xref linkend='config-set-classes-SecuritySet'>SecuritySet</xref>,
+ Like <xref linkend='config-set-classes-SecuritySet'/>SecuritySet,
but ignores all GLSAs that don't affect the current system. Practically
there should be no difference to <classname>SecuritySet</classname> though.
</para>
<title>Single Set Configuration</title>
<para>
In single set configurations this class supports the following options:
+ </para>
<itemizedlist>
- <listitem><varname>use_emerge_resolver</varname>: See
- <xref linkend='config-set-classes-SecuritySet'>SecuritySet</xref>
+ <listitem><para><varname>use_emerge_resolver</varname>: See
+ <xref linkend='config-set-classes-SecuritySet'/>SecuritySet</para>
</listitem>
</itemizedlist>
- </para>
</sect3>
</sect2>
<title>Single Set Configuration</title>
<para>
In single set configurations this class supports the following options:
+ </para>
<itemizedlist>
- <listitem><varname>command</varname>: Required. Specifies the command
+ <listitem><para><varname>command</varname>: Required. Specifies the command
that should be executed to generate the package set. It should
output a newline separated list of simple and/or versioned atoms
- on stdout.
+ on stdout.</para>
</listitem>
</itemizedlist>
- </para>
</sect3>
</sect2>
<title>Single Set Configuration</title>
<para>
In single set configurations this class supports the following options:
+ </para>
<itemizedlist>
- <listitem><varname>age</varname>: Optional, defaults to 7. Specifies
- the number of days passed since installation to use as cut-off point.
+ <listitem><para><varname>age</varname>: Optional, defaults to 7. Specifies
+ the number of days passed since installation to use as cut-off point.</para>
</listitem>
- <listitem><varname>mode</varname>: Optional, defaults to "older". Must
+ <listitem><para><varname>mode</varname>: Optional, defaults to "older". Must
be either "older" or "newer" to select packages installed either
before resp. after the cut-off-date given by <varname>age</varname>.
E.g. the defaults will select all installed packages that have been
- installed more than one week ago.
+ installed more than one week ago.</para>
</listitem>
</itemizedlist>
- </para>
</sect3>
</sect2>
<title>Single Set Configuration</title>
<para>
In single set configurations this class supports the following options:
+ </para>
<itemizedlist>
- <listitem><varname>category</varname>: Required. The name of an existing ebuild
- category which should be used to create the package set.
+ <listitem><para><varname>category</varname>: Required. The name of an existing ebuild
+ category which should be used to create the package set.</para>
</listitem>
- <listitem><varname>only_visible</varname>: Optional, defaults to <parameter>true</parameter>.
+ <listitem><para><varname>only_visible</varname>: Optional, defaults to <parameter>true</parameter>.
When set to <parameter>true</parameter> the set will only include visible packages,
when set to <parameter>false</parameter> it will also include masked packages.
It's currently only effective in combination with the <parameter>porttree</parameter>
- repository.
+ repository.</para>
</listitem>
</itemizedlist>
- </para>
</sect3>
<sect3>
<title>Multi Set Configuration</title>
<para>
In multi set configurations this class supports the following options:
+ </para>
<itemizedlist>
- <listitem><varname>categories</varname>: Optional, defaults to all categories.
+ <listitem><para><varname>categories</varname>: Optional, defaults to all categories.
If set it must be a space separated list of existing ebuild categories for
- which package sets should be created.
+ which package sets should be created.</para>
</listitem>
- <listitem><varname>repository</varname>: See previous section.</listitem>
- <listitem><varname>only_visible</varname>: See previous section.</listitem>
- <listitem><varname>name_pattern</varname>: Optional, defaults to
+ <listitem><para><varname>repository</varname>: See previous section.</para></listitem>
+ <listitem><para><varname>only_visible</varname>: See previous section.</para></listitem>
+ <listitem><para><varname>name_pattern</varname>: Optional, defaults to
<parameter>$category/*</parameter>. This describes the naming pattern
to be used for creating the sets. It must contain either
<parameter>$category</parameter> or <parameter>${category}</parameter>, which
- will be replaced by the category name.
+ will be replaced by the category name.</para>
</listitem>
</itemizedlist>
- </para>
</sect3>
</sect2>
Package set which contains all packages
that own one or more files.
This class supports the following options:
+ </para>
<itemizedlist>
- <listitem><varname>files</varname>: Required. A list of file paths
- that should be used to create the package set.
+ <listitem><para><varname>files</varname>: Required. A list of file paths
+ that should be used to create the package set.</para>
</listitem>
</itemizedlist>
- </para>
</sect2>
<sect2 id='config-set-classes-VariableSet'>
<title>portage.sets.dbapi.VariableSet</title>
Package set which contains all packages
that match specified values of specified variable.
This class supports the following options:
+ </para>
<itemizedlist>
- <listitem><varname>variable</varname>: The name of
- the specified variable whose values are checked.
+ <listitem><para><varname>variable</varname>: The name of
+ the specified variable whose values are checked.</para>
</listitem>
- <listitem><varname>includes</varname>: A list of
+ <listitem><para><varname>includes</varname>: A list of
values that must be contained within the specified
- variable.
+ variable.</para>
</listitem>
- <listitem><varname>excludes</varname>: A list of
+ <listitem><para><varname>excludes</varname>: A list of
values that must not be contained within the specified
- variable.
+ variable.</para>
</listitem>
- <listitem><varname>metadata-source</varname>: Optional, defaults to
+ <listitem><para><varname>metadata-source</varname>: Optional, defaults to
"vartree". Specifies the repository to use for getting the metadata
- to check.</listitem>
+ to check.</para></listitem>
</itemizedlist>
- </para>
</sect2>
<sect2 id='config-set-classes-UnavailableSet'>
<title>portage.sets.dbapi.UnavailableSet</title>
packages for which there are no visible ebuilds
corresponding to the same $CATEGORY/$PN:$SLOT.
This class supports the following options:
+ </para>
<itemizedlist>
- <listitem><varname>metadata-source</varname>: Optional, defaults to
+ <listitem><para><varname>metadata-source</varname>: Optional, defaults to
"porttree". Specifies the repository to use for getting the metadata
- to check.</listitem>
+ to check.</para></listitem>
</itemizedlist>
- </para>
</sect2>
<sect2 id='config-set-classes-DowngradeSet'>
<title>portage.sets.dbapi.DowngradeSet</title>
<title>Single Set Configuration</title>
<para>
This class supports the following option:
+ </para>
<itemizedlist>
- <listitem><varname>debug</varname>: Generate extra output useful to figure out why
- certain packages are included in the set, as it's not always obvious.
+ <listitem><para><varname>debug</varname>: Generate extra output useful to figure out why
+ certain packages are included in the set, as it's not always obvious.</para>
</listitem>
</itemizedlist>
- </para>
</sect3>
</sect2>
</sect1>
</para>
<para>
The default sets are:
+ </para>
<itemizedlist>
- <listitem><varname>system</varname>: uses <classname>PackagesSystemSet</classname></listitem>
- <listitem><varname>world</varname>: uses <classname>WorldSet</classname></listitem>
- <listitem><varname>security</varname>: uses <classname>NewAffectedSet</classname> with default options</listitem>
- <listitem><varname>installed</varname>: uses <classname>EverythingSet</classname></listitem>
- <listitem><varname>preserved-rebuild</varname>: uses <classname>PreservedLibraryConsumerSet</classname></listitem>
- <listitem><varname>live-rebuild</varname>: uses <classname>VariableSet</classname></listitem>
- <listitem><varname>module-rebuild</varname>: uses <classname>OwnerSet</classname></listitem>
- <listitem><varname>downgrade</varname>: uses <classname>DowngradeSet</classname></listitem>
- <listitem><varname>unavailable</varname>: uses <classname>UnavailableSet</classname></listitem>
+ <listitem><para><varname>system</varname>: uses <classname>PackagesSystemSet</classname></para></listitem>
+ <listitem><para><varname>world</varname>: uses <classname>WorldSet</classname></para></listitem>
+ <listitem><para><varname>security</varname>: uses <classname>NewAffectedSet</classname> with default options</para></listitem>
+ <listitem><para><varname>installed</varname>: uses <classname>EverythingSet</classname></para></listitem>
+ <listitem><para><varname>preserved-rebuild</varname>: uses <classname>PreservedLibraryConsumerSet</classname></para></listitem>
+ <listitem><para><varname>live-rebuild</varname>: uses <classname>VariableSet</classname></para></listitem>
+ <listitem><para><varname>module-rebuild</varname>: uses <classname>OwnerSet</classname></para></listitem>
+ <listitem><para><varname>downgrade</varname>: uses <classname>DowngradeSet</classname></para></listitem>
+ <listitem><para><varname>unavailable</varname>: uses <classname>UnavailableSet</classname></para></listitem>
</itemizedlist>
- Additionally the default configuration includes a multi set section based on
+ <para>Additionally the default configuration includes a multi set section based on
the <classname>StaticFileSet</classname> defaults that creates a set for each
- file in <filename>/etc/portage/sets</filename> for convenience.
- </para>
+ file in <filename>/etc/portage/sets</filename> for convenience.</para>
</sect1>
</chapter>
to satisfy constraints and minimize cost. The
following package states influence the cost calculation for
a given combination:
+ </para>
<itemizedlist>
<listitem>
- installed
+ <para>installed</para>
</listitem>
<listitem>
- selected (for installation)
+ <para>selected (for installation)</para>
</listitem>
<listitem>
- not selected (for installation)
+ <para>not selected (for installation)</para>
</listitem>
</itemizedlist>
- </para>
<para>
In cost calculations, virtual packages by themselves are
considered to cost nothing since they do not directly install anything.
<para>
Dependency resolution involves satisfaction of
many constraints:
+ </para>
<itemizedlist>
<listitem>
- Persistent configuration parameters, like those that come from
- make.profile, make.conf, and the /etc/portage directory.
+ <para>Persistent configuration parameters, like those that come from
+ make.profile, make.conf, and the /etc/portage directory.</para>
</listitem>
<listitem>
- Current command parameters, which may include options, atoms, or sets.
+ <para>Current command parameters, which may include options, atoms, or sets.</para>
</listitem>
<listitem>
- <link linkend='dependency-resolution-package-modeling-constraint-satisfaction-package-dependencies'>
- Package Dependencies</link>
+ <para><link linkend='dependency-resolution-package-modeling-constraint-satisfaction-package-dependencies'>
+ Package Dependencies</link></para>
</listitem>
</itemizedlist>
- </para>
</sect2>
<sect2 id='dependency-resolution-package-modeling-constraint-satisfaction-package-dependencies'>
<title>Package Dependencies</title>
<para>
Common types of package dependencies:
+ </para>
<itemizedlist>
<listitem>
- Files required for building or installing. Downloads may
- be necessary to satisfy these.
+ <para>Files required for building or installing. Downloads may
+ be necessary to satisfy these.</para>
</listitem>
<listitem>
- Other packages required to be installed for
- buildtime or runtime.
+ <para>Other packages required to be installed for
+ buildtime or runtime.</para>
</listitem>
<listitem>
- Blockers that prevent conflicting packages from being installed
- simultaneously.
+ <para>Blockers that prevent conflicting packages from being installed
+ simultaneously.</para>
</listitem>
</itemizedlist>
- </para>
</sect2>
</sect1>
rather than replaced. The following constraints
protect inappropriate packages from being chosen for automatic
uninstallation:
+ </para>
<itemizedlist>
<listitem>
- Installed packages that have been pulled into the current dependency
+ <para>Installed packages that have been pulled into the current dependency
graph will not be uninstalled. Due to
<link linkend='dependency-resolution-package-modeling-dependency-neglection'>
dependency neglection</link> and special properties of packages
in the "system" set, other checks may be necessary in order
- to protect inappropriate packages from being uninstalled.
+ to protect inappropriate packages from being uninstalled.</para>
</listitem>
<listitem>
- An installed package that is matched by a dependency atom from the
+ <para>An installed package that is matched by a dependency atom from the
"system" set will not be uninstalled in advance since it might not
- be safe. Such a package will only be uninstalled through replacement.
+ be safe. Such a package will only be uninstalled through replacement.</para>
</listitem>
<listitem>
- An installed package that is matched by a dependency atom from the
+ <para>An installed package that is matched by a dependency atom from the
"world" set will not be uninstalled if the dependency graph does not
contain a replacement package that is matched by the same dependency
- atom.
+ atom.</para>
</listitem>
</itemizedlist>
- </para>
<para>
In order to ensure that package files remain installed in a usable state
whenever possible, uninstallation operations are not executed
</para>
<para>
The function names for the ebuild phases, listed in order of execution:
+ </para>
<itemizedlist>
<listitem>
- pkg_setup
+ <para>pkg_setup</para>
</listitem>
<listitem>
- src_unpack
+ <para>src_unpack</para>
</listitem>
<listitem>
- src_compile
+ <para>src_compile</para>
</listitem>
<listitem>
- src_test
+ <para>src_test</para>
</listitem>
<listitem>
- src_install
+ <para>src_install</para>
</listitem>
<listitem>
- pkg_preinst
+ <para>pkg_preinst</para>
</listitem>
<listitem>
- pkg_postinst
+ <para>pkg_postinst</para>
</listitem>
<listitem>
- pkg_prerm
+ <para>pkg_prerm</para>
</listitem>
<listitem>
- pkg_postrm
+ <para>pkg_postrm</para>
</listitem>
</itemizedlist>
- </para>
<section id='package-ebuild-phases-previous-installed'>
<title>Interaction with previous installed version</title>
<para>
</para>
<section id='package-ebuild-phases-before-2.1.5'>
<title>Upgrade/downgrade order used by versions less than 2.1.5 (deprecated)</title>
- <para>
<itemizedlist>
<listitem>
- pkg_preinst
+ <para>pkg_preinst</para>
</listitem>
<listitem>
- pkg_postinst
+ <para>pkg_postinst</para>
</listitem>
<listitem>
- pkg_prerm
+ <para>pkg_prerm</para>
</listitem>
<listitem>
- pkg_postrm
+ <para>pkg_postrm</para>
</listitem>
</itemizedlist>
- </para>
</section>
<section id='package-ebuild-phases-after-2.1.5'>
<title>Upgrade/downgrade order starting with version 2.1.5</title>
The new order for upgrades and downgrades is identical to the order used
for reinstall operations:
</para>
- <para>
<itemizedlist>
<listitem>
- pkg_preinst
+ <para>pkg_preinst</para>
</listitem>
<listitem>
- pkg_prerm
+ <para>pkg_prerm</para>
</listitem>
<listitem>
- pkg_postrm
+ <para>pkg_postrm</para>
</listitem>
<listitem>
- pkg_postinst
+ <para>pkg_postinst</para>
</listitem>
</itemizedlist>
- </para>
<para>
Now that pkg_postinst is called after all other phases, it's not possible to
call has_version in pkg_postinst to detect whether the current install
version when linking. The system linker will find the static library first
and not bother searching for a dynamic version. To overcome this, you need
to use the <command>gen_usr_ldscript</command> function found in the
- <funcsynopsisinfo>toolchain-funcs.eclass</funcsynopsisinfo>. Refer to the
+ toolchain-funcs.eclass. Refer to the
man page for information on how to use it. See this
<ulink url="http://bugs.gentoo.org/4411">bug report</ulink> for some history
on this issue.
</para>
<para>
You may be able to cheat and use the <command>elibtoolize</command> function
- in the <funcsynopsisinfo>libtool.eclass</funcsynopsisinfo>. However, if
+ in the libtool.eclass. However, if
that does not help, you will probably need to regenerate all of the autotool
files.
</para>
Fetch everything in \fBSRC_URI\fR regardless of \fBUSE\fR settings,
except do not fetch anything when \fImirror\fR is in \fBRESTRICT\fR.
.TP
+.B multilib\-strict
+Many Makefiles assume that their libraries should go to /usr/lib, or
+$(prefix)/lib. This assumption can cause a serious mess if /usr/lib
+isn't a symlink to /usr/lib64. To find the bad packages, we have a
+portage feature called \fImultilib\-strict\fR. It will prevent emerge
+from putting 64bit libraries into anything other than (/usr)/lib64.
+.TP
.B noauto
When utilizing \fBebuild\fR(1), only run the function requested.
.TP
If \fIcollision\-protect\fR is enabled then it takes precedence over
\fIprotect\-owned\fR.
.TP
+.B python\-trace
+Output a verbose trace of python execution to stderr when a command's
+\-\-debug option is enabled.
+.TP
.B sandbox
Enable sandbox\-ing when running \fBemerge\fR(1) and \fBebuild\fR(1).
.TP
from portage.cache.template import reconstruct_eclasses
from portage.util import writemsg, apply_secpass_permissions
from portage.data import portage_gid
+from portage.localization import _
try:
import sqlite3 as db_module # sqlite3 is optional with >=python-2.5
except ImportError:
if self._db_table_exists(v["table_name"]):
create_statement = self._db_table_get_create(v["table_name"])
if create_statement != v["create"]:
- writemsg("sqlite: dropping old table: %s\n" % v["table_name"])
+ writemsg(_("sqlite: dropping old table: %s\n") % v["table_name"])
cursor.execute("DROP TABLE %s" % v["table_name"])
cursor.execute(v["create"])
else:
from itertools import chain
from portage.cache import cache_errors
+from portage.localization import _
def mirror_cache(valid_nodes_iterable, src_cache, trg_cache, eclass_cache=None, verbose_instance=None):
eapi_supported = eapi_is_supported(eapi)
if not eapi_supported:
if not _validate_cache_for_unsupported_eapis:
- noise.misc(x, "unable to validate cache for EAPI='%s'" % eapi)
+ noise.misc(x, _("unable to validate cache for EAPI='%s'") % eapi)
continue
write_it = True
)
from portage import auxdbkeys, dep_expand
+from portage.localization import _
class dbapi(object):
_category_re = re.compile(r'^\w[-.+\w]*$')
def invalidentry(self, mypath):
if mypath.endswith('portage_lockfile'):
if "PORTAGE_MASTER_PID" not in os.environ:
- writemsg("Lockfile removed: %s\n" % mypath, 1)
+ writemsg(_("Lockfile removed: %s\n") % mypath, 1)
unlockfile((mypath, None, None))
else:
# Nothing we can do about it. We're probably sandboxed.
pass
elif '/-MERGING-' in mypath:
if os.path.exists(mypath):
- writemsg(colorize("BAD","INCOMPLETE MERGE:")+" %s\n" % mypath,
+ writemsg(colorize("BAD", _("INCOMPLETE MERGE:"))+" %s\n" % mypath,
noiselevel=-1)
else:
writemsg("!!! Invalid db entry: %s\n" % mypath, noiselevel=-1)
from portage.exception import InvalidPackageName, \
PermissionDenied, PortageException
from portage.const import EAPI
+from portage.localization import _
from portage import dep_expand, listdir, _check_distfile, _movefile
mynewpkg = mynewcpv.split("/")[1]
if (mynewpkg != myoldpkg) and os.path.exists(self.getname(mynewcpv)):
- writemsg("!!! Cannot update binary: Destination exists.\n",
+ writemsg(_("!!! Cannot update binary: Destination exists.\n"),
noiselevel=-1)
writemsg("!!! "+mycpv+" -> "+mynewcpv+"\n", noiselevel=-1)
continue
tbz2path = self.getname(mycpv)
if os.path.exists(tbz2path) and not os.access(tbz2path,os.W_OK):
- writemsg("!!! Cannot update readonly binary: "+mycpv+"\n",
+ writemsg(_("!!! Cannot update readonly binary: %s\n") % mycpv,
noiselevel=-1)
continue
self.dbapi._aux_cache[mycpv] = aux_cache
continue
if not os.access(full_path, os.R_OK):
- writemsg("!!! Permission denied to read " + \
- "binary package: '%s'\n" % full_path,
+ writemsg(_("!!! Permission denied to read " \
+ "binary package: '%s'\n") % full_path,
noiselevel=-1)
self.invalids.append(myfile[:-5])
continue
mypkg = myfile[:-5]
if not mycat or not mypf or not slot:
#old-style or corrupt package
- writemsg("\n!!! Invalid binary package: '%s'\n" % full_path,
+ writemsg(_("\n!!! Invalid binary package: '%s'\n") % full_path,
noiselevel=-1)
missing_keys = []
if not mycat:
msg = []
if missing_keys:
missing_keys.sort()
- msg.append("Missing metadata key(s): %s." % \
+ msg.append(_("Missing metadata key(s): %s.") % \
", ".join(missing_keys))
- msg.append(" This binary package is not " + \
- "recoverable and should be deleted.")
+ msg.append(_(" This binary package is not " \
+ "recoverable and should be deleted."))
from textwrap import wrap
for line in wrap("".join(msg), 72):
writemsg("!!! %s\n" % line, noiselevel=-1)
# All is first, so it's preferred.
continue
if not self.dbapi._category_re.match(mycat):
- writemsg(("!!! Binary package has an " + \
+ writemsg(_("!!! Binary package has an " \
"unrecognized category: '%s'\n") % full_path,
noiselevel=-1)
- writemsg(("!!! '%s' has a category that is not" + \
+ writemsg(_("!!! '%s' has a category that is not" \
" listed in %setc/portage/categories\n") % \
(mycpv, self.settings["PORTAGE_CONFIGROOT"]),
noiselevel=-1)
try:
self._eval_use_flags(mycpv, d)
except portage.exception.InvalidDependString:
- writemsg("!!! Invalid binary package: '%s'\n" % \
+ writemsg(_("!!! Invalid binary package: '%s'\n") % \
self.getname(mycpv), noiselevel=-1)
self.dbapi.cpv_remove(mycpv)
del pkg_paths[mycpv]
f.close()
if getbinpkgs and not self.settings["PORTAGE_BINHOST"]:
- writemsg("!!! PORTAGE_BINHOST unset, but use is requested.\n",
+ writemsg(_("!!! PORTAGE_BINHOST unset, but use is requested.\n"),
noiselevel=-1)
if getbinpkgs and \
pkgindex = None
else:
if not self._pkgindex_version_supported(rmt_idx):
- writemsg("\n\n!!! Binhost package index version" + \
- " is not supported: '%s'\n" % \
+ writemsg(_("\n\n!!! Binhost package index version" \
+ " is not supported: '%s'\n") % \
rmt_idx.header.get("VERSION"), noiselevel=-1)
pkgindex = None
elif local_timestamp != remote_timestamp:
finally:
f.close()
except EnvironmentError, e:
- writemsg("\n\n!!! Error fetching binhost package" + \
- " info from '%s'\n" % base_url)
+ writemsg(_("\n\n!!! Error fetching binhost package" \
+ " info from '%s'\n") % base_url)
writemsg("!!! %s\n\n" % str(e))
del e
pkgindex = None
chunk_size = 3000
writemsg_stdout("\n")
writemsg_stdout(
- colorize("GOOD", "Fetching bininfo from ") + \
+ colorize("GOOD", _("Fetching bininfo from ")) + \
re.sub(r'//(.+):.+@(.+)/', r'//\1:*password*@\2/', base_url) + "\n")
self.remotepkgs = portage.getbinpkg.dir_get_metadata(
self.settings["PORTAGE_BINHOST"], chunk_size=chunk_size)
for mypkg in self.remotepkgs.keys():
if "CATEGORY" not in self.remotepkgs[mypkg]:
#old-style or corrupt package
- writemsg("!!! Invalid remote binary package: "+mypkg+"\n",
+ writemsg(_("!!! Invalid remote binary package: %s\n") % mypkg,
noiselevel=-1)
del self.remotepkgs[mypkg]
continue
continue
if not self.dbapi._category_re.match(mycat):
- writemsg(("!!! Remote binary package has an " + \
+ writemsg(_("!!! Remote binary package has an " \
"unrecognized category: '%s'\n") % fullpkg,
noiselevel=-1)
- writemsg(("!!! '%s' has a category that is not" + \
+ writemsg(_("!!! '%s' has a category that is not" \
" listed in %setc/portage/categories\n") % \
(fullpkg, self.settings["PORTAGE_CONFIGROOT"]),
noiselevel=-1)
except SystemExit, e:
raise
except:
- writemsg("!!! Failed to inject remote binary package:"+str(fullpkg)+"\n",
+ writemsg(_("!!! Failed to inject remote binary package: %s\n") % fullpkg,
noiselevel=-1)
del self.remotepkgs[mypkg]
continue
if e.errno != errno.ENOENT:
raise
del e
- writemsg("!!! Binary package does not exist: '%s'\n" % full_path,
+ writemsg(_("!!! Binary package does not exist: '%s'\n") % full_path,
noiselevel=-1)
return
mytbz2 = portage.xpak.tbz2(full_path)
slot = mytbz2.getfile("SLOT")
if slot is None:
- writemsg("!!! Invalid binary package: '%s'\n" % full_path,
+ writemsg(_("!!! Invalid binary package: '%s'\n") % full_path,
noiselevel=-1)
return
slot = slot.strip()
try:
d = self._pkgindex_entry(cpv)
except portage.exception.InvalidDependString:
- writemsg("!!! Invalid binary package: '%s'\n" % \
+ writemsg(_("!!! Invalid binary package: '%s'\n") % \
self.getname(cpv), noiselevel=-1)
self.dbapi.cpv_remove(cpv)
del self._pkg_paths[cpv]
return
else:
resume = True
- writemsg("Resuming download of this tbz2, but it is possible that it is corrupt.\n",
+ writemsg(_("Resuming download of this tbz2, but it is possible that it is corrupt.\n"),
noiselevel=-1)
mydest = os.path.dirname(self.getname(pkgname))
try:
digests["size"] = int(metadata["SIZE"])
except ValueError:
- writemsg("!!! Malformed SIZE attribute in remote " + \
- "metadata for '%s'\n" % cpv)
+ writemsg(_("!!! Malformed SIZE attribute in remote " \
+ "metadata for '%s'\n") % cpv)
if not digests:
return False
from portage.dbapi import dbapi
from portage.exception import PortageException, \
FileNotFound, InvalidDependString, InvalidPackageName
+from portage.localization import _
from portage.manifest import Manifest
from portage import eclass_cache, auxdbkeys, doebuild, flatten, \
for alias in loc_repo_conf.aliases:
overridden_alias = repo_aliases.get(alias)
if overridden_alias is not None:
- writemsg_level(("!!! Alias '%s' " + \
- "created for '%s' overrides " + \
- "'%s' alias in " + \
+ writemsg_level(_("!!! Alias '%s' " \
+ "created for '%s' overrides " \
+ "'%s' alias in " \
"'%s'\n") % (alias, repo_name,
overridden_alias,
self.mysettings._local_repo_conf_path),
master_name = repo_aliases.get(master_name, master_name)
master_path = self.treemap.get(master_name)
if master_path is None:
- writemsg_level(("Unavailable repository '%s' " + \
+ writemsg_level(_("Unavailable repository '%s' " \
"referenced by masters entry in '%s'\n") % \
(master_name, layout_filename),
level=logging.ERROR, noiselevel=-1)
for other_name in loc_repo_conf.eclass_overrides:
other_path = self.treemap.get(other_name)
if other_path is None:
- writemsg_level(("Unavailable repository '%s' " + \
- "referenced by eclass-overrides entry in " + \
+ writemsg_level(_("Unavailable repository '%s' " \
+ "referenced by eclass-overrides entry in " \
"'%s'\n") % (other_name,
self.mysettings._local_repo_conf_path),
level=logging.ERROR, noiselevel=-1)
st = os.stat(ebuild_path)
emtime = st[stat.ST_MTIME]
except OSError:
- writemsg("!!! aux_get(): ebuild for " + \
- "'%s' does not exist at:\n" % (cpv,), noiselevel=-1)
+ writemsg(_("!!! aux_get(): ebuild for " \
+ "'%s' does not exist at:\n") % (cpv,), noiselevel=-1)
writemsg("!!! %s\n" % ebuild_path, noiselevel=-1)
raise KeyError(cpv)
myebuild, mylocation = self.findname2(mycpv, mytree)
if not myebuild:
- writemsg("!!! aux_get(): ebuild path for '%(cpv)s' not specified:\n" % {"cpv":mycpv},
+ writemsg(_("!!! aux_get(): ebuild path for '%s' not specified:\n") % mycpv,
noiselevel=1)
writemsg("!!! %s\n" % myebuild, noiselevel=1)
raise KeyError(mycpv)
mydata, st, emtime = self._pull_valid_cache(mycpv, myebuild, mylocation)
doregen = mydata is None
- writemsg("auxdb is valid: "+str(not doregen)+" "+str(pkg)+"\n", 2)
+ writemsg(_("auxdb is valid: ")+str(not doregen)+" "+str(pkg)+"\n", 2)
if doregen:
if myebuild in self._broken_ebuilds:
if not self._have_root_eclass_dir:
raise KeyError(mycpv)
writemsg("doregen: %s %s\n" % (doregen, mycpv), 2)
- writemsg("Generating cache entry(0) for: "+str(myebuild)+"\n", 1)
+ writemsg(_("Generating cache entry(0) for: ")+str(myebuild)+"\n", 1)
self.doebuild_settings.setcpv(mycpv)
mydata = {}
for myfile in myfiles:
if myfile not in checksums:
if debug:
- writemsg("[bad digest]: missing %s for %s\n" % (myfile, mypkg))
+ writemsg(_("[bad digest]: missing %(file)s for %(pkg)s\n") % {"file":myfile, "pkg":mypkg})
continue
file_path = os.path.join(self.mysettings["DISTDIR"], myfile)
mystat = None
for x in myfiles:
if not mysums or x not in mysums:
ok = False
- reason = "digest missing"
+ reason = _("digest missing")
else:
try:
ok, reason = portage.checksum.verify_all(
os.path.join(self.mysettings["DISTDIR"], x), mysums[x])
except FileNotFound, e:
ok = False
- reason = "File Not Found: '%s'" % str(e)
+ reason = _("File Not Found: '%s'") % str(e)
if not ok:
failures[x] = reason
if failures:
if pf is not None:
ps = pkgsplit(pf)
if not ps:
- writemsg("\nInvalid ebuild name: %s\n" % \
+ writemsg(_("\nInvalid ebuild name: %s\n") % \
os.path.join(oroot, mycp, x), noiselevel=-1)
continue
if ps[0] != mysplit[1]:
- writemsg("\nInvalid ebuild name: %s\n" % \
+ writemsg(_("\nInvalid ebuild name: %s\n") % \
os.path.join(oroot, mycp, x), noiselevel=-1)
continue
ver_match = ver_regexp.match("-".join(ps[1:]))
if ver_match is None or not ver_match.groups():
- writemsg("\nInvalid ebuild version: %s\n" % \
+ writemsg(_("\nInvalid ebuild version: %s\n") % \
os.path.join(oroot, mycp, x), noiselevel=-1)
continue
d[mysplit[0]+"/"+pf] = None
if invalid_category and d:
- writemsg(("\n!!! '%s' has a category that is not listed in " + \
+ writemsg(_("\n!!! '%s' has a category that is not listed in " \
"%setc/portage/categories\n") % \
(mycp, self.mysettings["PORTAGE_CONFIGROOT"]), noiselevel=-1)
mylist = []
from portage.exception import CommandNotFound, \
InvalidData, InvalidPackageName, \
FileNotFound, PermissionDenied, UnsupportedAPIException
+from portage.localization import _
from portage import listdir, dep_expand, digraph, flatten, key_expand, \
doebuild_environment, doebuild, env_update, prepare_build_dirs, \
try:
self._data = pickle.load(open(self._filename, 'rb'))
except (ValueError, pickle.UnpicklingError), e:
- writemsg_level("!!! Error loading '%s': %s\n" % \
+ writemsg_level(_("!!! Error loading '%s': %s\n") % \
(self._filename, e), level=logging.ERROR, noiselevel=-1)
except (EOFError, IOError), e:
if isinstance(e, EOFError) or e.errno == errno.ENOENT:
continue
fields = l.split(";")
if len(fields) < 5:
- writemsg_level("\nWrong number of fields " + \
- "returned from scanelf: %s\n\n" % (l,),
+ writemsg_level(_("\nWrong number of fields " \
+ "returned from scanelf: %s\n\n") % (l,),
level=logging.ERROR, noiselevel=-1)
continue
fields[1] = fields[1][root_len:]
continue
fields = l.split(";")
if len(fields) < 5:
- writemsg_level("\nWrong number of fields " + \
- "in %s: %s\n\n" % (self._needed_aux_key, l),
+ writemsg_level(_("\nWrong number of fields " \
+ "in %s: %s\n\n") % (self._needed_aux_key, l),
level=logging.ERROR, noiselevel=-1)
continue
arch = fields[0]
# XXX This is most often due to soname symlinks not in
# a library's directory. We could catalog symlinks in
# LinkageMap to avoid checking for this edge case here.
- print "Found provider outside of findProviders:", \
+ print _("Found provider outside of findProviders:"), \
os.path.join(directory, soname), "->", \
self._obj_properties[cachedKey][4], libraries
# A valid library has been found, so there is no need to
break
if debug and cachedArch == arch and \
cachedKey in self._obj_properties:
- print "Broken symlink or missing/bad soname:", \
- os.path.join(directory, soname), '->', \
- self._obj_properties[cachedKey], "with soname", \
- cachedSoname, "but expecting", soname
+ print _("Broken symlink or missing/bad soname: %(dir_soname)s -> %(cachedKey)s "
+ "with soname %(cachedSoname)s but expecting %(soname)s") % \
+ {"dir_soname":os.path.join(directory, soname),
+ "cachedKey": self._obj_properties[cachedKey],
+ "cachedSoname": cachedSoname, "soname":soname}
# This conditional checks if there are no libraries to satisfy the
# soname (empty set).
if not validLibraries:
rValue.setdefault(lib, set()).add(soname)
if debug:
if not os.path.isfile(lib):
- print "Missing library:", lib
+ print _("Missing library:"), lib
else:
- print "Possibly missing symlink:", \
+ print _("Possibly missing symlink:"), \
os.path.join(os.path.dirname(lib), soname)
return rValue
return long(self.aux_get(mycpv, ["COUNTER"])[0])
except (KeyError, ValueError):
pass
- writemsg_level(("portage: COUNTER for %s was corrupted; " + \
+ writemsg_level(_("portage: COUNTER for %s was corrupted; " \
"resetting to value of 0\n") % (mycpv,),
level=logging.ERROR, noiselevel=-1)
return 0
del f
except (IOError, OSError, EOFError, ValueError, pickle.UnpicklingError), e:
if isinstance(e, pickle.UnpicklingError):
- writemsg("!!! Error loading '%s': %s\n" % \
+ writemsg(_("!!! Error loading '%s': %s\n") % \
(self._aux_cache_filename, str(e)), noiselevel=-1)
del e
except EnvironmentError, e:
new_vdb = not bool(self.cpv_all())
if not new_vdb:
- writemsg("!!! Unable to read COUNTER file: '%s'\n" % \
+ writemsg(_("!!! Unable to read COUNTER file: '%s'\n") % \
self._counter_path, noiselevel=-1)
writemsg("!!! %s\n" % str(e), noiselevel=-1)
del e
finally:
cfile.close()
except (OverflowError, ValueError), e:
- writemsg("!!! COUNTER file is corrupt: '%s'\n" % \
+ writemsg(_("!!! COUNTER file is corrupt: '%s'\n") % \
self._counter_path, noiselevel=-1)
writemsg("!!! %s\n" % str(e), noiselevel=-1)
del e
max_counter = counter
if counter < 0 and not new_vdb:
- writemsg("!!! Initializing COUNTER to " + \
- "value of %d\n" % max_counter, noiselevel=-1)
+ writemsg(_("!!! Initializing COUNTER to " \
+ "value of %d\n") % max_counter, noiselevel=-1)
return max_counter + 1
raise
except Exception, e:
mydir = os.path.join(self.root, VDB_PATH, mycpv)
- writemsg("\nParse Error reading PROVIDE and USE in '%s'\n" % mydir,
+ writemsg(_("\nParse Error reading PROVIDE and USE in '%s'\n") % mydir,
noiselevel=-1)
if mylines:
- writemsg("Possibly Invalid: '%s'\n" % str(mylines),
+ writemsg(_("Possibly Invalid: '%s'\n") % str(mylines),
noiselevel=-1)
- writemsg("Exception: %s\n\n" % str(e), noiselevel=-1)
+ writemsg(_("Exception: %s\n\n") % str(e), noiselevel=-1)
return []
def get_all_provides(self):
# Check validity of self.dbdir before attempting to remove it.
if not self.dbdir.startswith(self.dbroot):
- writemsg("portage.dblink.delete(): invalid dbdir: %s\n" % \
+ writemsg(_("portage.dblink.delete(): invalid dbdir: %s\n") % \
self.dbdir, noiselevel=-1)
return
for pos, line in enumerate(mylines):
if null_byte in line:
# Null bytes are a common indication of corruption.
- errors.append((pos + 1, "Null byte found in CONTENTS entry"))
+ errors.append((pos + 1, _("Null byte found in CONTENTS entry")))
continue
line = line.rstrip("\n")
# Split on " " so that even file paths that
try:
splitter = mydat.index("->", 2, len(mydat) - 2)
except ValueError:
- errors.append((pos + 1, "Unrecognized CONTENTS entry"))
+ errors.append((pos + 1, _("Unrecognized CONTENTS entry")))
continue
spaces_in_path = splitter - 2
spaces_in_target = spaces_total - spaces_in_path
#format: type
pkgfiles[mydat[1]] = [mydat[0]]
else:
- errors.append((pos + 1, "Unrecognized CONTENTS entry"))
+ errors.append((pos + 1, _("Unrecognized CONTENTS entry")))
except (KeyError, IndexError):
- errors.append((pos + 1, "Unrecognized CONTENTS entry"))
+ errors.append((pos + 1, _("Unrecognized CONTENTS entry")))
if errors:
- writemsg("!!! Parse error in '%s'\n" % contents_file, noiselevel=-1)
+ writemsg(_("!!! Parse error in '%s'\n") % contents_file, noiselevel=-1)
for pos, e in errors:
- writemsg("!!! line %d: %s\n" % (pos, e), noiselevel=-1)
+ writemsg(_("!!! line %d: %s\n") % (pos, e), noiselevel=-1)
self.contentscache = pkgfiles
return pkgfiles
self.settings, 0, 0, self.vartree.dbapi)
except UnsupportedAPIException, e:
# Sometimes this happens due to corruption of the EAPI file.
- writemsg("!!! FAILED prerm: %s\n" % \
+ writemsg(_("!!! FAILED prerm: %s\n") % \
os.path.join(self.dbdir, "EAPI"), noiselevel=-1)
writemsg("%s\n" % str(e), noiselevel=-1)
myebuildpath = None
# XXX: Decide how to handle failures here.
if retval != os.EX_OK:
- writemsg("!!! FAILED prerm: %s\n" % retval, noiselevel=-1)
+ writemsg(_("!!! FAILED prerm: %s\n") % retval, noiselevel=-1)
self._unmerge_pkgfiles(pkgfiles, others_in_slot)
self._clear_contents_cache()
# XXX: Decide how to handle failures here.
if retval != os.EX_OK:
- writemsg("!!! FAILED postrm: %s\n" % retval, noiselevel=-1)
+ writemsg(_("!!! FAILED postrm: %s\n") % retval, noiselevel=-1)
# Skip this if another package in the same slot has just been
# merged on top of this package, since the other package has
if myebuildpath:
if retval != os.EX_OK:
msg_lines = []
- msg = ("The '%s' " % ebuild_phase) + \
- ("phase of the '%s' package " % self.mycpv) + \
- ("has failed with exit value %s." % retval)
+ msg = _("The '%(ebuild_phase)s' "
+ "phase of the '%(cpv)s' package "
+ "has failed with exit value %(retval)s.") % \
+ {"ebuild_phase":ebuild_phase, "cpv":self.mycpv,
+ "retval":retval}
from textwrap import wrap
msg_lines.extend(wrap(msg, 72))
msg_lines.append("")
ebuild_name = os.path.basename(myebuildpath)
ebuild_dir = os.path.dirname(myebuildpath)
- msg = "The problem occurred while executing " + \
- ("the ebuild file named '%s' " % ebuild_name) + \
- ("located in the '%s' directory. " \
- % ebuild_dir) + \
- "If necessary, manually remove " + \
- "the environment.bz2 file and/or the " + \
- "ebuild file located in that directory."
+ msg = _("The problem occurred while executing "
+ "the ebuild file named '%(ebuild_name)s' "
+ "located in the '%(ebuild_dir)s' directory. "
+ "If necessary, manually remove "
+ "the environment.bz2 file and/or the "
+ "ebuild file located in that directory.") % \
+ {"ebuild_name":ebuild_name, "ebuild_dir":ebuild_dir}
msg_lines.extend(wrap(msg, 72))
msg_lines.append("")
- msg = "Removal " + \
- "of the environment.bz2 file is " + \
- "preferred since it may allow the " + \
- "removal phases to execute successfully. " + \
- "The ebuild will be " + \
- "sourced and the eclasses " + \
- "from the current portage tree will be used " + \
- "when necessary. Removal of " + \
- "the ebuild file will cause the " + \
- "pkg_prerm() and pkg_postrm() removal " + \
- "phases to be skipped entirely."
+ msg = _("Removal "
+ "of the environment.bz2 file is "
+ "preferred since it may allow the "
+ "removal phases to execute successfully. "
+ "The ebuild will be "
+ "sourced and the eclasses "
+ "from the current portage tree will be used "
+ "when necessary. Removal of "
+ "the ebuild file will cause the "
+ "pkg_prerm() and pkg_postrm() removal "
+ "phases to be skipped entirely.")
msg_lines.extend(wrap(msg, 72))
self._eerror(ebuild_phase, msg_lines)
scheduler = self._scheduler
if not pkgfiles:
- showMessage("No package files given... Grabbing a set.\n")
+ showMessage(_("No package files given... Grabbing a set.\n"))
pkgfiles = self.getcontents()
if others_in_slot is None:
def show_unmerge(zing, desc, file_type, file_name):
showMessage("%s %s %s %s\n" % \
(zing, desc.ljust(8), file_type, file_name))
+
+ unmerge_desc = {}
+ unmerge_desc["cfgpro"] = _("cfgpro")
+ unmerge_desc["replaced"] = _("replaced")
+ unmerge_desc["!dir"] = _("!dir")
+ unmerge_desc["!empty"] = _("!empty")
+ unmerge_desc["!fif"] = _("!fif")
+ unmerge_desc["!found"] = _("!found")
+ unmerge_desc["!md5"] = _("!md5")
+ unmerge_desc["!mtime"] = _("!mtime")
+ unmerge_desc["!obj"] = _("!obj")
+ unmerge_desc["!sym"] = _("!sym")
+
for i, objkey in enumerate(mykeys):
if scheduler is not None and \
pass
islink = lstatobj is not None and stat.S_ISLNK(lstatobj.st_mode)
if lstatobj is None:
- show_unmerge("---", "!found", file_type, obj)
+ show_unmerge("---", unmerge_desc["!found"], file_type, obj)
continue
if obj.startswith(dest_root):
relative_path = obj[dest_root_len:]
if is_owned:
# A new instance of this package claims the file, so
# don't unmerge it.
- show_unmerge("---", "replaced", file_type, obj)
+ show_unmerge("---", unmerge_desc["replaced"], file_type, obj)
continue
elif relative_path in cfgfiledict:
stale_confmem.append(relative_path)
# functionality for /lib/modules. For portage-ng both capabilities
# should be able to be independently specified.
if obj.startswith(modprotect):
- show_unmerge("---", "cfgpro", file_type, obj)
+ show_unmerge("---", unmerge_desc["cfgpro"], file_type, obj)
continue
# Don't unlink symlinks to directories here since that can
lmtime = str(lstatobj[stat.ST_MTIME])
if (pkgfiles[objkey][0] not in ("dir", "fif", "dev")) and (lmtime != pkgfiles[objkey][1]):
- show_unmerge("---", "!mtime", file_type, obj)
+ show_unmerge("---", unmerge_desc["!mtime"], file_type, obj)
continue
if pkgfiles[objkey][0] == "dir":
if statobj is None or not stat.S_ISDIR(statobj.st_mode):
- show_unmerge("---", "!dir", file_type, obj)
+ show_unmerge("---", unmerge_desc["!dir"], file_type, obj)
continue
mydirs.append(obj)
elif pkgfiles[objkey][0] == "sym":
if not islink:
- show_unmerge("---", "!sym", file_type, obj)
+ show_unmerge("---", unmerge_desc["!sym"], file_type, obj)
continue
# Go ahead and unlink symlinks to directories here when
# they're actually recorded as symlinks in the contents.
show_unmerge("!!!", "", file_type, obj)
elif pkgfiles[objkey][0] == "obj":
if statobj is None or not stat.S_ISREG(statobj.st_mode):
- show_unmerge("---", "!obj", file_type, obj)
+ show_unmerge("---", unmerge_desc["!obj"], file_type, obj)
continue
mymd5 = None
try:
mymd5 = perform_md5(obj, calc_prelink=1)
except FileNotFound, e:
# the file has disappeared between now and our stat call
- show_unmerge("---", "!obj", file_type, obj)
+ show_unmerge("---", unmerge_desc["!obj"], file_type, obj)
continue
# string.lower is needed because db entries used to be in upper-case. The
# string.lower allows for backwards compatibility.
if mymd5 != pkgfiles[objkey][2].lower():
- show_unmerge("---", "!md5", file_type, obj)
+ show_unmerge("---", unmerge_desc["!md5"], file_type, obj)
continue
try:
unlink(obj, lstatobj)
show_unmerge("<<<", "", file_type, obj)
elif pkgfiles[objkey][0] == "fif":
if not stat.S_ISFIFO(lstatobj[stat.ST_MODE]):
- show_unmerge("---", "!fif", file_type, obj)
+ show_unmerge("---", unmerge_desc["!fif"], file_type, obj)
continue
show_unmerge("---", "", file_type, obj)
elif pkgfiles[objkey][0] == "dev":
if e.errno not in ignored_rmdir_errnos:
raise
if e.errno != errno.ENOENT:
- show_unmerge("---", "!empty", "dir", obj)
+ show_unmerge("---", unmerge_desc["!empty"], "dir", obj)
del e
# Remove stale entries from config memory.
self.vartree.dbapi.linkmap.rebuild(**kwargs)
except CommandNotFound, e:
self._linkmap_broken = True
- self._display_merge("!!! Disabling preserve-libs " + \
- "due to error: Command Not Found: %s\n" % (e,),
+ self._display_merge(_("!!! Disabling preserve-libs " \
+ "due to error: Command Not Found: %s\n") % (e,),
level=logging.ERROR, noiselevel=-1)
def _find_libs_to_preserve(self):
# that should be preserved yet the path is not listed in the
# contents. Such a path might belong to some other package, so
# it shouldn't be preserved here.
- showMessage(("!!! File '%s' will not be preserved " + \
+ showMessage(_("!!! File '%s' will not be preserved "
"due to missing contents entry\n") % (f_abs,),
level=logging.ERROR, noiselevel=-1)
preserve_paths.remove(f)
continue
new_contents[f_abs] = contents_entry
obj_type = contents_entry[0]
- showMessage(">>> needed %s %s\n" % (obj_type, f_abs),
+ showMessage(_(">>> needed %s %s\n") % (obj_type, f_abs),
noiselevel=-1)
# Add parent directories to contents if necessary.
parent_dir = os.path.dirname(f_abs)
if cpv is None:
# This means that a symlink is in the preserved libs
# registry, but the actual lib it points to is not.
- self._display_merge("!!! symlink to lib is preserved, " + \
- "but not the lib itself:\n!!! '%s'\n" % (obj,),
+ self._display_merge(_("!!! symlink to lib is preserved, "
+ "but not the lib itself:\n!!! '%s'\n") % (obj,),
level=logging.ERROR, noiselevel=-1)
continue
removed = cpv_lib_map.get(cpv)
obj = os.path.join(root, obj.lstrip(os.sep))
parent_dirs.add(os.path.dirname(obj))
if os.path.islink(obj):
- obj_type = "sym"
+ obj_type = _("sym")
else:
- obj_type = "obj"
+ obj_type = _("obj")
try:
os.unlink(obj)
except OSError, e:
raise
del e
else:
- showMessage("<<< !needed %s %s\n" % (obj_type, obj),
+ showMessage(_("<<< !needed %s %s\n") % (obj_type, obj),
noiselevel=-1)
# Remove empty parent directories if possible.
collisions = []
destroot = normalize_path(destroot).rstrip(os.path.sep) + \
os.path.sep
- showMessage(" %s checking %d files for package collisions\n" % \
+ showMessage(_(" %s checking %d files for package collisions\n") % \
(colorize("GOOD", "*"), len(mycontents)))
for i, f in enumerate(mycontents):
if i % 1000 == 0 and i != 0:
- showMessage("%d files checked ...\n" % i)
+ showMessage(_("%d files checked ...\n") % i)
if scheduler is not None and \
0 == i % self._file_merge_yield_interval:
return 0
msg = []
- msg.append("suid/sgid file(s) " + \
- "with suspicious hardlink(s):")
+ msg.append(_("suid/sgid file(s) "
+ "with suspicious hardlink(s):"))
msg.append("")
for path_list in suspicious_hardlinks:
for path, s in path_list:
msg.append("\t%s" % path)
msg.append("")
- msg.append("See the Gentoo Security Handbook " + \
- "guide for advice on how to proceed.")
+ msg.append(_("See the Gentoo Security Handbook "
+ "guide for advice on how to proceed."))
self._eerror("preinst", msg)
destroot = normalize_path(destroot).rstrip(os.path.sep) + os.path.sep
if not os.path.isdir(srcroot):
- showMessage("!!! Directory Not Found: D='%s'\n" % srcroot,
+ showMessage(_("!!! Directory Not Found: D='%s'\n") % srcroot,
level=logging.ERROR, noiselevel=-1)
return 1
if not slot.strip():
slot = self.settings.get(var_name, '')
if not slot.strip():
- showMessage("!!! SLOT is undefined\n",
+ showMessage(_("!!! SLOT is undefined\n"),
level=logging.ERROR, noiselevel=-1)
return 1
write_atomic(os.path.join(inforoot, var_name), slot + '\n')
if val != self.settings.get(var_name, ''):
self._eqawarn('preinst',
- ["QA Notice: Expected %s='%s', got '%s'\n" % \
- (var_name, self.settings.get(var_name, ''), val)])
+ [_("QA Notice: Expected %(var_name)s='%(expected_value)s', got '%(actual_value)s'\n") % \
+ {"var_name":var_name, "expected_value":self.settings.get(var_name, ''), "actual_value":val}])
def eerror(lines):
self._eerror("preinst", lines)
if paths_with_newlines:
msg = []
- msg.append("This package installs one or more files containing")
- msg.append("a newline (\\n) character:")
+ msg.append(_("This package installs one or more files containing a newline (\\n) character:"))
msg.append("")
paths_with_newlines.sort()
for f in paths_with_newlines:
msg.append("\t/%s" % (f.replace("\n", "\\n")))
msg.append("")
- msg.append("package %s NOT merged" % self.mycpv)
+ msg.append(_("package %s NOT merged") % self.mycpv)
msg.append("")
eerror(msg)
return 1
from textwrap import wrap
wrap_width = 72
msg = []
- d = (
- self.mycpv,
- other_dblink.mycpv
- )
- msg.extend(wrap(("The '%s' package will not install " + \
- "any files, but the currently installed '%s'" + \
+ d = {
+ "new_cpv":self.mycpv,
+ "old_cpv":other_dblink.mycpv
+ }
+ msg.extend(wrap(_("The '%(new_cpv)s' package will not install "
+ "any files, but the currently installed '%(old_cpv)s'"
" package has the following files: ") % d, wrap_width))
msg.append("")
msg.extend(sorted(installed_files))
msg.append("")
- msg.append("package %s NOT merged" % self.mycpv)
+ msg.append(_("package %s NOT merged") % self.mycpv)
msg.append("")
msg.extend(wrap(
- ("Manually run `emerge --unmerge =%s` " % \
- other_dblink.mycpv) + "if you really want to " + \
- "remove the above files. Set " + \
- "PORTAGE_PACKAGE_EMPTY_ABORT=\"0\" in " + \
- "/etc/make.conf if you do not want to " + \
- "abort in cases like this.",
+ _("Manually run `emerge --unmerge =%s` if you "
+ "really want to remove the above files. Set "
+ "PORTAGE_PACKAGE_EMPTY_ABORT=\"0\" in "
+ "/etc/make.conf if you do not want to "
+ "abort in cases like this.") % other_dblink.mycpv,
wrap_width))
eerror(msg)
if installed_files:
if collisions:
collision_protect = "collision-protect" in self.settings.features
protect_owned = "protect-owned" in self.settings.features
- msg = "This package will overwrite one or more files that" + \
- " may belong to other packages (see list below)."
+ msg = _("This package will overwrite one or more files that"
+ " may belong to other packages (see list below).")
if not (collision_protect or protect_owned):
- msg += " Add either \"collision-protect\" or" + \
- " \"protect-owned\" to FEATURES in" + \
- " make.conf if you would like the merge to abort" + \
- " in cases like this. See the make.conf man page for" + \
- " more information about these features."
+ msg += _(" Add either \"collision-protect\" or"
+ " \"protect-owned\" to FEATURES in"
+ " make.conf if you would like the merge to abort"
+ " in cases like this. See the make.conf man page for"
+ " more information about these features.")
if self.settings.get("PORTAGE_QUIET") != "1":
- msg += " You can use a command such as" + \
- " `portageq owners / <filename>` to identify the" + \
- " installed package that owns a file. If portageq" + \
- " reports that only one package owns a file then do NOT" + \
- " file a bug report. A bug report is only useful if it" + \
- " identifies at least two or more packages that are known" + \
- " to install the same file(s)." + \
- " If a collision occurs and you" + \
- " can not explain where the file came from then you" + \
- " should simply ignore the collision since there is not" + \
- " enough information to determine if a real problem" + \
- " exists. Please do NOT file a bug report at" + \
- " http://bugs.gentoo.org unless you report exactly which" + \
- " two packages install the same file(s). Once again," + \
- " please do NOT file a bug report unless you have" + \
- " completely understood the above message."
+ msg += _(" You can use a command such as"
+ " `portageq owners / <filename>` to identify the"
+ " installed package that owns a file. If portageq"
+ " reports that only one package owns a file then do NOT"
+ " file a bug report. A bug report is only useful if it"
+ " identifies at least two or more packages that are known"
+ " to install the same file(s)."
+ " If a collision occurs and you"
+ " can not explain where the file came from then you"
+ " should simply ignore the collision since there is not"
+ " enough information to determine if a real problem"
+ " exists. Please do NOT file a bug report at"
+ " http://bugs.gentoo.org unless you report exactly which"
+ " two packages install the same file(s). Once again,"
+ " please do NOT file a bug report unless you have"
+ " completely understood the above message.")
self.settings["EBUILD_PHASE"] = "preinst"
from textwrap import wrap
msg = wrap(msg, 70)
if collision_protect:
msg.append("")
- msg.append("package %s NOT merged" % self.settings.mycpv)
+ msg.append(_("package %s NOT merged") % self.settings.mycpv)
msg.append("")
- msg.append("Detected file collision(s):")
+ msg.append(_("Detected file collision(s):"))
msg.append("")
for f in collisions:
msg = []
msg.append("")
- msg.append("Searching all installed" + \
- " packages for file collisions...")
+ msg.append(_("Searching all installed"
+ " packages for file collisions..."))
msg.append("")
- msg.append("Press Ctrl-C to Stop")
+ msg.append(_("Press Ctrl-C to Stop"))
msg.append("")
eerror(msg)
eerror(msg)
if not owners:
- eerror(["None of the installed" + \
- " packages claim the file(s).", ""])
+ eerror([_("None of the installed"
+ " packages claim the file(s)."), ""])
# The explanation about the collision and how to solve
# it may not be visible via a scrollback buffer, especially
# if the number of file collisions is large. Therefore,
# show a summary at the end.
if collision_protect:
- msg = "Package '%s' NOT merged due to file collisions." % \
+ msg = _("Package '%s' NOT merged due to file collisions.") % \
self.settings.mycpv
elif protect_owned and owners:
- msg = "Package '%s' NOT merged due to file collisions." % \
+ msg = _("Package '%s' NOT merged due to file collisions.") % \
self.settings.mycpv
else:
- msg = "Package '%s' merged despite file collisions." % \
+ msg = _("Package '%s' merged despite file collisions.") % \
self.settings.mycpv
- msg += " If necessary, refer to your elog " + \
- "messages for the whole content of the above message."
+ msg += _(" If necessary, refer to your elog "
+ "messages for the whole content of the above message.")
eerror(wrap(msg, 70))
if collision_protect or (protect_owned and owners):
# run preinst script
if scheduler is None:
- showMessage(">>> Merging %s to %s\n" % (self.mycpv, destroot))
+ showMessage(_(">>> Merging %(cpv)s to %(destroot)s\n") % {"cpv":self.mycpv, "destroot":destroot})
a = doebuild(myebuild, "preinst", destroot, self.settings,
use_cache=0, tree=self.treetype, mydbapi=mydbapi,
vartree=self.vartree)
# XXX: Decide how to handle failures here.
if a != os.EX_OK:
- showMessage("!!! FAILED preinst: "+str(a)+"\n",
+ showMessage(_("!!! FAILED preinst: ")+str(a)+"\n",
level=logging.ERROR, noiselevel=-1)
return a
autoclean = self.settings.get("AUTOCLEAN", "yes") == "yes"
if autoclean:
- emerge_log(" >>> AUTOCLEAN: %s" % (slot_atom,))
+ emerge_log(_(" >>> AUTOCLEAN: %s") % (slot_atom,))
others_in_slot.append(self) # self has just been merged
for dblnk in list(others_in_slot):
continue
if not (autoclean or dblnk.mycpv == self.mycpv or reinstall_self):
continue
- showMessage(">>> Safely unmerging already-installed instance...\n")
- emerge_log(" === Unmerging... (%s)" % (dblnk.mycpv,))
+ showMessage(_(">>> Safely unmerging already-installed instance...\n"))
+ emerge_log(_(" === Unmerging... (%s)") % (dblnk.mycpv,))
others_in_slot.remove(dblnk) # dblnk will unmerge itself now
dblnk._linkmap_broken = self._linkmap_broken
unmerge_rval = dblnk.unmerge(trimworld=0,
ldpath_mtimes=prev_mtimes, others_in_slot=others_in_slot)
if unmerge_rval == os.EX_OK:
- emerge_log(" >>> unmerge success: %s" % (dblnk.mycpv,))
+ emerge_log(_(" >>> unmerge success: %s") % (dblnk.mycpv,))
else:
- emerge_log(" !!! unmerge FAILURE: %s" % (dblnk.mycpv,))
+ emerge_log(_(" !!! unmerge FAILURE: %s") % (dblnk.mycpv,))
# TODO: Check status and abort if necessary.
dblnk.delete()
- showMessage(">>> Original instance of package unmerged safely.\n")
+ showMessage(_(">>> Original instance of package unmerged safely.\n"))
if len(others_in_slot) > 1:
- showMessage(colorize("WARN", "WARNING:")
- + " AUTOCLEAN is disabled. This can cause serious"
- + " problems due to overlapping packages.\n",
+ showMessage(colorize("WARN", _("WARNING:"))
+ + _(" AUTOCLEAN is disabled. This can cause serious"
+ " problems due to overlapping packages.\n"),
level=logging.WARN, noiselevel=-1)
# We hold both directory locks.
use_cache=0, tree=self.treetype, mydbapi=mydbapi,
vartree=self.vartree)
if a == os.EX_OK:
- showMessage(">>> %s %s\n" % (self.mycpv, "merged."))
+ showMessage(_(">>> %s merged.\n") % self.mycpv)
else:
a = scheduler.dblinkEbuildPhase(
self, mydbapi, myebuild, "postinst")
# XXX: Decide how to handle failures here.
if a != os.EX_OK:
- showMessage("!!! FAILED postinst: "+str(a)+"\n",
+ showMessage(_("!!! FAILED postinst: ")+str(a)+"\n",
level=logging.ERROR, noiselevel=-1)
return a
showMessage(">>> %s -> %s\n" % (mydest, myto))
outfile.write("sym "+myrealdest+" -> "+myto+" "+str(mymtime)+"\n")
else:
- showMessage("!!! Failed to move file.\n",
+ showMessage(_("!!! Failed to move file.\n"),
level=logging.ERROR, noiselevel=-1)
showMessage("!!! %s -> %s\n" % (mydest, myto),
level=logging.ERROR, noiselevel=-1)
if not os.access(mydest, os.W_OK):
pkgstuff = pkgsplit(self.pkg)
- writemsg("\n!!! Cannot write to '"+mydest+"'.\n", noiselevel=-1)
- writemsg("!!! Please check permissions and directories for broken symlinks.\n")
- writemsg("!!! You may start the merge process again by using ebuild:\n")
+ writemsg(_("\n!!! Cannot write to '%s'.\n") % mydest, noiselevel=-1)
+ writemsg(_("!!! Please check permissions and directories for broken symlinks.\n"))
+ writemsg(_("!!! You may start the merge process again by using ebuild:\n"))
writemsg("!!! ebuild "+self.settings["PORTDIR"]+"/"+self.cat+"/"+pkgstuff[0]+"/"+self.pkg+".ebuild merge\n")
- writemsg("!!! And finish by running this: env-update\n\n")
+ writemsg(_("!!! And finish by running this: env-update\n\n"))
return 1
if stat.S_ISDIR(mydmode) or \
# a non-directory and non-symlink-to-directory. Won't work for us. Move out of the way.
if movefile(mydest, mydest+".backup", mysettings=self.settings) is None:
return 1
- showMessage("bak %s %s.backup\n" % (mydest, mydest),
+ showMessage(_("bak %s %s.backup\n") % (mydest, mydest),
level=logging.ERROR, noiselevel=-1)
#now create our directory
if self.settings.selinux_enabled():