commit: bf9e572160ca3ae495ebd767951b31286665fc05 Author: Fabian Groffen <grobian <AT> gentoo <DOT> org> AuthorDate: Wed Jul 12 07:50:17 2023 +0000 Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org> CommitDate: Wed Jul 12 07:52:30 2023 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=bf9e5721
lib/portage/util/hooks: default to EPREFIX Bug: https://bugs.gentoo.org/910228 Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org> lib/portage/util/hooks.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/portage/util/hooks.py b/lib/portage/util/hooks.py index cbb15f123..c0a37fff7 100644 --- a/lib/portage/util/hooks.py +++ b/lib/portage/util/hooks.py @@ -12,11 +12,15 @@ from portage.output import create_color_func from portage.util import writemsg_level, _recursive_file_list from warnings import warn +# PREFIX LOCAL +from portage.const import EPREFIX + bad = create_color_func("BAD") warn = create_color_func("WARN") -def get_hooks_from_dir(rel_directory, prefix="/"): +# PREFIX LOCAL: prefix=EPREFIX +def get_hooks_from_dir(rel_directory, prefix=EPREFIX): directory = os.path.join(prefix, portage.USER_CONFIG_PATH, rel_directory) hooks = OrderedDict() @@ -39,7 +43,8 @@ def get_hooks_from_dir(rel_directory, prefix="/"): return hooks -def perform_hooks(rel_directory, *argv, prefix="/"): +# PREFIX LOCAL: prefix=EPREFIX +def perform_hooks(rel_directory, *argv, prefix=EPREFIX): for filepath, name in get_hooks_from_dir(rel_directory, prefix).items(): hook_command = filepath + " " + " ".join(map(str, argv)) retval = portage.process.spawn(hook_command)
