bin/misc-functions.sh: Empty flag variable 'error' before (re-)use

Prevent subsequent .png files from inheriting error status from earlier
file.

Reviewed-By: Michał Górny <mgorny@gentoo.org>
Acked-By: Brian Dolbec <dolsen@gentoo.org>
vdb: Preserve := when storing uninstalled dependency atoms

Make the slot operator processing code not remove the := operator from
vdb dependency entries when the underlying package is not installed.

This fixes a bug where dependencies like || ( A:= B:= ) were stored as
|| ( A:0/1= B ) if B was not installed. This especially confused
dependency comparisons in @changed-deps.

With this patch, Portage stores the original := (or :slot=) atom in the
vdb. This fixes the issue while preserving the same behavior in the
current dependency resolver.

Acked-by: Alexander Berntsen <bernalex@gentoo.org>
Acked-by: Brian Dolbec <dolsen@gentoo.org>
Reviewed-by: Zac Medico <zmedico@gentoo.org>
sets: Introduce @changed-deps to update packages which need dep changes

The @changed-deps set compares the RDEPEND and PDEPEND entries of
installed packages with the metadata of matching ebuilds, triggering
rebuilds whenever a difference in dependencies is detected.

This set can be used to force installed package metadata updates when
ebuild dependencies are changed in-place. In particular, it can be used
to restore dependency tree integrity after disabling --dynamic-deps.

Acked-by: Alexander Berntsen <bernalex@gentoo.org>
Acked-by: Brian Dolbec <dolsen@gentoo.org>
dep_check: fix bug #515230

This fixes dep_check so that graph packages do not mask non-graph
packages (in the same slot) unless the graph packages also match the
dependency atom being satisfied. This requires logic changes in both
_dep_check_composite_db._visible and dep_zapdeps.

Also, fix _dep_check_composite_db match / _cpv_pkg_map
interactions to ensure correct match results.

X-Gentoo-Bug: 515230
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=515230
_slot_operator_update_probe: fix bug #508762

This fixes the check_reverse_dependencies function (inside the depgraph
_slot_operator_update_probe method) to account for irrelevant parent
atoms from parents that need to be rebuilt or have been involved in
unsolved slot conflicts.

X-Gentoo-Bug: 508762
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=508762
Reviewed-by: Brian Dolbec <dolsen@gentoo.org>
QA: Add a set of checks for bash-completion files

Add checks for common mistakes when installing bash completion files:
legacy directory, incorrect naming, missing aliases, deprecated 'have'
function.

Acked-by: Brian Dolbec <dolsen@gentoo.org>
config.setcpv: fix bug #522362

Fix config.setcpv to regenerate USE settings in order to account for
package.env USE settings from the previous package instance.

X-Gentoo-Bug: 522362
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=522362
Acked-by: Alexander Berntsen <bernalex@gentoo.org>
Acked-by: Brian Dolbec <dolsen@gentoo.org>
Run distcc-pump server throughout src_configure() to src_install()

Start distcc-pump server in all phases throughout src_configure() to
src_install() rather than in src_compile() alone. Since each of those
phases may involve some compilations, we should try to take full
advantage of distcc in all of them. Moreover, this silences distcc
warnings about being unable to connect to the server when compiling.

Fixes: https://bugs.gentoo.org/show_bug.cgi?id=507482
depgraph._add_dep: fix bug #520950

This handles a case which occurs when
_solve_non_slot_operator_slot_conflicts calls _create_graph. In this
case, ignore unsatisfied deps for installed packages only if their depth
is beyond the depth requested by the user and the dep was initially
unsatisfied (not broken by a slot conflict in the current graph).

Since depth is meaningless for packages that are not reachable as deep
dependencies of arguments, the _UNREACHABLE_DEPTH constant is used as
the depth value for any packages added via _complete_graph. Also, any
sets added via _complete_graph have their reset_depth attribute set to
False.

The sys.stderr -> writemsg changes are necessary to ensure that the test
cases do not output unwanted error messages.

X-Gentoo-Bug: 520950
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=520950
portage/mail.py: Make email date, timestamp RFC-compliant Bug 520752

Apply patch from Florent Bondoux f.bondoux@free.fr
Remove no longer used time import.
Wrap the fromatedate() call with _unicode_encode() to prevent any encoding issues.

X-Gentoo-Bug: 520752
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=520752
Reviewed-by: Zac Medico
portage/mail.py: Whitespace cleanup
Fix read only detection logic

Portage should check for a read only file system relative to ROOT and
not /.

Acked-by: Zac Medico <zmedico@gentoo.org>
Acked-by: Brian Dolbec <dolsen@gentoo.org>
Output uniform status message before and after src_test()

Output the status messages before and after running src_test()
unconditionally, alike it is done for other src_* phase functions,
rather than in EAPI-default src_test() function. This fixes the issue of
test phase output lacking delimitation whenever a custom src_test()
function was used.
repoman: Do not check for indirect inherits of deprecated eclasses

Complain only about deprecated eclasses that are inherited directly.
Checking indirectly inherited eclasses is pointless since the ebuild
maintainer can't really do anything about it --- it is up to
the maintainer of one of the directly inherited eclasses.
econf: Replace unnecessary 'case' statements with 'if's

Replace the 'case' statements used to match 'configure' output with
simpler pattern-matching 'if's.

Acked-by: Alexander Berntsen <bernalex@gentoo.org>
econf: Add EAPI-conditional arguments via array

Use a dedicated array variable to add EAPI-conditional arguments to
the configure script instead of prepending them to the command
parameters.
Fix off-by-one error in supported EAPI list

Fix the off-by-one error in construction of supported EAPI list that
resulted in EAPI 5 being considered unsupported.
Make eapi_is_supported() reuse _supported_eapis list

Make the eapi_is_supported() function use the generated list of
supported EAPIs rather than partial lists and integer comparison.
Rewrite default ebuild phase setting code

Replace the ebuild phase setting code for EAPI 2 and newer with a
simpler approach; first set proper default_* functions, and call them
within the phase. Disallow calling default_* for other phase functions
than the one being run.
self-update: Copy only relevant packages from PORTAGE_PYM_PATH

Update the self-update code to copy only packages relevant to Portage,
to avoid copying other packages when Portage is installed alongside
them.