commit:     b0a71d9aa9b0506eabde36fde85f384af5283267
Author:     Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Tue Aug 13 13:15:07 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Aug 22 19:37:46 2024 +0000
URL:        
https://gitweb.gentoo.org/proj/gentoo-functions.git/commit/?id=b0a71d9a

Print a diagnostic message if no modules can be found

The ability to locate and source the modules depends on the
genfun_basedir variable being set correctly. In the case that no modules
can be found, print a useful diagnostic message and ensure that the
return value is non-zero.

Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>

 functions.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/functions.sh b/functions.sh
index 57dfbb6..6cf7439 100644
--- a/functions.sh
+++ b/functions.sh
@@ -1060,7 +1060,10 @@ fi
 
 # Source any modules that have been selected by the GENFUN_MODULES variable.
 for _ in "${genfun_basedir}/functions"/*.sh; do
-       if _want_module "$_"; then
+       if ! test -e "$_"; then
+               warn "no gentoo-functions modules were found (genfun_basedir 
might be set incorrectly)"
+               ! break
+       elif _want_module "$_"; then
                . "$_" || return
        fi
 done

Reply via email to