commit:     cdcb2e592c011254b55f5261ffc7b2c827b7c2ef
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 10 19:17:00 2022 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Thu Nov 10 19:17:00 2022 +0000
URL:        
https://gitweb.gentoo.org/proj/pkgcore/pkgcore.git/commit/?id=cdcb2e59

_const: fallback to sys.base_prefix when installed in venv

Bug: https://bugs.gentoo.org/880693
Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 py_build.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/py_build.py b/py_build.py
index f844b1c2a..1a5a4559e 100644
--- a/py_build.py
+++ b/py_build.py
@@ -28,12 +28,12 @@ def write_pkgcore_lookup_configs(cleanup_files):
     with open(path, "w") as f:
         os.chmod(path, 0o644)
         f.write(textwrap.dedent("""\
-            from os.path import join, abspath
+            from os.path import abspath, exists, join
             import sys
 
-            from snakeoil import process
-
             INSTALL_PREFIX = abspath(sys.prefix)
+            if not exists(join(INSTALL_PREFIX, 'lib/pkgcore')):
+                INSTALL_PREFIX = abspath(sys.base_prefix)
             DATA_PATH = join(INSTALL_PREFIX, 'share/pkgcore')
             CONFIG_PATH = join(DATA_PATH, 'config')
             LIBDIR_PATH = join(INSTALL_PREFIX, 'lib/pkgcore')

Reply via email to