setup.py: Fix typo in logrotatedir path

From original makefile:
install -m$(INSMODE) $(LOGROTATE_FILES) \
		"$(DESTDIR)$(sysconfdir)/logrotate.d"; \
emerge-delta-webrsync: fix bug #506192

This fixes the sync_local function so that it doesn't prematurely remove
the whole TMPDIR when tarsync is not installed. In this case, we really
only want to remove the "${TMPDIR}"/portage directory which contains a
temporary copy of the portage tree. The faulty code was introduced in
commit 24f6a9599bcf445c468022264cd6952aad4d4076 when a bunch of code
from emerge-webrsync was merged into emerge-delta-webrsync.

Fixes: 24f6a9599bcf ("emerge-delta-webrsync: check full snapshot sig")
X-Gentoo-Bug: 506192
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=506192
dblink.mergeme: implement bug #523684

If a CONFIG_PROTECTed file was installed but no longer exists in the
file system, then it may have been deleted or renamed by the admin.
Therefore, force the file to be merged with a ._cfg name, so that the
admin will be prompted for this update.

X-Gentoo-Bug: 523684
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=523684
bin/ebuild-ipc.py: nonblocking fifo write

Use nonblocking write instead of a fork for writing to the fifo.
This has the advantage of avoiding a possible python futex deadlock
following fork as reported in bug #524328.

X-Gentoo-Bug: 524328
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=524328
bin/ebuild-helpers/portageq: fix bug #524964

Since commit 0cc4c1ac21a2ea94cfb1f6ff4b461a9e349d47df,
$PORTAGE_BIN_PATH/portageq no longer exists, which breaks
bin/ebuild-helpers/portageq. Note that has_version and best_version
rely on bin/ebuild-helpers/portageq if IPC is disabled, so breakage
extends beyond ebuilds that call portageq "illegally". Since
$PORTAGE_BIN_PATH no longer works, use PATH to locate the real
portageq python script.

Fixes: 0cc4c1ac21a2 ("Install Portage using setup.py")
X-Gento-Bug: 524964
X-Gentoo-URL: https://bugs.gentoo.org/show_bug.cgi?id=524964
90gcc-warnings: Update comma warning to be left handed only (bug 508364)

Update change supplied by: Michał Górny <mgorny@gentoo.org>
X-Gentoo-bug: 508364
X-Gentoo_url: https://bugs.gentoo.org/508364
emerge: add -U option short for --changed-use

X-Gentoo-Bug: 524426
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=524426
Update RELEASE-NOTES, NEWS
Update version for the release
emerge --read-news: prompt only if --ask

This fixes any conditional logic that applies to --ask so that it
also applies to --read-news. For example, emerge will bail out
automatically if --ask is enabled and stdin is not a tty.

X-Gentoo-Bug: 517310
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=517310
Implement --rage-clean

Implement --rage-clean which lets you --unmerge really furiously. Works
like --unmerge but without a delay.

Signed-off-by: Alexander Berntsen <bernalex@gentoo.org>
Acked-by:      Zac Medico         <zmedico@gentoo.org>
Support unprivileged mode for bug #433453.

This takes the existing unprivileged prefix support and enables it to
work when EPREFIX is empty. This "unprivileged" mode is automatically
enabled if the current user is not root, but has write access to the
EROOT directory (not due to the 0002 bit). For use in conditional logic
(for example, see doebuild.py diff), "unprivileged" is automatically
added to the FEATURES variable.

X-Gentoo-Bug: 433453
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=433453
Remove g+w bit from $T for TPE bug #519566

Grant permissions to the portage user instead of the group, in order
to avoid TPE complaints about the g+w bit.

X-Gentoo-Bug: 519566
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=519566
portage.data._get_global: fix UnboundLocalError

Since commit 1364fcd89384c9f60e6d72d7057dc00d8caba175, an
UnboundLocalError was triggered for portage_gid when userpriv was
enabled. This is fixed by using _get_global('portage_gid') to access
the variable value.

Fixes: 1364fcd89384 ("Support unprivileged mode for bug #433453.")
X-Gentoo-Bug: 433453
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=433453
Refactor bashrc scripts sourcing

Creates two new helper functions __try_source and __source_env_files to simplify
__source_all_bashrcs.
Add profile-formats to profile_complex
package.bashrc: per profile, per-package bashrc mechanism

Profiles can define per-package bashrc files to be sourced before emerging.
Each line in package.bashrc must be an atom name then a list of space-delimited
bashrc files (stored in $profile/bashrc/).
bin/ebuild: allow useful phases with pkg_config

It makes sense to run pkg_config by itself, but special phases like
"clean", "digest", and "manifest" can be useful. For example, if the
developer modifies the ebuild, then it's useful to regenerate the
manifest and use "clean" to discard the stale environment.

Fixes: bfa98d7a5b7a ("fixed ebuild so")
Reported-by: Vlastimil Babka <caster@gentoo.org>
Reviewed-by: Alexander Berntsen <bernalex@gentoo.org>
depgraph: fix bug #526160

This fixes _dep_check_composite_db to mask packages that aren't the
highest visible match, but only if an update is desirable. This causes
desirable updates to get pulled in for cases like bug #526160. The
included unit test simulates the virtual/pypy update that triggered
the bug.

X-Gentoo-Bug: 526160
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=526160
Acked-by: Alexander Berntsen <bernalex@gentoo.org>
CONFIG_PROTECT: handle non-existent files

This fixes the ConfigProtect class, etc-update, and dispatch-conf to
account for non-existent files (rather than directories) that are
listed directly in CONFIG_PROTECT. It has been valid to list files
directly in CONFIG_PROTECT since bug #14321. However, the support for
non-existent files added for bug #523684 did not include support for
non-existent files listed directly in CONFIG_PROTECT.

Fixes: 5f7b4865ecaf ("dblink.mergeme: implement bug #523684")
X-Gentoo-Bug: 523684
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=523684
Acked-by: Alexander Berntsen <bernalex@gentoo.org>