Support the 'packages' profile file as a directory

This adds proof-of-concept support for bug #282296. Current behaviour
without this change is to print a traceback.

Reviewed-by: Alexander Berntsen <bernalex@gentoo.org>
Make b4d8e300c04b768be7cd5c respect max line width
Bug #510538: Include "::repository" in more messages.
More debug output for the slot conflict handler
portage/dispatch_conf.py: Fix bug 512690

This bug happened when a /etc/portage/package.* file was changed into a directory.
  File "/usr/lib64/portage/pym/portage/dispatch_conf.py", line 210, in file_archive_post_process
    os.rename(archive + '.dist.new', archive + '.dist')
NotADirectoryError: [Errno 20] Not a directory: '/etc/config-archive/etc/portage/package.unmask/unmask.dist'
depgraph: handle argument/set parents more
emerge: Don't split suggestion (bug 487074)

Signed-off-by: Alexander Berntsen <bernalex@gentoo.org>
Revert 'packages' profile as directory patches

This reverts commit 0c416cbb70858a5db2a1a23b2e90a95c0a1f2ea8 and
b4d8e300c04b768be7cd5c64116d6cc0453219b4.

Jorge Manuel B. S. Vicetto pointed out[0] that this is not useful. The
commits were made by me after talking to Michael Palimaka on IRC.
Apparently I did not get the full story straight, and made the commits
prematurely.

[0] https://bugs.gentoo.org/show_bug.cgi?id=282296#c14

Signed-off-by: Alexander Berntsen <bernalex@gentoo.org>
Turn a traceback into a graceful error

Prior to this patch, the following would traceback:

mkdir -p /etc/portage/make.profile/packages
emerge foo

This patch turns such a traceback into an error by implementing
IsADirectory error handling.

Signed-off-by: Alexander Berntsen <bernalex@gentoo.org>
emerge: Implement "--alert"

Implement "--alert" (short option "-A"), which adds a terminal bell
character ('\a') to all prompts, when it is set to True or "y". It may
be used without an option, like e.g. --ask, to mean True.

The patch refactors userquery to a class, UserQuery, to accommodate
--alert. It also adds the option to the emerge man page.

A quick example is to do 'emerge -PAc portage'.

If you have your terminal emulator set up to make '\a' into a window
manager urgency hint, move your cursor to a different window to get the
effect. 'sleep 2 && emerge' is another way to test this.

The --alert option is especially useful if you, like me, tend to fire up
a big world update when you get to the office in the morning (or night),
and then immediately change your focus to something else. If you now do
'emerge -auAD world', emerge will courteously point out when it has
finished calculating the graph, and again when it has finished emerging.

Signed-off-by: Alexander Berntsen <bernalex@gentoo.org>
Revert "emerge: Implement "--alert""

This reverts commit 1a00ddf5fb089724a127c8dc72d63f10ae72abbf. It had
some furiously annoying mistakes in the commit message. Also, someone
alluded to the man page being too short. Thanks, Brian.

Signed-off-by: Alexander Berntsen <bernalex@gentoo.org>
emerge: Implement "--alert"

Implement "--alert" (short option "-A"), which adds a terminal bell
character ('\a') to all prompts, when it is set to True or "y".

The patch refactors userquery to a class, UserQuery, to accommodate
--alert. It also adds the option to the emerge man page.

Signed-off-by: Alexander Berntsen <bernalex@gentoo.org>
man/emerge.1: Make the --alert example more safe

Signed-off-by: Alexander Berntsen <bernalex@gentoo.org>
Suggested-by:  Steve J. Long      <slong@rathaus.eclipse.co.uk>
repoman: Fix broken userquery import

Commit: 15433c52866e09967142fd2352bd7aad9ad5026f
Author: Alexander Berntsen <bernalex@gentoo.org> (Thu 08 May 2014 08:47:58 AM PDT)
Subject: emerge: Implement "--alert"
portage/emaint/module.py: Fix an indent error in get_class()

Multiple calls to get_class for the same module triggered this bug.
Thanks for triggerring it twitch153.
ebuild-helpers/xattr/install: use install-xattr

Currently bin/ebuild-helpers/xattr/install uses ${PORTAGE_BIN_PATH}/install.py
as a wrapper to coreutils' install to preserve a file's extended attributes when
installing, usually during src_install().  This is needed, for instance, when
preserving xattr based PaX flags, bug #465000.  However the python wrapper is
very slow, comment #42 of bug #465000.  A C wrapper was developed and tested,
bugs #501534 and #511984.  This patch checks for the existence of the C wrapper,
and uses it, falling back on the python wrapper only if not found, or if over-
ridden by ${PORTAGE_INSTALL_XATTR_IMPLEMENTATION}.