emerge --info: show /bin/sh provider (527996)

Searching contents for the /bin/sh provider is somewhat slow.
Therefore, use the basename of the symlink target to locate the
package. If this fails, then only the basename of the symlink target
will be displayed. So, typical output is something like
"sh bash 4.2_p53". Since realpath is used to resolve symlinks
recursively, this approach is also able to handle multiple levels of
symlinks such as /bin/sh -> bb -> busybox. Note that we do not parse
the output of "/bin/sh --version" because many shells do not have
a --version option.

The relevant section of the emerge --info output will now look
something like this:

Timestamp of tree: Fri, 28 Nov 2014 00:45:01 +0000
sh bash 4.2_p53
ld GNU ld (Gentoo 2.23.2 p1.0) 2.23.2

X-Gentoo-Bug: 527996
X-Gentoo-Url: https://bugs.gentoo.org/show_bug.cgi?id=527996
Acked-by: Brian Dolbec <dolsen@gentoo.org>
ebuild.sh: fix pkg_setup env for binary packages (528274)

In commit 743b3337644fbb3ea461d3a9137c9ac85e163f03, support for binary
packages broke, since binary packages must load the environment from
$T/environment. This patch fixes the logic to handle binary packages
correctly.

Fixes: 743b3337644f ("ebuild.sh: force fresh env for pkg_setup (528274)")
X-Gentoo-Bug: 528274
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=528274