__PORTAGE_TEST_EPREFIX will almost always be empty, hence the code
believes that no offset prefix is in use. In Prefix, this is always on
the contrary, so when not set, use the hardwired EPREFIX from
portage.const. This avoids double prefixes seen for the portageq
functions, and hence funcs like has_version always return false.
sys.stderr.flush()
sys.exit(os.EX_USAGE)
eprefix = os.environ.get("__PORTAGE_TEST_EPREFIX")
+ # PREFIX LOCAL: make sure we fall back to our hardwired EPREFIX
+ if not eprefix:
+ eprefix = portage.const.EPREFIX
+ # END PREFIX LOCAL
eroot = portage.util.normalize_path(sys.argv[2])
if eprefix:
root = eroot[:1-len(eprefix)]