[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 9/9] variables: define default BASH_LIBRARIES_PATH
From: |
Matheus Afonso Martins Moreira |
Subject: |
[PATCH 9/9] variables: define default BASH_LIBRARIES_PATH |
Date: |
Sun, 5 May 2024 06:55:02 -0300 |
Define a build time configurable default value
for the new BASH_LIBRARIES_PATH variable.
Look for libraries in the user's home directory
as well as the system wide directories.
Signed-off-by: Matheus Afonso Martins Moreira <matheus@matheusmoreira.com>
---
config-top.h | 7 +++++++
variables.c | 1 +
2 files changed, 8 insertions(+)
diff --git a/config-top.h b/config-top.h
index db4ab6ee..8f31e285 100644
--- a/config-top.h
+++ b/config-top.h
@@ -83,6 +83,13 @@
"/usr/local/lib/bash:/usr/lib/bash:/opt/local/lib/bash:/usr/pkg/lib/bash:/opt/pkg/lib/bash:."
#endif
+/* The default value of the BASH_LIBRARIES_PATH variable
+ which is used by source -l instead of PATH. */
+#ifndef DEFAULT_LIBRARIES_PATH
+#define DEFAULT_LIBRARIES_PATH \
+ "~/.local/lib/bash:/usr/local/lib/bash:/usr/lib/bash"
+#endif
+
/* Default primary and secondary prompt strings. */
#define PPROMPT "\\s-\\v\\$ "
#define SPROMPT "> "
diff --git a/variables.c b/variables.c
index 1a0c2c45..f2f8c76c 100644
--- a/variables.c
+++ b/variables.c
@@ -697,6 +697,7 @@ initialize_shell_variables (env, privmode)
uidset ();
temp_var = set_if_not ("BASH_LOADABLES_PATH",
DEFAULT_LOADABLE_BUILTINS_PATH);
+ temp_var = set_if_not ("BASH_LIBRARIES_PATH", DEFAULT_LIBRARIES_PATH);
temp_var = find_variable ("BASH_XTRACEFD");
if (temp_var && imported_p (temp_var))
--
2.44.0
[PATCH 5/9] builtins/source: refactor file searching function, Matheus Afonso Martins Moreira, 2024/05/05
[PATCH 6/9] builtins/source: define library search function, Matheus Afonso Martins Moreira, 2024/05/05
[PATCH 7/9] builtins/source: add the -l|--library options, Matheus Afonso Martins Moreira, 2024/05/05
[PATCH 8/9] builtins/source: search libraries in library mode, Matheus Afonso Martins Moreira, 2024/05/05
[PATCH 9/9] variables: define default BASH_LIBRARIES_PATH,
Matheus Afonso Martins Moreira <=
Re: [PATCH 0/9] Add library mode to source builtin, Lawrence Velázquez, 2024/05/05
Re: [PATCH 0/9] Add library mode to source builtin, Chet Ramey, 2024/05/07
Re: [PATCH 0/9] Add library mode to source builtin, Kerin Millar, 2024/05/07