Fix definition of ESYSROOT to use SYSROOT's prefix

For a given location, we were basing ESYSROOT on the prefix of that
location instead of the prefix used by the SYSROOT location. For
example, if BROOT=/foo, ROOT=/bar, EPREFIX=/baz, EROOT=/bar/baz, and
SYSROOT=/ then ESYSROOT should be /foo, not /baz.

Cherry-picked from https://github.com/chewi/portage/tree/sysroot-fixes
Upstream status: Not sent

BUG=chromium:929503
TEST=build_packages

Change-Id: Ie8bfc4f3ad947f5d004e2665ef4e8e0bf43f382b
Reviewed-on: https://chromium-review.googlesource.com/1686968
Tested-by: Chris McDonald <cjmcdonald@chromium.org>
Commit-Ready: Chris McDonald <cjmcdonald@chromium.org>
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
2 files changed