diff --git a/.github/workflows/linux_tests.yaml b/.github/workflows/linux_tests.yaml index 43211eadc..bc26960f6 100644 --- a/.github/workflows/linux_tests.yaml +++ b/.github/workflows/linux_tests.yaml @@ -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 @@ -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 diff --git a/.github/workflows/macos_tests.yaml b/.github/workflows/macos_tests.yaml index 4dde326aa..d369d03c5 100644 --- a/.github/workflows/macos_tests.yaml +++ b/.github/workflows/macos_tests.yaml @@ -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 diff --git a/INSTALL.rst b/INSTALL.rst index 4c3250071..22a8f3acd 100644 --- a/INSTALL.rst +++ b/INSTALL.rst @@ -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 @@ -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` | | | +-----------------------------------+----------------------------------------------+----------------------------------------------+--------------+-----------+ diff --git a/Makefile b/Makefile index fbe092472..be3ecc4ca 100644 --- a/Makefile +++ b/Makefile @@ -315,6 +315,12 @@ else loggercmd := $(logger) endif +ifneq ($(domainnameopts),) + domainnamecmd := $(domainname) $(domainnameopts) +else + domainnamecmd := $(domainname) +endif + ifeq ($(color),y) setcolor := auto else @@ -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' \ diff --git a/Makefile.inc.in b/Makefile.inc.in index 6aca1ca78..29ee6019e 100644 --- a/Makefile.inc.in +++ b/Makefile.inc.in @@ -68,6 +68,10 @@ usemanpath := @usemanpath@ # compress ChangeLog file compressedchangelog := @compressedchangelog@ +# domainname setup +domainname := @domainname@ +domainnameopts := @domainnameopts@ + # logger setup loggedevents := @loggedevents@ logger := @logger@ diff --git a/NEWS.rst b/NEWS.rst index 06ab3049d..7f9cbed8c 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -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: diff --git a/configure b/configure index 66b5ade05..321a76b40 100755 --- a/configure +++ b/configure @@ -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 @@ -100,6 +102,8 @@ VERSION= RELEASE= # shellcheck disable=SC2034 initconfin=etcdir +domainname='domainname' +domainnameopts='' loggedevents= logger='logger' loggeropts='-t modules' @@ -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 @@ -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) @@ -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 diff --git a/doc/source/changes.rst b/doc/source/changes.rst index 1965ad1c6..1df47afb5 100644 --- a/doc/source/changes.rst +++ b/doc/source/changes.rst @@ -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 @@ -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` diff --git a/doc/source/module.rst b/doc/source/module.rst index 9a7d12753..15bdbab71 100644 --- a/doc/source/module.rst +++ b/doc/source/module.rst @@ -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 @@ -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 @@ -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 diff --git a/init/Makefile b/init/Makefile index 675c57935..e30fc1513 100644 --- a/init/Makefile +++ b/init/Makefile @@ -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) diff --git a/init/fish_completion b/init/fish_completion index 4e50f9ac1..9a670cd9f 100644 --- a/init/fish_completion +++ b/init/fish_completion @@ -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' diff --git a/init/zsh-functions/_module.in b/init/zsh-functions/_module.in index 3be62d9c5..bb80c0836 100644 --- a/init/zsh-functions/_module.in +++ b/init/zsh-functions/_module.in @@ -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) diff --git a/site.exp.in b/site.exp.in index dc7963f58..a38bebbc8 100644 --- a/site.exp.in +++ b/site.exp.in @@ -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@" diff --git a/tcl/init.tcl.in b/tcl/init.tcl.in index 273141146..66571f6a7 100644 --- a/tcl/init.tcl.in +++ b/tcl/init.tcl.in @@ -27,7 +27,7 @@ array set g_state_defs [list\ autoinit {0}\ cache_mcookie_version {5.3}\ clock_seconds { initStateClockSeconds}\ - domainname { {runCommand domainname}}\ + domainname { initStateDomainname}\ error_count {0}\ extra_siteconfig_loaded {0}\ false_rendered {0}\ @@ -97,6 +97,7 @@ array set g_config_defs [list\ colors {MODULES_COLORS {} 0 l {} {} initConfColors}\ conflict_unload {MODULES_CONFLICT_UNLOAD @conflictunload@ 0 b {0 1}}\ csh_limit {{} 4000 0 i}\ + domainname {MODULES_DOMAINNAME {@domainnamecmd@} 0 s}\ extra_siteconfig {MODULES_SITECONFIG 1 s {}}\ editor {MODULES_EDITOR {@editor@} 0 s {} {} initConfEditor}\ hide_auto_loaded {MODULES_HIDE_AUTO_LOADED 0 0 b {0 1}}\ @@ -517,6 +518,10 @@ proc initStateLinkedEnvvars {} { return [array get ::g_linkedEnvvars] } +proc initStateDomainname {} { + return [runCommand {*}[getConf domainname]] +} + # Determine if logging need to be started proc initStateLogging {} { set logger_not_empty [string length [lindex [getConf logger] 0]] diff --git a/testsuite/install.00-init/010-environ.exp b/testsuite/install.00-init/010-environ.exp index e2fbfd8a6..848056570 100644 --- a/testsuite/install.00-init/010-environ.exp +++ b/testsuite/install.00-init/010-environ.exp @@ -94,6 +94,9 @@ setenv_var MODULES_PAGINATE 1 unsetenv_var MODULES_LOGGED_EVENTS unsetenv_var MODULES_LOGGER +# clean any domainname configuration +unsetenv_var MODULES_DOMAINNAME + # clean any environment variable-specific configuration setenv_var MODULES_INIT_ENVVARS {} unsetenv_var MODULES_PROTECTED_ENVVARS diff --git a/testsuite/modules.00-init/005-init_ts.exp b/testsuite/modules.00-init/005-init_ts.exp index 7ac00fb45..43b17d716 100644 --- a/testsuite/modules.00-init/005-init_ts.exp +++ b/testsuite/modules.00-init/005-init_ts.exp @@ -248,7 +248,7 @@ if {![string length $xrdb]} { send_user "\tX11 setup is [expr {$is_xrdb_avail ? {KO} : {OK}}]\n" # check if domainname binary is available on this system -set domainname [auto_execok domainname] +set domainname [auto_execok $install_domainname] # ensure id command is run with POSIX locale to correctly parse it if {[info exists ::env(LANG)]} { @@ -466,7 +466,7 @@ set xrdb_warn "$x11_warn_prefix\n$error_msgs: $xrdb_notfound_msg" if {!$is_xrdb_avail} { set x11_warn "$x11_warn_prefix\n$error_msgs: $xrdb_issue_msg" } -set domainname_warn "$error_msgs: Command 'domainname' cannot be found" +set domainname_warn "$error_msgs: Command '$install_domainname' cannot be found" set lsb_cmd_err "$error_msgs: Command 'lsb_release' cannot be found" @@ -949,6 +949,10 @@ proc is_real_shell {shell} { return [expr {[lsearch -exact $::real_shells $shell] != -1}] } +proc is_full_path {file_path} { + return [regexp {^(|\.|\.\.)/} $file_path] +} + # helper procedures to format block message output proc msg_block_content {args} { set msg {} diff --git a/testsuite/modules.00-init/010-environ.exp b/testsuite/modules.00-init/010-environ.exp index 93a6fe8a7..e001f4f10 100644 --- a/testsuite/modules.00-init/010-environ.exp +++ b/testsuite/modules.00-init/010-environ.exp @@ -95,6 +95,9 @@ setenv_var MODULES_PAGINATE 1 unsetenv_var MODULES_LOGGED_EVENTS unsetenv_var MODULES_LOGGER +# clean any domainname configuration +unsetenv_var MODULES_DOMAINNAME + # clean any environment variable-specific configuration setenv_var MODULES_INIT_ENVVARS {} unsetenv_var MODULES_PROTECTED_ENVVARS diff --git a/testsuite/modules.50-cmds/090-uname-proc.exp b/testsuite/modules.50-cmds/090-uname-proc.exp index 70d0ef1ca..6f5bb26c4 100644 --- a/testsuite/modules.50-cmds/090-uname-proc.exp +++ b/testsuite/modules.50-cmds/090-uname-proc.exp @@ -61,14 +61,14 @@ if {$uname eq ""} { if {$domainname eq ""} { if {$verbose} { - send_user "\tNo executable 'domainname' found ...\n" + send_user "\tNo executable '$install_domainname' found ...\n" } set u_domain "unknown" } else { if {$verbose} { - send_user "\tUsing '$domainname' for domainname checking ...\n" + send_user "\tUsing '$install_domainnamecmd' for domainname checking ...\n" } - set u_domain [exec $domainname] + set u_domain [exec {*}$install_domainnamecmd] } # diff --git a/testsuite/modules.50-cmds/095-uname.exp b/testsuite/modules.50-cmds/095-uname.exp index ec467434f..23f9f69f7 100644 --- a/testsuite/modules.50-cmds/095-uname.exp +++ b/testsuite/modules.50-cmds/095-uname.exp @@ -121,7 +121,16 @@ foreach field [list sysname release machine] { foreach field [list nodename version] { testouterr_cmd "csh" "load $module/$field" "ERR" [msg_load $module/$field $uname_warn] } -testouterr_cmd "csh" "load $module/domain" "ERR" [msg_load $module/domain $domainname_warn] + +if {$domainname ne {} && [is_full_path $install_domainname]} { + set ans [list] + lappend ans [list set _LMFILES_ "$modulefile/domain"] + lappend ans [list set LOADEDMODULES "$module/domain"] + lappend ans [list set testsuite $u_domain noescval] + testouterr_cmd_re "csh" "load $module/domain" $ans {} +} else { + testouterr_cmd "csh" "load $module/domain" "ERR" [msg_load $module/domain $domainname_warn] +} # diff --git a/testsuite/modules.50-cmds/350-allin.exp b/testsuite/modules.50-cmds/350-allin.exp index 1ca61856c..dae1d6706 100644 --- a/testsuite/modules.50-cmds/350-allin.exp +++ b/testsuite/modules.50-cmds/350-allin.exp @@ -50,7 +50,7 @@ set u_release $tcl_platform(osVersion) set u_machine $tcl_platform(machine) set u_nodename [exec uname -n] set u_version [exec uname -v] -set u_domain [exec domainname] +set u_domain [exec {*}$install_domainnamecmd] regsub -all {([.+?()])} $u_sysname {\\\1} u_sysnamere regsub -all {([.+?()])} $u_release {\\\1} u_releasere regsub -all {([.+?()])} $u_machine {\\\1} u_machinere diff --git a/testsuite/modules.70-maint/220-config.exp b/testsuite/modules.70-maint/220-config.exp index f855fa811..c5753ccb0 100644 --- a/testsuite/modules.70-maint/220-config.exp +++ b/testsuite/modules.70-maint/220-config.exp @@ -74,6 +74,7 @@ array set configdfl [list\ colors [expr {$install_termbg eq {dark} ? $valid_darkbgcolors : $valid_lightbgcolors}]\ conflict_unload [expr {$install_conflictunload eq {y}}]\ contact root@localhost\ + domainname "$install_domainnamecmd"\ editor "$install_editor"\ extended_default [expr {$install_extendeddefault eq {y}}]\ extra_siteconfig \ @@ -147,6 +148,7 @@ array set configvar [list\ colors MODULES_COLORS\ conflict_unload MODULES_CONFLICT_UNLOAD\ contact MODULECONTACT\ + domainname MODULES_DOMAINNAME\ editor MODULES_EDITOR\ extended_default MODULES_EXTENDED_DEFAULT\ extra_siteconfig MODULES_SITECONFIG\ @@ -426,6 +428,8 @@ foreach param [array names configvar] { set val foo=% } elseif {$param eq {pager}} { set val $configdfl(pager) + } elseif {$param eq {domainname}} { + set val $configdfl(domainname) } elseif {$param eq {init_envvars}} { set val FOO=val } elseif {$param eq {linked_envvars}} { @@ -496,7 +500,7 @@ foreach param [lsort [array names configset]] { } append tserr "\n\n$state_header" -if {[auto_execok uname] eq {} || [auto_execok domainname] eq {}} { +if {[auto_execok uname] eq {} || $domainname eq {}} { append tserr "(\nWARNING: Command '\\S+' cannot be found)+" } if {$lsb_cmd eq {}} { @@ -560,7 +564,7 @@ foreach param [lsort [array names configset]] { } } append tserr "\n\n$state_header" -if {[auto_execok uname] eq {} || [auto_execok domainname] eq {}} { +if {[auto_execok uname] eq {} || $domainname eq {}} { append tserr "(\nWARNING: Command '\\S+' cannot be found)+" } if {$lsb_cmd eq {}} { diff --git a/testsuite/modules.70-maint/390-state.exp b/testsuite/modules.70-maint/390-state.exp index 01402277e..8bfb85512 100644 --- a/testsuite/modules.70-maint/390-state.exp +++ b/testsuite/modules.70-maint/390-state.exp @@ -30,7 +30,7 @@ set statelist [list always_read_full_file autoinit clock_seconds cmdline command # set tserr "$vers_reportre\n\n$state_header" -if {[auto_execok uname] eq {} || [auto_execok domainname] eq {}} { +if {[auto_execok uname] eq {} || $domainname eq {}} { append tserr "(\nWARNING: Command '\\S+' cannot be found)+" } if {$lsb_cmd eq {}} {