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 CD97115A7D9 for ; Tue, 14 Mar 2023 16:55:41 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D884CE075F; Tue, 14 Mar 2023 16:55:40 +0000 (UTC) Received: from smtp.gentoo.org (dev.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)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id B8F22E075F for ; Tue, 14 Mar 2023 16:55:40 +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)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id D88D33410B7 for ; Tue, 14 Mar 2023 16:55:39 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 2F9CF7F9 for ; Tue, 14 Mar 2023 16:55:38 +0000 (UTC) From: "Ulrich Müller" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Ulrich Müller" Message-ID: <1678812880.c7e76fc0b9add97eda8cf406cbd168a1997e9ae3.ulm@gentoo> Subject: [gentoo-commits] proj/eselect:master commit in: /, libs/ X-VCS-Repository: proj/eselect X-VCS-Files: ChangeLog libs/core.bash.in X-VCS-Directories: libs/ / X-VCS-Committer: ulm X-VCS-Committer-Name: Ulrich Müller X-VCS-Revision: c7e76fc0b9add97eda8cf406cbd168a1997e9ae3 X-VCS-Branch: master Date: Tue, 14 Mar 2023 16:55:38 +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: 6432be68-babd-409b-b21d-70b50c99eb75 X-Archives-Hash: c09dc3a808cb4ff8982e706e4315c813 commit: c7e76fc0b9add97eda8cf406cbd168a1997e9ae3 Author: Florian Schmaus gentoo org> AuthorDate: Tue Mar 14 14:23:07 2023 +0000 Commit: Ulrich Müller gentoo org> CommitDate: Tue Mar 14 16:54:40 2023 +0000 URL: https://gitweb.gentoo.org/proj/eselect.git/commit/?id=c7e76fc0 Allow to specify modules by path * libs/core.bash.in (find_module): Allow to specify an absolute path as the module's filename. Bug: https://bugs.gentoo.org/901205 Signed-off-by: Florian Schmaus gentoo.org> Signed-off-by: Ulrich Müller gentoo.org> ChangeLog | 5 +++++ libs/core.bash.in | 11 ++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index aab936d..57a53fc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2023-03-14 Florian Schmaus + + * libs/core.bash.in (find_module): Allow to specify an absolute + path as the module's filename. + 2023-02-28 Ulrich Müller * bin/eselect.in: Disable colours if NO_COLOR is nonempty. diff --git a/libs/core.bash.in b/libs/core.bash.in index 740354e..2800cc5 100644 --- a/libs/core.bash.in +++ b/libs/core.bash.in @@ -1,5 +1,5 @@ # -*-eselect-*- vim: ft=eselect -# Copyright (c) 2005-2020 Gentoo Authors +# Copyright (c) 2005-2023 Gentoo Authors # # This file is part of the 'eselect' tools framework. # @@ -69,6 +69,15 @@ die() { # Find module and echo its filename. Die if module doesn't exist. find_module() { local modname=$1 modpath + + if [[ ${modname} == */* ]]; then + if [[ ${modname} == *.eselect && -f ${modname} ]]; then + echo "${modname}" + return + fi + die -q "Can't load module ${modname}" + fi + for modpath in "${ESELECT_MODULES_PATH[@]}"; do if [[ -f ${modpath}/${modname}.eselect ]]; then echo "${modpath}/${modname}.eselect"