Summary: | dev-apps/portage: dispatch-conf runs hooks out of eprefix | ||
---|---|---|---|
Product: | Gentoo/Alt | Reporter: | Jiajie Chen <jiegec> |
Component: | Prefix Support | Assignee: | Gentoo Prefix <prefix> |
Status: | IN_PROGRESS --- | ||
Severity: | normal | Keywords: | InVCS |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Jiajie Chen
2023-07-12 03:17:42 UTC
Can you test if this works for you? --- a/lib/portage/util/hooks.py +++ b/lib/portage/util/hooks.py @@ -12,11 +12,14 @@ 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="/"): +def get_hooks_from_dir(rel_directory, prefix=EPREFIX): directory = os.path.join(prefix, portage.USER_CONFIG_PATH, rel_directory) hooks = OrderedDict() @@ -39,7 +42,7 @@ def get_hooks_from_dir(rel_directory, prefix="/"): return hooks -def perform_hooks(rel_directory, *argv, prefix="/"): +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) (In reply to Fabian Groffen from comment #1) > Can you test if this works for you? > > --- a/lib/portage/util/hooks.py > +++ b/lib/portage/util/hooks.py > @@ -12,11 +12,14 @@ 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="/"): > +def get_hooks_from_dir(rel_directory, prefix=EPREFIX): > directory = os.path.join(prefix, portage.USER_CONFIG_PATH, > rel_directory) > > hooks = OrderedDict() > @@ -39,7 +42,7 @@ def get_hooks_from_dir(rel_directory, prefix="/"): > return hooks > > > -def perform_hooks(rel_directory, *argv, prefix="/"): > +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) Yes, it works for me. pushed as bf9e572160ca3ae495ebd767951b31286665fc05 |