From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 09CBC15800A for ; Wed, 12 Jul 2023 07:52:51 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4A2E7E07A7; Wed, 12 Jul 2023 07:52:50 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 30429E07A7 for ; Wed, 12 Jul 2023 07:52:50 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 5CF54340C39 for ; Wed, 12 Jul 2023 07:52:49 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id A221DAC2 for ; Wed, 12 Jul 2023 07:52:47 +0000 (UTC) From: "Fabian Groffen" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Fabian Groffen" Message-ID: <1689148350.bf9e572160ca3ae495ebd767951b31286665fc05.grobian@gentoo> Subject: [gentoo-commits] proj/portage:prefix commit in: lib/portage/util/ X-VCS-Repository: proj/portage X-VCS-Files: lib/portage/util/hooks.py X-VCS-Directories: lib/portage/util/ X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: bf9e572160ca3ae495ebd767951b31286665fc05 X-VCS-Branch: prefix Date: Wed, 12 Jul 2023 07:52:47 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 69630e5c-3423-49e8-b7be-b95d82fa72ae X-Archives-Hash: ca113273286949332f74fcff4065ba3d commit: bf9e572160ca3ae495ebd767951b31286665fc05 Author: Fabian Groffen gentoo org> AuthorDate: Wed Jul 12 07:50:17 2023 +0000 Commit: Fabian Groffen gentoo 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 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)