Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/linux_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ jobs:
--disable-color
--with-icase=never
--with-tcl-linter=nagelfar135/nagelfar.tcl
--with-domainname=hostname
--with-domainname-opts=-d
COVERAGE: y
EXTRA_SCRIPT_PRETEST: make install-testinitrc install-testsiteconfig
EXTRA_SCRIPT_POSTTEST: make uninstall-testconfig
Expand Down Expand Up @@ -181,6 +183,8 @@ jobs:
--enable-set-shell-startup
--enable-path-entry-reorder
--disable-compressed-changelog
--with-domainname=hostname
--with-domainname-opts=-d
COVERAGE: y
EXTRA_SCRIPT_PRETEST: make install-testinitrc-1 install-testetcrc install-testmodspath
EXTRA_SCRIPT_POSTTEST: make uninstall-testconfig
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/macos_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ jobs:
macos:
runs-on: macos-15
env:
CONFIGURE_OPTS: --prefix=/tmp/modules --with-loadedmodules=null:dot --with-tcl=/opt/homebrew/lib --with-tclsh=/opt/homebrew/bin/tclsh
CONFIGURE_OPTS: |
--prefix=/tmp/modules
--with-loadedmodules=null:dot
--with-tcl=/opt/homebrew/lib
--with-tclsh=/opt/homebrew/bin/tclsh
COVERAGE: y
EXTRA_SCRIPT_PRETEST: make install-testsiteconfig-1 && export TESTSUITE_ENABLE_SITECONFIG=1
EXTRA_SCRIPT_POSTTEST: unset TESTSUITE_ENABLE_SITECONFIG
Expand Down
30 changes: 30 additions & 0 deletions INSTALL.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1125,6 +1125,32 @@ instance :instopt:`--without-modulepath<--with-modulepath>`):
.. versionchanged:: 5.6
Default ``nearly-forbidden`` tag color changed

.. instopt:: --with-domainname=BIN

Name or full path of default domainname program to use to fetch domain name
(can be superseded at run-time by environment variable)
(default=\ ``domainname``)

This installation option and :instopt:`--with-domainname-opts` define the
default value of the :mconfig:`domainname` configuration option which could
be changed after installation with the :subcmd:`config` sub-command.

.. only:: html or latex

.. versionadded:: 5.7

.. instopt:: --with-domainname-opts=OPTLIST

Settings to apply to default domainname program (default=)

This installation option and :instopt:`--with-domainname` define the default
value of the :mconfig:`domainname` configuration option which could be
changed after installation with the :subcmd:`config` sub-command.

.. only:: html or latex

.. versionadded:: 5.7

.. instopt:: --with-editor=BIN

Name or full path of default editor program to use to open modulefile through
Expand Down Expand Up @@ -1725,6 +1751,10 @@ installation.
| :mconfig:`extended_default` | ``1`` | :instopt:`--enable-extended-default`, | | |
| | | :envvar:`MODULES_EXTENDED_DEFAULT` | | |
+-----------------------------------+----------------------------------------------+----------------------------------------------+--------------+-----------+
| :mconfig:`domainname` | ``domainname`` | :instopt:`--with-domainname`, | | |
| | | :instopt:`--with-domainname-opts`, | | |
| | | :envvar:`MODULES_DOMAINNAME` | | |
+-----------------------------------+----------------------------------------------+----------------------------------------------+--------------+-----------+
| :mconfig:`editor` | ``vi`` | :instopt:`--with-editor`, | | |
| | | :envvar:`MODULES_EDITOR` | | |
+-----------------------------------+----------------------------------------------+----------------------------------------------+--------------+-----------+
Expand Down
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,12 @@ else
loggercmd := $(logger)
endif

ifneq ($(domainnameopts),)
domainnamecmd := $(domainname) $(domainnameopts)
else
domainnamecmd := $(domainname)
endif

ifeq ($(color),y)
setcolor := auto
else
Expand Down Expand Up @@ -457,6 +463,7 @@ sed -e 's|@prefix@|$(prefix)|g' \
-e 's|@loggedevents@|$(loggedevents)|g' \
-e 's|@loggercmd@|$(loggercmd)|g' \
-e 's|@pagercmd@|$(pagercmd)|g' \
-e 's|@domainnamecmd@|$(domainnamecmd)|g' \
-e 's|@paginate@|$(setpaginate)|g' \
-e 's|@verbosity@|$(verbosity)|g' \
-e 's|@color@|$(setcolor)|g' \
Expand Down
4 changes: 4 additions & 0 deletions Makefile.inc.in
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ usemanpath := @usemanpath@
# compress ChangeLog file
compressedchangelog := @compressedchangelog@

# domainname setup
domainname := @domainname@
domainnameopts := @domainnameopts@

# logger setup
loggedevents := @loggedevents@
logger := @logger@
Expand Down
5 changes: 5 additions & 0 deletions NEWS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,11 @@ Modules 5.7.0 (not yet released)
defined in profile files. (fix issue #646)
* Report a global known error when Modules Tcl extension library cannot be
loaded. (fix issue #644)
* Add :mconfig:`domainname` configuration option to define the command to run
to fetch domain name. It can be changed at installation time with
:instopt:`--with-domainname` and :instopt:`--with-domainname-opts` options.
When :mconfig:`domainname` is changed with :subcmd:`config` sub-command, it
sets the :envvar:`MODULES_DOMAINNAME` environment variable. (fix issue #645)


.. _5.6 release notes:
Expand Down
32 changes: 31 additions & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,14 @@ zshcompletiondir tcllinter tcllinteropts nagelfardatadir nagelfaraddons \
stickypurge uniquenameloaded abortonerror sourcecache logger loggeropts \
loggedevents conflictunload spideroutput spiderterseoutput spiderindepth \
emacsdatadir emacsaddons requirevia compressedchangelog paginate initenvvars \
setpythonpath appendpythonpath"
setpythonpath appendpythonpath domainname domainnameopts"
libarglist=()

# flags to know if argument has been specified on command-line
defpageropts=1
defloggeropts=1
defdomainname=1
defdomainnameopts=1

# set argument default values
prefix=/usr/local/Modules
Expand Down Expand Up @@ -100,6 +102,8 @@ VERSION=
RELEASE=
# shellcheck disable=SC2034
initconfin=etcdir
domainname='domainname'
domainnameopts=''
loggedevents=
logger='logger'
loggeropts='-t modules'
Expand Down Expand Up @@ -387,6 +391,13 @@ Optional Packages:
Rendition (SGR) code (elements in SGRLIST are
separated by \`:')
[$darkbgcolors]
--with-domainname=BIN name or full path of default domainname program to use
use to fetch domain name returned by \`uname domain'
(can be superseded at run-time by environment
variable) [$domainname]
--with-domainname-opts=OPTLIST
settings to apply to default domainname program
[$domainnameopts]
--with-editor=BIN name or full path of default editor program to use to
edit modulefiles [$editor]
--with-fishcompletiondir=DIR
Expand Down Expand Up @@ -850,6 +861,12 @@ for arg in "$@"; do
check_and_get_package_value "initconfin" "$arg" "$allowedval" ;;
--with-tclsh=*|--without-tclsh)
tclshbin=$(get_package_value "$arg") ;;
--with-domainname=*|--without-domainname)
domainname=$(get_package_value "$arg" "")
defdomainname=0 ;;
--with-domainname-opts=*|--without-domainname-opts)
domainnameopts=$(get_package_value "$arg" "")
defdomainnameopts=0 ;;
--with-logger=*|--without-logger)
logger=$(get_package_value "$arg" "") ;;
--with-logger-opts=*|--without-logger-opts)
Expand Down Expand Up @@ -1131,6 +1148,19 @@ check_requirement 'basename' '' "PATH=$binsearchpath"
# shellcheck disable=SC2034
BASENAME=$reqpath

# if option defined, get domainname program location from standard PATHs or /usr/local/bin
# or validate location passed as argument
if [ $defdomainname -eq 0 ] && [ -n "$domainname" ]; then
check_requirement "$domainname" '' "PATH=$binsearchpath"
domainname=$reqpath
fi
# adapt domainname program settings dependings of specified args
# code not needed at the moment as no options defined by default, but useful if changed in the future
if [ $defdomainnameopts -eq 1 ] && [ "${domainname##*/}" != 'domainname' ]; then
domainnameopts=''
echo_warning "As chosen domainname is not \`domainname', default domainname options are cleared"
fi

# get logger program location from standard PATHs or /usr/local/bin
# or validate location passed as argument
if [ -n "$logger" ]; then
Expand Down
6 changes: 4 additions & 2 deletions doc/source/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1085,7 +1085,8 @@ The following environment variables appeared on Modules 5.
| | :envvar:`MODULES_NON_EXPORTABLE_TAGS`, |
| | :envvar:`MODULES_INFO_EXTENSION`, |
| | :envvar:`MODULES_LINKED_ENVVARS`, |
| | :envvar:`MODULES_INIT_ENVVARS` |
| | :envvar:`MODULES_INIT_ENVVARS`, |
| | :envvar:`MODULES_DOMAINNAME` |
+------------+-----------------------------------------------------------------+

Modules Specific Tcl Commands
Expand Down Expand Up @@ -1300,7 +1301,8 @@ The following Modules configuration option has been introduced on Modules 5.
+------------+-----------------------------------------------------------------+
| 5.7 | :mconfig:`path_entry_reorder`, :mconfig:`paginate`, |
| | :mconfig:`non_exportable_tags`, :mconfig:`info_extension`, |
| | :mconfig:`linked_envvars`, :mconfig:`init_envvars` |
| | :mconfig:`linked_envvars`, :mconfig:`init_envvars`, |
| | :mconfig:`domainname` |
+------------+-----------------------------------------------------------------+

:mconfig:`auto_handling`
Expand Down
43 changes: 35 additions & 8 deletions doc/source/module.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1108,20 +1108,19 @@ Module Sub-Commands
configuration option from its default value. See :envvar:`MODULECONTACT`
description for details.

.. mconfig:: extended_default
.. mconfig:: domainname

Allow partial module version specification.
Command to fetch domain name.

Default value is ``1``. It can be changed at installation time with
:instopt:`--disable-extended-default<--enable-extended-default>` option. The
:envvar:`MODULES_EXTENDED_DEFAULT` environment variable is defined by
Default value is ``domainname``. It can be changed at installation time with
:instopt:`--with-domainname` and :instopt:`--with-domainname-opts` options.
The :envvar:`MODULES_DOMAINNAME` environment variable is defined by
:subcmd:`config` sub-command when changing this configuration option from
its default value. See :envvar:`MODULES_EXTENDED_DEFAULT` description for
details.
its default value. See :envvar:`MODULES_DOMAINNAME` description for details.

.. only:: html or latex

.. versionadded:: 4.4
.. versionadded:: 5.7

.. mconfig:: editor

Expand All @@ -1138,6 +1137,21 @@ Module Sub-Commands

.. versionadded:: 4.8

.. mconfig:: extended_default

Allow partial module version specification.

Default value is ``1``. It can be changed at installation time with
:instopt:`--disable-extended-default<--enable-extended-default>` option. The
:envvar:`MODULES_EXTENDED_DEFAULT` environment variable is defined by
:subcmd:`config` sub-command when changing this configuration option from
its default value. See :envvar:`MODULES_EXTENDED_DEFAULT` description for
details.

.. only:: html or latex

.. versionadded:: 4.4

.. mconfig:: extra_siteconfig

Additional site-specific configuration script location. See
Expand Down Expand Up @@ -5009,6 +5023,19 @@ ENVIRONMENT

.. versionadded:: 5.5

.. envvar:: MODULES_DOMAINNAME

Command to fetch domain name. The value of this variable is composed of a
domainname command name or path eventually followed by command-line options.

This environment variable value supersedes the default value set in the
:mconfig:`domainname` configuration option. It can be defined with the
:subcmd:`config` sub-command.

.. only:: html or latex

.. versionadded:: 5.7

.. envvar:: MODULES_EDITOR

Text editor command name or path for use to open modulefile through the
Expand Down
2 changes: 1 addition & 1 deletion init/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ comp_lint_opts := -a -i --all --icase
comp_modtosh_opts := --auto --no-auto --force -f --icase -i
comp_path_opts := -d --delim --duplicates
comp_rm_path_opts := -d --delim --index
comp_config_opts := --dump-state --reset abort_on_error advanced_version_spec auto_handling avail_indepth avail_output avail_terse_output cache_buffer_bytes cache_expiry_secs collection_pin_version collection_pin_tag collection_target color colors conflict_unload contact editor extended_default extra_siteconfig hide_auto_loaded home icase ignore_cache ignore_user_rc implicit_default implicit_requirement init_envvars info_extension linked_envvars list_output list_terse_output locked_configs logged_events logger mcookie_check mcookie_version_check ml nearly_forbidden_days non_exportable_tags pager paginate path_entry_reorder protected_envvars quarantine_support rcfile redirect_output require_via reset_target_state run_quarantine search_match set_shell_startup shells_with_ksh_fpath silent_shell_debug source_cache spider_indepth spider_output spider_terse_output sticky_purge tag_abbrev tag_color_name tcl_linter term_background term_width unique_name_loaded unload_match_order variant_shortcut verbosity wa_277
comp_config_opts := --dump-state --reset abort_on_error advanced_version_spec auto_handling avail_indepth avail_output avail_terse_output cache_buffer_bytes cache_expiry_secs collection_pin_version collection_pin_tag collection_target color colors conflict_unload contact domainname editor extended_default extra_siteconfig hide_auto_loaded home icase ignore_cache ignore_user_rc implicit_default implicit_requirement init_envvars info_extension linked_envvars list_output list_terse_output locked_configs logged_events logger mcookie_check mcookie_version_check ml nearly_forbidden_days non_exportable_tags pager paginate path_entry_reorder protected_envvars quarantine_support rcfile redirect_output require_via reset_target_state run_quarantine search_match set_shell_startup shells_with_ksh_fpath silent_shell_debug source_cache spider_indepth spider_output spider_terse_output sticky_purge tag_abbrev tag_color_name tcl_linter term_background term_width unique_name_loaded unload_match_order variant_shortcut verbosity wa_277

define translate-in-script
$(ECHO_GEN)
Expand Down
2 changes: 1 addition & 1 deletion init/fish_completion
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ complete -c module -n '__fish_module_use_stashlist' -f -a "(module stashlist --c
/Stash collection list\$/d; \
/:\$/d; \
/:ERROR:/d;')"
complete -c module -n '__fish_module_use_config' -f -a "--dump-state --reset abort_on_error advanced_version_spec auto_handling avail_indepth avail_output avail_terse_output cache_buffer_bytes cache_expiry_secs collection_pin_version collection_pin_tag collection_target color colors conflict_unload contact editor extended_default extra_siteconfig hide_auto_loaded home icase ignore_cache ignore_user_rc implicit_default implicit_requirement init_envvars info_extension linked_envvars list_output list_terse_output locked_configs logged_events logger mcookie_check mcookie_version_check ml nearly_forbidden_days non_exportable_tags pager paginate path_entry_reorder protected_envvars quarantine_support rcfile redirect_output require_via reset_target_state run_quarantine search_match set_shell_startup shells_with_ksh_fpath silent_shell_debug source_cache spider_indepth spider_output spider_terse_output sticky_purge tag_abbrev tag_color_name tcl_linter term_background term_width unique_name_loaded unload_match_order variant_shortcut verbosity wa_277"
complete -c module -n '__fish_module_use_config' -f -a "--dump-state --reset abort_on_error advanced_version_spec auto_handling avail_indepth avail_output avail_terse_output cache_buffer_bytes cache_expiry_secs collection_pin_version collection_pin_tag collection_target color colors conflict_unload contact domainname editor extended_default extra_siteconfig hide_auto_loaded home icase ignore_cache ignore_user_rc implicit_default implicit_requirement init_envvars info_extension linked_envvars list_output list_terse_output locked_configs logged_events logger mcookie_check mcookie_version_check ml nearly_forbidden_days non_exportable_tags pager paginate path_entry_reorder protected_envvars quarantine_support rcfile redirect_output require_via reset_target_state run_quarantine search_match set_shell_startup shells_with_ksh_fpath silent_shell_debug source_cache spider_indepth spider_output spider_terse_output sticky_purge tag_abbrev tag_color_name tcl_linter term_background term_width unique_name_loaded unload_match_order variant_shortcut verbosity wa_277"

complete -f -n '__fish_module_no_subcommand' -c module -a 'help' --description 'Print this or modulefile(s) help info'
complete -f -n '__fish_module_no_subcommand' -c module -a 'avail' --description 'List all or matching available modules'
Expand Down
2 changes: 1 addition & 1 deletion init/zsh-functions/_module.in
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ _module() {
_arguments \
'--dump-state[Report each state value of current Modules execution]' \
'--reset[Unset environment variable relative to configuration key]' \
'1:configuration key:(abort_on_error advanced_version_spec auto_handling avail_indepth avail_output avail_terse_output cache_buffer_bytes cache_expiry_secs collection_pin_version collection_pin_tag collection_target color colors conflict_unload contact editor extended_default extra_siteconfig hide_auto_loaded home icase ignore_cache ignore_user_rc implicit_default implicit_requirement init_envvars info_extension linked_envvars list_output list_terse_output locked_configs logged_events logger mcookie_check mcookie_version_check ml nearly_forbidden_days non_exportable_tags pager paginate path_entry_reorder protected_envvars quarantine_support rcfile redirect_output require_via reset_target_state run_quarantine search_match set_shell_startup shells_with_ksh_fpath silent_shell_debug source_cache spider_indepth spider_output spider_terse_output sticky_purge tag_abbrev tag_color_name tcl_linter term_background term_width unique_name_loaded unload_match_order variant_shortcut verbosity wa_277)' \
'1:configuration key:(abort_on_error advanced_version_spec auto_handling avail_indepth avail_output avail_terse_output cache_buffer_bytes cache_expiry_secs collection_pin_version collection_pin_tag collection_target color colors conflict_unload contact domainname editor extended_default extra_siteconfig hide_auto_loaded home icase ignore_cache ignore_user_rc implicit_default implicit_requirement init_envvars info_extension linked_envvars list_output list_terse_output locked_configs logged_events logger mcookie_check mcookie_version_check ml nearly_forbidden_days non_exportable_tags pager paginate path_entry_reorder protected_envvars quarantine_support rcfile redirect_output require_via reset_target_state run_quarantine search_match set_shell_startup shells_with_ksh_fpath silent_shell_debug source_cache spider_indepth spider_output spider_terse_output sticky_purge tag_abbrev tag_color_name tcl_linter term_background term_width unique_name_loaded unload_match_order variant_shortcut verbosity wa_277)' \
&& ret=0
;;
(edit)
Expand Down
7 changes: 7 additions & 0 deletions site.exp.in
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@ if {$install_loggeropts ne {}} {
append install_loggercmd " $install_loggeropts"
}

set install_domainname "@domainname@"
set install_domainnameopts "@domainnameopts@"
set install_domainnamecmd $install_domainname
if {$install_domainnameopts ne {}} {
append install_domainnamecmd " $install_domainnameopts"
}

set install_verbosity "@verbosity@"

set install_color "@color@"
Expand Down
Loading
Loading