poke-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[COMMITTED] poke: support for the POKE_LOAD_PATH environment variable


From: Jose E. Marchesi
Subject: [COMMITTED] poke: support for the POKE_LOAD_PATH environment variable
Date: Sat, 28 Jan 2023 03:00:57 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

2023-01-28  Jose E. Marchesi  <jemarch@gnu.org>

        * poke/poke.c (initialize): Honor POKE_LOAD_PATH.
        (print_help): Document new env var.
        * doc/poke.texi (Invoking poke): Likewise.
---
 ChangeLog     |  6 ++++++
 doc/poke.texi |  8 ++++++++
 poke/poke.c   | 10 +++++++++-
 3 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 924a72d8..bbbaf2ef 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2023-01-28  Jose E. Marchesi  <jemarch@gnu.org>
+
+       * poke/poke.c (initialize): Honor POKE_LOAD_PATH.
+       (print_help): Document new env var.
+       * doc/poke.texi (Invoking poke): Likewise.
+
 2023-01-28  Jose E. Marchesi  <jemarch@gnu.org>
 
        * bootstrap.conf (gnulib_modules): Remove obsolete package memcpy.
diff --git a/doc/poke.texi b/doc/poke.texi
index c0dd5b71..943d12bb 100644
--- a/doc/poke.texi
+++ b/doc/poke.texi
@@ -562,6 +562,14 @@ Print a help message and exit.
 Show version and exit.
 @end table
 
+The following environment variables, if set, are used by poke:
+
+@table @code
+@item POKE_LOAD_PATH
+List of file paths separated by the colon characters (@code{:}) which
+is prepended to the @code{load_path} when poke starts.
+@end table
+
 @node Commanding poke
 @section Commanding poke
 
diff --git a/poke/poke.c b/poke/poke.c
index 989b316b..893e6739 100644
--- a/poke/poke.c
+++ b/poke/poke.c
@@ -206,6 +206,12 @@ print_help (void)
   puts (_("      --version                       show version and exit"));
 
   puts ("");
+  puts (_("The following environment variables, if set, are used by poke:"));
+  puts ("");
+  puts (_("      POKE_LOAD_PATH                  List of file paths 
separated"));
+  puts (_("                                      by colon characters (:) 
which"));
+  puts (_("                                      is prepended to the 
load_path"));
+  puts (_("                                      when poke starts"));
   /* TRANSLATORS: --help output 5+ (reports)
      TRANSLATORS: the placeholder indicates the bug-reporting address
      for this application.  Please add _another line_ with the
@@ -606,9 +612,11 @@ initialize (int argc, char *argv[])
   {
     pk_val load_path = pk_decl_val (poke_compiler, "load_path");
     char *newpaths;
+    const char *env_load_path = getenv ("POKE_LOAD_PATH");
 
     assert (load_path != PK_NULL);
-    newpaths = pk_str_concat (pk_string_str (load_path),
+    newpaths = pk_str_concat (env_load_path ? env_load_path : "",
+                              pk_string_str (load_path),
                               ":",
                               poke_appdir,
                               ":",
-- 
2.30.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]