diff --git a/.travis.yml b/.travis.yml index f60771fb7..8f39b0ce2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -237,7 +237,8 @@ matrix: - env: CONFIGURE_OPTS='--prefix=/tmp/modules --disable-compat-version' MAKE_TESTCOVERAGE='y' os: osx - - env: CONFIGURE_OPTS='--prefix=/tmp/modules --enable-compat-version --with-loadedmodules=null:dot' + # need to specify where to find tclConfig.sh on newer xcode release + - env: CONFIGURE_OPTS='--prefix=/tmp/modules --enable-compat-version --with-loadedmodules=null:dot --with-tcl=/System/Library/Frameworks/Tcl.framework/Versions/8.5' os: osx diff --git a/INSTALL.rst b/INSTALL.rst index 4b575a9b6..f7cdb2789 100644 --- a/INSTALL.rst +++ b/INSTALL.rst @@ -23,8 +23,6 @@ the tools to be found on your system: * bash * make * sed -* grep -* cut * runtest When also installing the bundled compatibility version of Modules (enabled @@ -33,6 +31,7 @@ by default), these additional tools are needed: * autoconf * automake * autopoint +* grep * gcc * tcl-devel >= 8.4 diff --git a/Makefile b/Makefile index 9e0f7c10b..c529b1d78 100644 --- a/Makefile +++ b/Makefile @@ -57,45 +57,18 @@ ifeq ($(GIT_CURRENT_TAG),$(GIT_CURRENT_DESC)) MODULES_BUILD := else ifeq ($(GIT_CURRENT_BRANCH),master) MODULES_BUILD := +$(subst $(GIT_CURRENT_TAG)-,,$(GIT_CURRENT_DESC)) +else ifeq ($(GIT_CURRENT_BRANCH),v4.1.x) +MODULES_BUILD := +$(subst $(GIT_CURRENT_TAG)-,,$(GIT_CURRENT_DESC)) else MODULES_BUILD := +$(GIT_CURRENT_BRANCH)$(subst $(GIT_CURRENT_TAG),,$(GIT_CURRENT_DESC)) endif # determine RPM release -# retrieve all parts of the release number and increase minor release number -MODULES_RELEASE_BASE := $(firstword $(subst -, ,$(MODULES_RELEASE))) -ifeq ($(MODULES_RELEASE),$(MODULES_RELEASE_BASE)) -MODULES_RELEASE_SUFFIX := -else -MODULES_RELEASE_SUFFIX := $(subst $(MODULES_RELEASE_BASE)-,,$(MODULES_RELEASE)) -endif -MODULES_LAST_RPM_VERSREL := $(shell $(GREP) -Pzo -m 1 '%changelog\n+\*.* - \K.*\n' \ +# use last release if we currently sat on tag, append build number to it elsewhere +MODULES_LAST_RPM_VERSREL := $(shell sed -n '/^%changelog/ {n;s/^\*.* - //p;q;}' \ contrib/rpm/environment-modules.spec.in) - -MODULES_LAST_RPM_RELEASE := $(subst $(MODULES_RELEASE_BASE)-,,$(MODULES_LAST_RPM_VERSREL)) -ifneq ($(MODULES_RELEASE_SUFFIX),) -MODULES_LAST_RPM_RELEASE := $(subst .$(MODULES_RELEASE_SUFFIX),,$(MODULES_LAST_RPM_RELEASE)) -endif - -# use last release if we currently sat on tag -ifeq ($(GIT_CURRENT_TAG),$(GIT_CURRENT_DESC)) -MODULES_RPM_RELEASE := $(MODULES_LAST_RPM_RELEASE) -else -MODULES_LAST_RPM_RELEASE_P1 := $(firstword $(subst ., ,$(MODULES_LAST_RPM_RELEASE))) -MODULES_LAST_RPM_RELEASE_P2 := $(subst $(MODULES_LAST_RPM_RELEASE_P1).,,$(MODULES_LAST_RPM_RELEASE)) - -ifeq ($(MODULES_LAST_RPM_RELEASE_P2),) -MODULES_RPM_RELEASE_P2 := 1 -else -MODULES_RPM_RELEASE_P2 := $(shell echo $$(($(MODULES_LAST_RPM_RELEASE_P2)+1))) -endif - -MODULES_RPM_RELEASE := $(MODULES_LAST_RPM_RELEASE_P1).$(MODULES_RPM_RELEASE_P2) -ifneq ($(MODULES_RELEASE_SUFFIX),) -MODULES_RPM_RELEASE := $(MODULES_RPM_RELEASE).$(MODULES_RELEASE_SUFFIX) -endif -MODULES_RPM_RELEASE := $(MODULES_RPM_RELEASE)$(subst -,.,$(MODULES_BUILD)) -endif +MODULES_LAST_RPM_RELEASE := $(lastword $(subst -, ,$(MODULES_LAST_RPM_VERSREL))) +MODULES_RPM_RELEASE := $(MODULES_LAST_RPM_RELEASE)$(subst +,.,$(subst -,.,$(MODULES_BUILD))) else # source version definitions shared across the Makefiles of this project diff --git a/Makefile.inc.in b/Makefile.inc.in index 67acdf559..a7f532780 100644 --- a/Makefile.inc.in +++ b/Makefile.inc.in @@ -53,6 +53,5 @@ TCLSH := @TCLSH@ SPHINXBUILD := @SPHINXBUILD@ PS := @PS@ BASENAME := @BASENAME@ -GREP := @GREP@ RMDIR_IGN_NON_EMPTY := @RMDIR_IGN_NON_EMPTY@ diff --git a/NEWS.rst b/NEWS.rst index 9304d6282..ee2633d82 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -7,6 +7,51 @@ This file describes changes in recent versions of Modules. It primarily documents those changes that are of interest to users and admins. +Modules 4.1.4 (2018-08-20) +-------------------------- + +* Doc: fix typo on ``getenv`` command description in modulefile(4) man page + and clarify this command should be preferred over ``::env`` variable to + query environment variable value in modulefile. +* Init: fix ``bash`` and ``zsh`` completion scripts to enable Extended Regular + Expression (ERE) on ``sed`` command with ``-E`` argument (rather ``-r``) for + compatibility with OS X's and BSDs' sed. (fix issue#178) +* Handle default version sets on an hidden modulefile (were not found + previously). (fix issue#177) +* Init: fix ``ksh`` initialization script for ksh88 compatibility. (fix + issue#159) +* Install: use ``sed`` command rather ``grep`` and ``cut`` in ``configure`` + and ``Makefile`` scripts. (fix issue#175 with contribution from Michael + Sternberg) +* Fix typo, tab indentation and pipe opening mode on ``createmodule.py`` + utility script. (contribution from Jan Synacek) +* Check ``ModulesVersion`` value set from ``.version`` rc file to ensure this + value refers to a version name in current directory. Report error if a + nested value is detected and ignore this value. (fix issue#176) + + +Modules 4.1.3 (2018-06-18) +-------------------------- + +* Make ``setenv`` command alter ``env`` Tcl global array during ``help``, + ``test`` or ``whatis`` evaluation modes. (fix issue#160) +* Doc: describe MANPATH variable special treatment on compatibility version + in diff_v3_v4 document. +* Initialize and export _moduleraw SH shell function if ``stderr`` is attached + to a terminal. Was previously checking ``stdout``. (fix issue#169) +* For ``csh`` shells, quote code generated by modulecmd.tcl to pass it to the + ``eval`` shell command. +* Escape special characters when producing code to define shell aliases (fix + issue#165) +* Correct modulefile lookup when a modulefile directory is overwritten by a + module alias definition but it contains an empty sub-directory. (fix + issue#170) +* Doc: describe ``getenv`` command in modulefile(4) man page. +* Improve SH shell detection in profile.sh initialization script to use shell + variable on ``bash`` or ``zsh`` to determine current shell name. (fix + issue#173) + + Modules 4.1.2 (2018-03-31) -------------------------- diff --git a/configure b/configure index e97299f63..7bd80d29e 100755 --- a/configure +++ b/configure @@ -26,7 +26,7 @@ prog=${progpath##*/} targetlist="${progdir}/Makefile.inc ${progdir}/site.exp" # argument list -arglist="TCLSH SPHINXBUILD PS BASENAME GREP RMDIR_IGN_NON_EMPTY VERSION \ +arglist="TCLSH SPHINXBUILD PS BASENAME RMDIR_IGN_NON_EMPTY VERSION \ baseprefix prefix bindir libexecdir etcdir initdir datarootdir mandir docdir \ modulefilesdir setmanpath setbinpath setdotmodulespath docinstall \ examplemodulefiles builddoc gitworktree usemanpath compatversion EXEEXT \ @@ -57,7 +57,6 @@ gitworktree=y usemanpath=y PS=ps BASENAME=basename -GREP=grep RMDIR_IGN_NON_EMPTY=rmdir VERSION= pager=less @@ -329,15 +328,6 @@ case "$kernelname" in esac check_requirement $make check_requirement sed -# ensure a GNU grep is used on Solaris and Darwin -if [ "$kernelname" = 'SunOS' -o "$kernelname" = 'Darwin' ]; then - grep='ggrep' -else - grep='grep' -fi -check_requirement $grep -GREP=$reqpath -check_requirement cut check_requirement runtest "Install \`dejagnu' if you want to run the \ testsuite" check_requirement manpath 'Will rely on MANPATH to get enabled man directories' @@ -397,15 +387,15 @@ if [ -d '.git' ]; then release=${gitcurtag#v} if [ "$gitcurtag" = "$gitcurdesc" ]; then build='' - elif [ "$gitcurbranch" = 'master' ]; then + elif [ "$gitcurbranch" = 'master' -o "$gitcurbranch" = 'v4.1.x' ]; then build="+${gitcurdesc#${gitcurtag}-}" else build="+${gitcurbranch}${gitcurdesc#${gitcurtag}}" fi # elsewhere fetch modules version from version.inc file elif [ -r ${progdir}/version.inc ]; then - release=$(grep '^MODULES_RELEASE ' ${progdir}/version.inc | cut -d ' ' -f 3) - build=$(grep '^MODULES_BUILD ' ${progdir}/version.inc | cut -d ' ' -f 3) + release=$(sed -n '/^MODULES_RELEASE/{s/.*= //p;q;}' ${progdir}/version.inc) + build=$(sed -n '/^MODULES_BUILD/{s/.*= //p;q;}' ${progdir}/version.inc) fi VERSION=$release$build diff --git a/contrib/cookbook/top-priority-values/modulefiles/bar/1 b/contrib/cookbook/top-priority-values/modulefiles/bar/1 new file mode 100644 index 000000000..09776f4ec --- /dev/null +++ b/contrib/cookbook/top-priority-values/modulefiles/bar/1 @@ -0,0 +1,9 @@ +#%Module +# define a regular value for variable +setenv TESTVAR value + +# prepend a regular value to a path-like variable +prepend-path TESTPATH prevalue + +# append a regular value to a path-like variable +append-path TESTPATH postvalue diff --git a/contrib/cookbook/top-priority-values/modulefiles/foo/1 b/contrib/cookbook/top-priority-values/modulefiles/foo/1 new file mode 100644 index 000000000..2e2a309ff --- /dev/null +++ b/contrib/cookbook/top-priority-values/modulefiles/foo/1 @@ -0,0 +1,9 @@ +#%Module +# define a value for variable holding top priority (not overwritten by non-top priority value) +setenv --top TESTVAR topvalue + +# prepend a value to a path-like variable, value that stays first position +prepend-path --top TESTPATH topprevalue + +# append a value to a path-like variable, value that stays last position +append-path --top TESTPATH toppostvalue diff --git a/contrib/cookbook/top-priority-values/siteconfig.tcl b/contrib/cookbook/top-priority-values/siteconfig.tcl new file mode 100644 index 000000000..f68d3f48e --- /dev/null +++ b/contrib/cookbook/top-priority-values/siteconfig.tcl @@ -0,0 +1,103 @@ +# +# siteconfig.tcl - Site specific configuration introducing a '--top' argument +# for the setenv, append-path and prepend-path modulefile commands. '--top' +# argument enables a value set with this flag on to hold top priority and +# thus cannot be altered unless by another top priority value. For +# 'append-path' command, '--top' ensure value will stay at last position in +# path-like variable. Same goes for 'prepend-path' where '--top' ensure +# first position in path-like variable. +# +# Author: Xavier Delaruelle +# Compatibility: Modules v4.1 +# +# Installation: put this file in the 'etc' directory of your Modules +# installation. Refer to the "Modulecmd startup" section in the +# module(1) man page to get this location. + +# override 'setenv' procedure to add a '--top' optional argument +rename ::setenv ::__setenv +proc setenv {args} { + set topPriority 0 + set errArgMsg "wrong # args: should be \"setenv ?--top? var val\"" + switch -- [llength $args] { + {3} { + if {[lindex $args 0] eq "--top"} { + set topPriority 1 + } else { + error $errArgMsg + } + set var [lindex $args 1] + set val [lindex $args 2] + } + {2} { + set var [lindex $args 0] + set val [lindex $args 1] + } + default { + error $errArgMsg + } + } + + if {$topPriority} { + # define an helper variable to know a top-priority value has been set + if {[currentMode] ne "display"} { + __setenv MODULES_PRIORITY_$var $val + } + __setenv $var $val + # set non-priority value only if no top priority value already set + } elseif {![info exists ::env(MODULES_PRIORITY_$var)]} { + __setenv $var $val + } +} + +# override 'add-path' procedure to add a '--top' optional argument, which +# will benefit to the 'append-path' and 'prepend-path' modulefile commands +rename ::add-path ::__add-path +proc add-path {pos args} { + set keep_top_priority 0 + set arglist [lsearch -all -inline -not -exact $args "--top"] + lassign [eval parsePathCommandArgs "add-path" $arglist] separator\ + allow_dup idx_val var path_list + + # top priority asked + if {[llength $arglist] != [llength $args]} { + # record this top priority value in an helper variable + __setenv MODULES_PRIORITY_${pos}_$var $path_list + } elseif {[info exists ::env(MODULES_PRIORITY_${pos}_$var)]} { + set keep_top_priority 1 + } + + # ensure top-priority value keeps first or last position by unloading it + # priority new value addition, then restoring it + if {$keep_top_priority} { + eval __unload-path $var $::env(MODULES_PRIORITY_${pos}_$var) + } + + eval __add-path $pos $arglist + + if {$keep_top_priority} { + eval __add-path $pos $var $::env(MODULES_PRIORITY_${pos}_$var) + } +} + +rename ::unload-path ::__unload-path +proc unload-path {args} { + set arglist [lsearch -all -inline -not -exact $args "--top"] + lassign [eval parsePathCommandArgs "unload-path" $arglist] separator\ + allow_dup idx_val var path_list + + if {[llength $arglist] != [llength $args]} { + # wipe priority helper variable when unloading top priority value + switch -- [lindex [info level -1] 0] { + {append-path} { set pos "append" } + {prepend-path} { set pos "prepend" } + } + if {[info exists pos]} { + __setenv MODULES_PRIORITY_${pos}_$var $path_list + } + } + + eval __unload-path $arglist +} + +# vim:set tabstop=3 shiftwidth=3 expandtab autoindent: diff --git a/contrib/rpm/environment-modules.spec.in b/contrib/rpm/environment-modules.spec.in index 4f561f784..aab970981 100644 --- a/contrib/rpm/environment-modules.spec.in +++ b/contrib/rpm/environment-modules.spec.in @@ -1,7 +1,7 @@ %global macrosdir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d) Name: environment-modules -Version: 4.1.2 +Version: 4.1.4 Release: @MODULES_RPM_RELEASE@%{?dist} Summary: Provides dynamic modification of a user's environment @@ -217,6 +217,12 @@ fi %changelog +* Mon Aug 20 2018 Xavier Delaruelle - 4.1.4-1 +- Update to 4.1.4 + +* Mon Jun 18 2018 Xavier Delaruelle - 4.1.3-1 +- Update to 4.1.3 + * Sat Mar 31 2018 Xavier Delaruelle - 4.1.2-1 - Update to 4.1.2 diff --git a/contrib/scripts/createmodule.py b/contrib/scripts/createmodule.py index 3c778c127..000728799 100755 --- a/contrib/scripts/createmodule.py +++ b/contrib/scripts/createmodule.py @@ -39,10 +39,10 @@ # Return environment after a command def getenv(cmd = ':'): env = {} - p = Popen(cmd + ";env", shell=True, stdout=PIPE, stderr=PIPE) + p = Popen(cmd + ";env", shell=True, stdout=PIPE, stderr=PIPE, universal_newlines=True) (stdout, stderr) = p.communicate() if p.returncode != 0: - print("EROR: Could not execute initscript:") + print("ERROR: Could not execute initscript:") print("%s returned exit code %d" % (cmd, p.returncode)) print(stderr) exit(1) @@ -105,7 +105,7 @@ def normpaths(paths): continue #Working directory change if key == 'PWD': - chdir=os.path.normpath(env2[key]) + chdir=os.path.normpath(env2[key]) pathnames.append(chdir) del env2[key] continue diff --git a/doc/source/diff_v3_v4.rst b/doc/source/diff_v3_v4.rst index ddc7ebdc4..5aa40e1b6 100644 --- a/doc/source/diff_v3_v4.rst +++ b/doc/source/diff_v3_v4.rst @@ -153,6 +153,8 @@ Modules Specific Tcl Commands Modules 4 supports adding or removing empty path element to a path-like variable, whereas compatibility version looses track of this path element when the path-like variable is modified afterward. Empty path element enables to set a leading colon character *:*, which has a specific meaning on some regular environment variable like **MANPATH** or **LD_LIBRARY_PATH**. + When adding a path element to the **MANPATH** environment variable, Modules 4 is treating this variable like any other whereas a special treatment was applied on compatibility version: a default MANPATH value, set at configure time, was appended in case **MANPATH** variable was unset. + **remove-path** Modules 4 provides path element counting feature which increases a reference counter each time a given path entry is added to a given environment variable. As consequence a path entry element is removed from a path-like variable only if the related element counter is equal to 1. If this counter is greater than 1, path element is kept in variable and reference counter is decreased by 1. diff --git a/doc/source/modulefile.rst b/doc/source/modulefile.rst index 273d15baa..8f6cd40c1 100644 --- a/doc/source/modulefile.rst +++ b/doc/source/modulefile.rst @@ -132,6 +132,12 @@ the *modulefile* is being loaded. then when unloading a module, it will set *variable* to *value*. The **unsetenv** command changes the process' environment like **setenv**. +**getenv** variable + + Returns value of environment *variable*. If *variable* is not defined + *_UNDEFINED_* is returned. **getenv** command should be preferred over Tcl + global variable **env** to query environment variables. + **append-path** [-d C|--delim C|--delim=C] [--duplicates] variable value... See **prepend-path**. @@ -498,8 +504,9 @@ will be sourced. Otherwise the file *.version* is looked up in the directory. If the *.version* file exists, it is opened and interpreted as Tcl code and takes precedence over a *.modulerc* file in the same directory. If the Tcl variable **ModulesVersion** is set by the *.version* file, **modulecmd.tcl** -will use the name as if it specifies a *modulefile* in the directory. This -will become the default *modulefile* in this case. +will use the name as if it specifies a *modulefile* in this directory. This +will become the default *modulefile* in this case. **ModulesVersion** cannot +refer to a *modulefile* located in a different directory. If **ModulesVersion** is a directory, the search begins anew down that directory. If the name does not match any files located in the current diff --git a/init/bash.in b/init/bash.in index ce9822b43..1a111e41d 100644 --- a/init/bash.in +++ b/init/bash.in @@ -48,7 +48,7 @@ unset _mlre _mlv _mlrv @compatversion@# redefine module command if compat version has been activated @compatversion@if [ "${MODULES_USE_COMPAT_VERSION:-0}" = '1' ]; then @compatversion@ MODULES_CMD=@libexecdir@/modulecmd-compat; export MODULES_CMD -@compatversion@ if [ -t 1 ]; then +@compatversion@ if [ -t 2 ]; then @compatversion@ _moduleraw() { eval `@libexecdir@/modulecmd-compat bash $*`; } @compatversion@ else @compatversion@ module() { eval `@libexecdir@/modulecmd-compat bash $*`; } @@ -56,7 +56,7 @@ unset _mlre _mlv _mlrv @compatversion@fi @compatversion@ # export functions to get them defined in sub-shells -if [ -t 1 ]; then +if [ -t 2 ]; then export -f _moduleraw fi export -f module diff --git a/init/bash_completion.in b/init/bash_completion.in index b11880614..a93381f4b 100644 --- a/init/bash_completion.in +++ b/init/bash_completion.in @@ -21,7 +21,7 @@ _module_savelist() { } _module_not_yet_loaded() { - _module_avail | sort | sed -r "\%^(${LOADEDMODULES//:/|})$%d" + _module_avail | sort | sed -E "\%^(${LOADEDMODULES//:/|})$%d" } _module_long_arg_list() { diff --git a/init/ksh.in b/init/ksh.in index 834b8224d..df59ecb99 100644 --- a/init/ksh.in +++ b/init/ksh.in @@ -48,7 +48,7 @@ unset _mlre _mlv _mlrv @compatversion@# redefine module command if compat version has been activated @compatversion@if [ "${MODULES_USE_COMPAT_VERSION:-0}" = '1' ]; then @compatversion@ MODULES_CMD=@libexecdir@/modulecmd-compat; export MODULES_CMD -@compatversion@ if [ -t 1 ]; then +@compatversion@ if [ -t 2 ]; then @compatversion@ _moduleraw() { eval `@libexecdir@/modulecmd-compat ksh $*`; } @compatversion@ else @compatversion@ module() { eval `@libexecdir@/modulecmd-compat ksh $*`; } @@ -75,7 +75,7 @@ unset _mlre _mlv _mlrv @compatversion@ # switch version only if command found @compatversion@ if [ $swfound -eq 0 ]; then @compatversion@ echo "Switching to Modules $swname version" -@compatversion@ source @initdir@/ksh +@compatversion@ . @initdir@/ksh @compatversion@ else @compatversion@ echo "Cannot switch to Modules $swname version, command not found" @compatversion@ return 1 @@ -93,7 +93,7 @@ BASH_ENV=@initdir@/bash; export BASH_ENV # set for 'zsh' shell when it starts. _mlinstr=":$FPATH:" if [ "${_mlinstr#*:@initdir@/ksh-functions:}" = "$_mlinstr" ]; then - FPATH+="${FPATH:+:}@initdir@/ksh-functions"; export FPATH + FPATH=$FPATH${FPATH:+:}@initdir@/ksh-functions; export FPATH fi @setbinpath@_mlinstr=":$PATH:" diff --git a/init/profile.sh.in b/init/profile.sh.in index b68519bb4..6926f5cbf 100644 --- a/init/profile.sh.in +++ b/init/profile.sh.in @@ -1,4 +1,12 @@ -shell=$(@BASENAME@ $(@PS@ -p $$ -ocomm=)) +# get current shell name by querying shell variables or looking at parent +# process name +if [ -n "${BASH:-}" ]; then + shell=${BASH##*/} +elif [ -n "${ZSH_NAME:-}" ]; then + shell=$ZSH_NAME +else + shell=$(@BASENAME@ $(@PS@ -p $$ -ocomm=)) +fi if [ -f @initdir@/$shell ]; then . @initdir@/$shell diff --git a/init/sh.in b/init/sh.in index 197b865e3..2fa271c59 100644 --- a/init/sh.in +++ b/init/sh.in @@ -48,7 +48,7 @@ unset _mlre _mlv _mlrv @compatversion@# redefine module command if compat version has been activated @compatversion@if [ "${MODULES_USE_COMPAT_VERSION:-0}" = '1' ]; then @compatversion@ MODULES_CMD=@libexecdir@/modulecmd-compat; export MODULES_CMD -@compatversion@ if [ -t 1 ]; then +@compatversion@ if [ -t 2 ]; then @compatversion@ _moduleraw() { eval `@libexecdir@/modulecmd-compat sh $*`; } @compatversion@ else @compatversion@ module() { eval `@libexecdir@/modulecmd-compat sh $*`; } @@ -57,7 +57,7 @@ unset _mlre _mlv _mlrv @compatversion@ # if sh is bash, export functions to get them defined in sub-shells if [ "${BASH:-}" != '' ]; then - if [ -t 1 ]; then + if [ -t 2 ]; then export -f _moduleraw fi export -f module diff --git a/init/zsh-functions/_module b/init/zsh-functions/_module index 45042d10d..50718b127 100644 --- a/init/zsh-functions/_module +++ b/init/zsh-functions/_module @@ -25,7 +25,7 @@ _module_savelist() { } _module_not_yet_loaded() { - _module_avail | sort | sed -r "\%^(${LOADEDMODULES//:/|})$%d" + _module_avail | sort | sed -E "\%^(${LOADEDMODULES//:/|})$%d" } diff --git a/init/zsh.in b/init/zsh.in index b2c10ef6a..54244bba7 100644 --- a/init/zsh.in +++ b/init/zsh.in @@ -48,7 +48,7 @@ unset _mlre _mlv _mlrv @compatversion@# redefine module command if compat version has been activated @compatversion@if [ "${MODULES_USE_COMPAT_VERSION:-0}" = '1' ]; then @compatversion@ MODULES_CMD=@libexecdir@/modulecmd-compat; export MODULES_CMD -@compatversion@ if [ -t 1 ]; then +@compatversion@ if [ -t 2 ]; then @compatversion@ _moduleraw() { eval `@libexecdir@/modulecmd-compat zsh $*`; } @compatversion@ else @compatversion@ module() { eval `@libexecdir@/modulecmd-compat zsh $*`; } diff --git a/modulecmd.tcl.in b/modulecmd.tcl.in index 8da9c63fe..d33f99bd7 100755 --- a/modulecmd.tcl.in +++ b/modulecmd.tcl.in @@ -710,8 +710,13 @@ proc execute-modulerc {modfile} { # default version set via ModulesVersion variable in .version file # override previously defined default version for modname if {[file tail $modfile] eq ".version" && $::ModulesVersion ne ""} { - setModuleResolution "$modname/default" $modname/$::ModulesVersion\ - "default" + # ModulesVersion should target an element in current directory + if {[string first "/" $::ModulesVersion] == -1} { + setModuleResolution "$modname/default" $modname/$::ModulesVersion\ + "default" + } else { + reportError "Invalid ModulesVersion '$::ModulesVersion' defined" + } } # Keep track of rc files we already sourced so we don't run them again @@ -1630,13 +1635,22 @@ proc setenv {var val} { reportDebug "setenv: ($var,$val) mode = $mode" - if {$mode eq "load"} { + # Set the variable for later use during the modulefile evaluation + # for all mode except unload + if {$mode ne "unload"} { set ::env($var) $val - set ::g_stateEnvVars($var) "new" # clean any previously defined reference counter array set sharevar [getModshareVarName $var] if {[info exists ::env($sharevar)]} { unset-env $sharevar + set sharevarunset 1 + } + } + + # propagate variable setup to shell environment on load mode + if {$mode eq "load"} { + set ::g_stateEnvVars($var) "new" + if {[info exists sharevarunset]} { set ::g_stateEnvVars($sharevar) "del" } }\ @@ -1647,9 +1661,6 @@ proc setenv {var val} { set ::g_stateEnvVars($var) "del" }\ elseif {$mode eq "display" && !$::g_inhibit_dispreport} { - # Let display set the variable for later use in the display - # but don't commit it to the env - set ::env($var) $val report "setenv\t\t$var\t$val" } return {} @@ -2707,6 +2718,11 @@ proc getPathToModule {mod {indir {}} {look_loaded "no"} {excdir {}}} { {directory} { # Move to default element in directory set mod "$mod/[lindex $mod_list($mod) 1]" + # restart search if default element is hidden and hidden + # elements were not searched + if {!$fetch_hidden && [isModuleHidden $mod]} { + return [getPathToModule $mod $indir] + } } {modulefile} { # If mod was a file in this path, return that file @@ -3144,26 +3160,28 @@ proc renderSettings {} { foreach var [array names g_stateAliases] { switch -- $g_stateAliases($var) { {new} { + set val $::g_Aliases($var) + # convert $n in !!:n and $* in !* on csh (like on compat version) + if {$::g_shellType eq "csh"} { + regsub -all {([^\\]|^)\$([0-9]+)} $val {\1!!:\2} val + regsub -all {([^\\]|^)\$\*} $val {\1!*} val + } + # unescape \$ after now csh-specific conversion is over + regsub -all {\\\$} $val {$} val switch -- $::g_shellType { {csh} { - # set val [charEscaped $::g_Aliases($var)] - set val $::g_Aliases($var) - # Convert $n -> \!\!:n - regsub -all {\$([0-9]+)} $val {\\!\\!:\1} val - # Convert $* -> \!* - regsub -all {\$\*} $val {\\!*} val - puts stdout "alias $var '$val';" + set val [charEscaped $val] + puts stdout "alias $var $val;" } {sh} { - set val $::g_Aliases($var) - puts stdout "alias $var='$val';" + set val [charEscaped $val] + puts stdout "alias $var=$val;" } {fish} { - set val $::g_Aliases($var) - puts stdout "alias $var '$val';" + set val [charEscaped $val] + puts stdout "alias $var $val;" } {cmd} { - set val $::g_Aliases($var) puts stdout "doskey $var=$val" } } @@ -3448,7 +3466,7 @@ proc renderAutoinit {} { set post_hi {set histchars = $_histchars; unset _histchars;} set pre_pr {set _prompt="$prompt"; set prompt="";} set post_pr {set prompt="$_prompt"; unset _prompt;} - set eval_cmd "eval `$tclshbin $::argv0 $::g_shell \\!*`;" + set eval_cmd "eval \"`$tclshbin $::argv0 $::g_shell \\!*:q`\";" set pre_ex {set _exit="$status";} set post_ex {test 0 = $_exit} @@ -4377,6 +4395,10 @@ proc getModules {dir {mod {}} {fetch_mtime 0} {search {}} {fetch_hidden 0}} { && [info exists mod_list($par_dir)]} { set dir_name [file tail $dir] set dir $par_dir + # quit if something has overwritten the directory definition + if {[lindex $mod_list($dir) 0] ne "directory"} { + break + } # get upper dir content without empty dir (as dir_list is sorted # parent dir information have already been consolidated) set elt_list [lsearch -all -inline -not -exact [lrange\ diff --git a/testsuite/bin/install_test_sh b/testsuite/bin/install_test_sh index 7555ffae5..c54e6fab5 100755 --- a/testsuite/bin/install_test_sh +++ b/testsuite/bin/install_test_sh @@ -91,6 +91,13 @@ fi # execute command list or perform recursive call case "$mode" in top|launch) + # enable alias resolution on bash for tests + if [ "$shname" = 'bash' ]; then + shopt -s expand_aliases + # enable word splitting for the below loop on zsh + elif [ "$shname" = 'zsh' ]; then + setopt sh_word_split + fi IFS=';' for cmd in ${cmdlist}; do unset IFS diff --git a/testsuite/install.00-init/005-init_ts.exp b/testsuite/install.00-init/005-init_ts.exp index 2b340cdb0..dc6218bbc 100644 --- a/testsuite/install.00-init/005-init_ts.exp +++ b/testsuite/install.00-init/005-init_ts.exp @@ -179,8 +179,9 @@ foreach shell [list sh bash basheu ksh zsh csh tcsh fish tcl perl python ruby cm # where to find module tcl script to call for autoinit command set autoinit_script "$install_libexecdir/modulecmd.tcl" -# where to find contrib modulefiles for test +# where to find modulefiles for test set contrib_modpath "$env(TESTSUITEDIR)/../contrib/modulefiles" +set testsuite_modpath "$env(TESTSUITEDIR)/modulefiles" # basic messages set type_help "Try 'module --help' for more information." diff --git a/testsuite/install.00-init/020-module.exp b/testsuite/install.00-init/020-module.exp index 17b8a743a..e6e61166f 100644 --- a/testsuite/install.00-init/020-module.exp +++ b/testsuite/install.00-init/020-module.exp @@ -41,6 +41,15 @@ foreach shell $shell_list { testall_cmd "$shell" "module use $contrib_modpath\; module load null\; module info-loaded null" "null" "" 0 } +# ensure tools used in complex shell alias definition are available +if {[find_bin grep] ne "" && [find_bin tr] ne "" && [find_bin awk] ne ""} { + foreach shell $shell_list { + testall_cmd_re "$shell" "module load $testsuite_modpath/alias/3.0\; testsuite" "Release" ".*" 0 + } +} elseif {$verbose > 0} { + send_user "\tSkipping shell alias definition tests\n" +} + foreach shell $othlang_list { testall_cmd_re "$shell" "--version" "^\$" "^Modules Release \\S+ (\\S+)\$" 0 testall_cmd_re "$shell" "foo" "^\$" "$bad_cmd\n$type_help.*" 1 diff --git a/testsuite/install.00-init/040-subshell.exp b/testsuite/install.00-init/040-subshell.exp index 00dddd795..e5deaf8d6 100644 --- a/testsuite/install.00-init/040-subshell.exp +++ b/testsuite/install.00-init/040-subshell.exp @@ -53,8 +53,8 @@ foreach shell $shell_list { zsh { testall_cmd_re "$shell" "module --version" "^\$" "$zsh_nf\$" 127 testall_cmd_re "$shell" "module foo" "^\$" "$zsh_nf\$" 127 - testall_cmd_re "$shell" "module use $contrib_modpath\; module purge\; module load null\; module list -t" "^\$" ".*$zsh_nf\n.*$zsh_nf\n.*$zsh_nf\n.*$zsh_nf\$" 127 - testall_cmd_re "$shell" "module use $contrib_modpath\; module purge\; module load null\; module unload null\; module list -t" "^\$" ".*$zsh_nf\n.*$zsh_nf\n.*$zsh_nf\n.*$zsh_nf\n.*$zsh_nf\$" 127 + testall_cmd_re "$shell" "module use $contrib_modpath\; module purge\; module load null\; module list -t" "^\$" ".*$zsh_nf\n.*$zsh_nf\n.*$zsh_nf\n.*$zsh_nf\$" 252 + testall_cmd_re "$shell" "module use $contrib_modpath\; module purge\; module load null\; module unload null\; module list -t" "^\$" ".*$zsh_nf\n.*$zsh_nf\n.*$zsh_nf\n.*$zsh_nf\n.*$zsh_nf\$" 123 } csh { testall_cmd_re "$shell" "module --version" "^\$" "$csh_nf\$" 1 @@ -101,8 +101,8 @@ foreach shell $shell_list { zsh { testall_cmd_re "$shell" "module --version" "^\$" "$zsh_nf\$" 127 testall_cmd_re "$shell" "module foo" "^\$" "$zsh_nf\$" 127 - testall_cmd_re "$shell" "module use $contrib_modpath\; module purge\; module load null\; module list -t" "^\$" ".*$zsh_nf\n.*$zsh_nf\n.*$zsh_nf\n.*$zsh_nf\$" 127 - testall_cmd_re "$shell" "module use $contrib_modpath\; module purge\; module load null\; module unload null\; module list -t" "^\$" ".*$zsh_nf\n.*$zsh_nf\n.*$zsh_nf\n.*$zsh_nf\n.*$zsh_nf\$" 127 + testall_cmd_re "$shell" "module use $contrib_modpath\; module purge\; module load null\; module list -t" "^\$" ".*$zsh_nf\n.*$zsh_nf\n.*$zsh_nf\n.*$zsh_nf\$" 252 + testall_cmd_re "$shell" "module use $contrib_modpath\; module purge\; module load null\; module unload null\; module list -t" "^\$" ".*$zsh_nf\n.*$zsh_nf\n.*$zsh_nf\n.*$zsh_nf\n.*$zsh_nf\$" 123 } csh { testall_cmd_re "$shell" "module --version" "^\$" "$csh_nf\$" 1 diff --git a/testsuite/modulefiles.deep/badmodvers/.version b/testsuite/modulefiles.deep/badmodvers/.version new file mode 100644 index 000000000..f8dc17800 --- /dev/null +++ b/testsuite/modulefiles.deep/badmodvers/.version @@ -0,0 +1,3 @@ +#%Module1.0 +set ModulesVersion "dir1/2.0" + diff --git a/testsuite/modulefiles.deep/badmodvers/dir1/2.0 b/testsuite/modulefiles.deep/badmodvers/dir1/2.0 new file mode 100644 index 000000000..3956ec6f1 --- /dev/null +++ b/testsuite/modulefiles.deep/badmodvers/dir1/2.0 @@ -0,0 +1,3 @@ +#%Module1.0 +module-whatis "badmodvers/dir1/2.0" + diff --git a/testsuite/modulefiles.deep/badmodvers/foo b/testsuite/modulefiles.deep/badmodvers/foo new file mode 100644 index 000000000..bd108100f --- /dev/null +++ b/testsuite/modulefiles.deep/badmodvers/foo @@ -0,0 +1,3 @@ +#%Module1.0 +module-whatis "badmodvers/foo" + diff --git a/testsuite/modulefiles.deep/moddalias/.modulerc b/testsuite/modulefiles.deep/moddalias/.modulerc new file mode 100644 index 000000000..51d4a1dfd --- /dev/null +++ b/testsuite/modulefiles.deep/moddalias/.modulerc @@ -0,0 +1,28 @@ +#%Module1.0 + +############################################################################## +# Modules Revision 3.0 +# Providing a flexible user environment +# +# File: moddalias/%M% +# Revision: %I% +# First Edition: 2018/05/24 +# Last Mod.: %U%, %G% +# +# Authors: Xavier Delaruelle, xavier.delaruelle@cea.fr +# +# Description: Testuite modulefile +# Command: +# Sub-Command: +# +# Invocation: +# Result: %R{ +# }R% +# Comment: %C{ +# Test alias is correctly resolved when it overwrites a directory +# and an empty directory is a child of this overwritten directory +# }C% +# +############################################################################## + +module-alias moddalias moddalias/dir1 diff --git a/testsuite/modulefiles.deep/moddalias/dir1/1 b/testsuite/modulefiles.deep/moddalias/dir1/1 new file mode 100644 index 000000000..3ee6715e3 --- /dev/null +++ b/testsuite/modulefiles.deep/moddalias/dir1/1 @@ -0,0 +1,28 @@ +#%Module1.0 + +############################################################################## +# Modules Revision 3.0 +# Providing a flexible user environment +# +# File: moddalias/%M% +# Revision: %I% +# First Edition: 2018/05/24 +# Last Mod.: %U%, %G% +# +# Authors: Xavier Delaruelle, xavier.delaruelle@cea.fr +# +# Description: Testuite modulefile +# Command: +# Sub-Command: +# +# Invocation: +# Result: %R{ +# }R% +# Comment: %C{ +# Test alias is correctly resolved when it overwrites a directory +# and an empty directory is a child of this overwritten directory +# }C% +# +############################################################################## + +module-whatis [module-info name] diff --git a/testsuite/modulefiles.deep/moddalias/dir2/.ignored b/testsuite/modulefiles.deep/moddalias/dir2/.ignored new file mode 100644 index 000000000..1bc89295f --- /dev/null +++ b/testsuite/modulefiles.deep/moddalias/dir2/.ignored @@ -0,0 +1 @@ +# not modulefile diff --git a/testsuite/modulefiles/alias/3.0 b/testsuite/modulefiles/alias/3.0 new file mode 100644 index 000000000..90b392e0c --- /dev/null +++ b/testsuite/modulefiles/alias/3.0 @@ -0,0 +1,35 @@ +#%Module1.0 + +############################################################################## +# Modules Revision 3.0 +# Providing a flexible user environment +# +# File: alias/%M% +# Revision: %I% +# First Edition: 2018/05/19 +# Last Mod.: %U%, %G% +# +# Authors: Xavier Delaruelle +# +# Description: Testuite modulefile +# Command: +# Sub-Command: set-alias +# +# Comment: %C{ +# Check how special characters in alias definition are handled +# }C% +# +############################################################################## + +switch -- [module-info shelltype] { + {sh} { + set-alias testsuite {echo $(grep "report \"Modules " modulecmd.tcl | tr -d \\ | awk '{print \$3}')} + } + {csh} { + set-alias testsuite {echo `grep "report "'"'"Modules " modulecmd.tcl | tr -d \\ | awk '{print \$3}'`} + } + {fish} { + set-alias testsuite {echo (grep "report \"Modules " modulecmd.tcl | tr -d \\ | awk '{print \$3}')} + } +} + diff --git a/testsuite/modulefiles/loc_rc010/.1.0 b/testsuite/modulefiles/loc_rc010/.1.0 new file mode 100644 index 000000000..f2107393d --- /dev/null +++ b/testsuite/modulefiles/loc_rc010/.1.0 @@ -0,0 +1,36 @@ +#%Module1.0 + +############################################################################## +# Modules Revision 3.0 +# Providing a flexible user environment +# +# File: loc_rc010/%M% +# Revision: %I% +# First Edition: 2018/07/13 +# Last Mod.: %U%, %G% +# +# Authors: Xavier Delaruelle, xavier.delaruelle@cea.fr +# +# Description: Testuite modulefile +# Command: ModulesHelp, ModulesTest, module-whatis, setenv +# Sub-Command: +# +# Invocation: +# Result: %R{ +# }R% +# Comment: %C{ +# Test the correct location of hidden modules (modulefile with +# part of their name starting with a "dot") +# }C% +# +############################################################################## + +proc ModulesHelp {} { +} + +proc ModulesTest {} { + return 1 +} + +module-whatis "[module-info name]" +setenv testsuite "yes" diff --git a/testsuite/modulefiles/loc_rc010/.modulerc b/testsuite/modulefiles/loc_rc010/.modulerc new file mode 100644 index 000000000..f8f8e3c8e --- /dev/null +++ b/testsuite/modulefiles/loc_rc010/.modulerc @@ -0,0 +1,28 @@ +#%Module1.0 + +############################################################################## +# Modules Revision 3.0 +# Providing a flexible user environment +# +# File: loc_rc010/%M% +# Revision: %I% +# First Edition: 2018/07/13 +# Last Mod.: %U%, %G% +# +# Authors: Xavier Delaruelle, xavier.delaruelle@cea.fr +# +# Description: Testuite modulefile +# Command: module-version +# Sub-Command: +# +# Invocation: +# Result: %R{ +# }R% +# Comment: %C{ +# Test the correct location of hidden modules (modulefile with +# part of their name starting with a "dot") +# }C% +# +############################################################################## + +module-version ./.1.0 default diff --git a/testsuite/modulefiles/loc_rc010/2.0 b/testsuite/modulefiles/loc_rc010/2.0 new file mode 100644 index 000000000..f2107393d --- /dev/null +++ b/testsuite/modulefiles/loc_rc010/2.0 @@ -0,0 +1,36 @@ +#%Module1.0 + +############################################################################## +# Modules Revision 3.0 +# Providing a flexible user environment +# +# File: loc_rc010/%M% +# Revision: %I% +# First Edition: 2018/07/13 +# Last Mod.: %U%, %G% +# +# Authors: Xavier Delaruelle, xavier.delaruelle@cea.fr +# +# Description: Testuite modulefile +# Command: ModulesHelp, ModulesTest, module-whatis, setenv +# Sub-Command: +# +# Invocation: +# Result: %R{ +# }R% +# Comment: %C{ +# Test the correct location of hidden modules (modulefile with +# part of their name starting with a "dot") +# }C% +# +############################################################################## + +proc ModulesHelp {} { +} + +proc ModulesTest {} { + return 1 +} + +module-whatis "[module-info name]" +setenv testsuite "yes" diff --git a/testsuite/modulefiles/modbad/empty b/testsuite/modulefiles/modbad/empty new file mode 100644 index 000000000..c1b96bb75 --- /dev/null +++ b/testsuite/modulefiles/modbad/empty @@ -0,0 +1,31 @@ +#%Module1.0 + +############################################################################## +# Modules Revision 3.0 +# Providing a flexible user environment +# +# File: modbad/%M% +# Revision: %I% +# First Edition: 2018/04/01 +# Last Mod.: %U%, %G% +# +# Authors: Xavier Delaruelle, xavier.delaruelle@cea.fr +# +# Description: Testuite modulefile +# Command: +# +# Invocation: +# Result: %R{ +# }R% +# Comment: %C{ +# test behavior against a modulefile using module sub-commands +# only reachable from command line +# }C% +# +############################################################################## + +module {} +module append-path FOO bar +module prepend-path FOO bar +module remove-path FOO bar +module autoinit diff --git a/testsuite/modulefiles/setenv/0.6 b/testsuite/modulefiles/setenv/0.6 new file mode 100644 index 000000000..d7aacf759 --- /dev/null +++ b/testsuite/modulefiles/setenv/0.6 @@ -0,0 +1,29 @@ +#%Module1.0 + +############################################################################## +# Modules Revision 3.0 +# Providing a flexible user environment +# +# File: setenv/%M% +# Revision: %I% +# First Edition: 2018/04/06 +# Last Mod.: %U%, %G% +# +# Authors: Xavier Delaruelle, xavier.delaruelle@cea.fr +# +# Description: Testuite modulefile +# Command: +# Sub-Command: setenv +# +# Invocation: load, unload, display, help, test +# Result: %R{ +# }R% +# Comment: %C{ +# Check the effect of 'setenv' command on $env() array variable +# through the different modulefile evaluation mode +# }C% +# +############################################################################## + +setenv TS1 yes +setenv TS2 $env(TS1) diff --git a/testsuite/modules.00-init/006-procs.exp b/testsuite/modules.00-init/006-procs.exp index d5c62dde4..e2693fead 100644 --- a/testsuite/modules.00-init/006-procs.exp +++ b/testsuite/modules.00-init/006-procs.exp @@ -219,8 +219,7 @@ proc shell_val {test_shell val {re_mode 0}} { if {$val ne "(.*)"} { switch -- $test_shell { {sh} - {bash} - {ksh} - {zsh} - {csh} - {tcsh} - {fish} { - set val [regsub -all {([\\$])} $val {\\\1}] - set val [regsub -all {([ ()])} $val {\\\\\1}] + set val [regsub -all {([\\"'$|{}`* ()!])} $val {\\\1}] } {lisp} - {cmake} { set val [regsub -all {(["])} $val {\\\1}] @@ -234,7 +233,8 @@ proc shell_val {test_shell val {re_mode 0}} { } if {$re_mode} { - set val [regsub -all {([+()])} $val {\\\1}] + # over escape regexp-special characters + set val [regsub -all {([$.+?\\()])} $val {\\\1}] } } @@ -347,19 +347,23 @@ proc shell_unset {test_shell var {re_mode 0}} { return $answer } -proc shell_alias {test_shell var val {re_mode 0}} { +proc shell_alias {test_shell var val {re_mode 0} {escval 1}} { if {$re_mode} { set esc "\\" } else { set esc "" } + if {$escval} { + set val [shell_val $test_shell $val $re_mode] + } + switch -- $test_shell { {sh} - {bash} - {ksh} - {zsh} { - set answer "alias $var='$val';" + set answer "alias $var=$val;" } {csh} - {tcsh} - {fish} { - set answer "alias $var '$val';" + set answer "alias $var $val;" } {cmd} { set answer "doskey $var=$val" diff --git a/testsuite/modules.20-locate/067-hidden.exp b/testsuite/modules.20-locate/067-hidden.exp index f2639c107..73c916e12 100644 --- a/testsuite/modules.20-locate/067-hidden.exp +++ b/testsuite/modules.20-locate/067-hidden.exp @@ -88,6 +88,15 @@ set modulefile_10 "$modpath/$module_10" set modulefilere_10 "$modpathre/$module_10" set modavail_10 "$module_10\\s+$datetime_re" +# hidden module is set default +set modsym_11 "loc_rc010" +set module_11 "$modsym_11/.1.0" +set modulefile_11 "$modpath/$module_11" +set modulefilere_11 "$modpathre/$module_11" +# does not appear on avail command, but appear on whatis and paths +set modavail_11 "$modsym_11/2.0\\s+$datetime_re" +set modwhatis_11 "\\s+$module_11: $module_11\n\\s+$modsym_11/2.0: $modsym_11/2.0" +set modpaths_11 [list $modulefile_11 $modpath/$modsym_11/2.0] set help_pre "$modlin\nModule Specific Help for " set help_post ":\n\n$modlin" @@ -105,7 +114,7 @@ set whatis_pre "$modlin $modpathre $modlin\n" # The tests # -for {set i 1} {$i <= 10} {incr i} { +for {set i 1} {$i <= 11} {incr i} { set modsym [set "modsym_${i}"] set module [set "module_${i}"] set modulefile [set "modulefile_${i}"] @@ -206,7 +215,7 @@ unset header_long unset avail_pre unset whatis_pre -for {set i 1} {$i <= 10} {incr i} { +for {set i 1} {$i <= 11} {incr i} { unset "modsym_${i}" unset "module_${i}" unset "modulefile_${i}" diff --git a/testsuite/modules.50-cmds/029-setenv-env.exp b/testsuite/modules.50-cmds/029-setenv-env.exp new file mode 100644 index 000000000..6a5f18156 --- /dev/null +++ b/testsuite/modules.50-cmds/029-setenv-env.exp @@ -0,0 +1,172 @@ +############################################################################## +# Modules Revision 3.0 +# Providing a flexible user environment +# +# File: modules.50-cmds/%M% +# Revision: %I% +# First Edition: 2018/04/06 +# Last Mod.: %U%, %G% +# +# Authors: Xavier Delaruelle, xavier.delaruelle@cea.fr +# +# Description: Testuite testsequence +# Command: load, unload, display, help, test +# Modulefiles: setenv/0.6 +# Sub-Command: +# +# Comment: %C{ +# Check the effect of 'setenv' command on $env() array variable +# through the different modulefile evaluation mode +# }C% +# +############################################################################## + +set module "setenv/0.6" +set modulefile "$modpath/$module" +set modulefilere "$modpathre/$module" + +# +# test load mode +# + +set ans [list] +lappend ans [list set TS1 yes] +lappend ans [list set TS2 yes] +lappend ans [list setpath LOADEDMODULES $module] +lappend ans [list setpath _LMFILES_ $modulefile] +testouterr_cmd "sh" "load $module" $ans "" + +# test with value set to variable prior to load +set env(TS1) "no" +testouterr_cmd "sh" "load $module" $ans "" + + +# +# test unload mode +# + +# test with module loaded +set env(TS1) "yes" +set env(TS2) "yes" +set env(LOADEDMODULES) $module +set env(_LMFILES_) $modulefile + +set ans [list] +lappend ans [list unset TS1] +lappend ans [list unset TS2] +lappend ans [list unsetpath LOADEDMODULES] +lappend ans [list unsetpath _LMFILES_] +testouterr_cmd "sh" "unload $module" $ans "" + +# test with module loaded but vanished env vars +unset env(TS1) +unset env(TS2) + +# raise an error +set tserr "$moderr_msgs: can't read \"env(TS1)\": no such variable + In '$modulefile' +$err_contact" + +testouterr_cmd "sh" "unload $module" "ERR" $tserr + + +# restore environment +unset env(LOADEDMODULES) +unset env(_LMFILES_) + + +# +# test display mode +# + +set tserr "$modlin +$modulefilere: + +setenv\t\tTS1\tyes +setenv\t\tTS2\tyes +$modlin" + +# test without module loaded +testouterr_cmd_re "sh" "display $module" "" $tserr + +# test with module loaded +set env(TS1) "yes" +set env(TS2) "yes" +set env(LOADEDMODULES) $module +set env(_LMFILES_) $modulefile + +testouterr_cmd_re "sh" "display $module" "" $tserr + +# restore environment +unset env(TS1) +unset env(TS2) +unset env(LOADEDMODULES) +unset env(_LMFILES_) + + +# +# test help mode +# + +set tserr "$modlin +Module Specific Help for $modulefilere: + +$warn_msgs: Unable to find ModulesHelp in $modulefilere. +$modlin" + +# test without module loaded +testouterr_cmd_re "sh" "help $module" "" $tserr + +# test with module loaded +set env(TS1) "yes" +set env(TS2) "yes" +set env(LOADEDMODULES) $module +set env(_LMFILES_) $modulefile + +testouterr_cmd_re "sh" "help $module" "" $tserr + +# restore environment +unset env(TS1) +unset env(TS2) +unset env(LOADEDMODULES) +unset env(_LMFILES_) + + +# +# test test mode +# + +set tserr "$modlin +Module Specific Test for $modulefilere: + +$warn_msgs: Unable to find ModulesTest in $modulefilere. +$modlin" + +# test without module loaded +testouterr_cmd_re "sh" "test $module" "" $tserr + +# test with module previously loaded +set env(TS1) "yes" +set env(TS2) "yes" +set env(LOADEDMODULES) $module +set env(_LMFILES_) $modulefile + +testouterr_cmd_re "sh" "test $module" "" $tserr + +# restore environment +unset env(TS1) +unset env(TS2) +unset env(LOADEDMODULES) +unset env(_LMFILES_) + + +# +# Cleanup +# + +unset tserr +unset ans + +unset modulefilere +unset modulefile +unset module diff --git a/testsuite/modules.50-cmds/042-append-delim.exp b/testsuite/modules.50-cmds/042-append-delim.exp index 5a7c5e221..7dc2a33ba 100644 --- a/testsuite/modules.50-cmds/042-append-delim.exp +++ b/testsuite/modules.50-cmds/042-append-delim.exp @@ -32,7 +32,7 @@ set ts_2 "http://foobar.net" set ts_3 "http://foobar.com" set ts_new "$ts_1 $ts_2 $ts_3" # test colon char is correctly escaped in _modshare var -set tsmod_new "http\\\\://foobar.com:1:http\\\\://foobar.net:1:http\\\\://foobar.org:1" +set tsmod_new "http\\://foobar.com:1:http\\://foobar.net:1:http\\://foobar.org:1" set env(testsuite) "$ts_1 $ts_2" set env(testsuite_modshare) "http\\://foobar.org:1:http\\://foobar.net:1" set module "append/1.0" @@ -87,7 +87,7 @@ testouterr_cmd "sh" "load $module" "ERR" $ts_err set module "append/1.6" set modulefile "$modpath/$module" set ts_new "$ts_1 $ts_2 $ts_3 http://foobar.io " -set tsmod_new ":1:http\\\\://foobar.com:1:http\\\\://foobar.net:1:http\\\\://foobar.io:1:http\\\\://foobar.org:1" +set tsmod_new ":1:http\\://foobar.com:1:http\\://foobar.net:1:http\\://foobar.io:1:http\\://foobar.org:1" set ans [list] lappend ans [list set testsuite_modshare $tsmod_new] diff --git a/testsuite/modules.50-cmds/047-app-del-undo.exp b/testsuite/modules.50-cmds/047-app-del-undo.exp index 069d9f15b..fedb6ae95 100644 --- a/testsuite/modules.50-cmds/047-app-del-undo.exp +++ b/testsuite/modules.50-cmds/047-app-del-undo.exp @@ -32,7 +32,7 @@ set ts_2 "http://foobar.net" set ts_3 "http://foobar.com" set ts_new "$ts_1 $ts_2" # test colon char is correctly escaped in _modshare var -set tsmod_new "http\\\\://foobar.net:1:http\\\\://foobar.org:1" +set tsmod_new "http\\://foobar.net:1:http\\://foobar.org:1" set module "append/1.0" set modulefile "$modpath/$module" diff --git a/testsuite/modules.50-cmds/052-prepend-delim.exp b/testsuite/modules.50-cmds/052-prepend-delim.exp index 5d4378bf6..d06b67340 100644 --- a/testsuite/modules.50-cmds/052-prepend-delim.exp +++ b/testsuite/modules.50-cmds/052-prepend-delim.exp @@ -32,7 +32,7 @@ set ts_2 "http://foobar.net" set ts_3 "http://foobar.com" set ts_new "$ts_3 $ts_1 $ts_2" # test colon char is correctly escaped in _modshare var -set tsmod_new "http\\\\://foobar.com:1:http\\\\://foobar.net:1:http\\\\://foobar.org:1" +set tsmod_new "http\\://foobar.com:1:http\\://foobar.net:1:http\\://foobar.org:1" set env(testsuite) "$ts_1 $ts_2" set env(testsuite_modshare) "http\\://foobar.org:1:http\\://foobar.net:1" set module "prepend/1.0" @@ -113,7 +113,7 @@ testouterr_cmd "sh" "load $module" "ERR" $ts_err set module "prepend/1.8" set modulefile "$modpath/$module" set ts_new " http://foobar.io $ts_3 $ts_1 $ts_2" -set tsmod_new ":1:http\\\\://foobar.com:1:http\\\\://foobar.net:1:http\\\\://foobar.io:1:http\\\\://foobar.org:1" +set tsmod_new ":1:http\\://foobar.com:1:http\\://foobar.net:1:http\\://foobar.io:1:http\\://foobar.org:1" set env(testsuite) "$ts_1 $ts_2" set env(testsuite_modshare) "http\\://foobar.org:1:http\\://foobar.net:1" diff --git a/testsuite/modules.50-cmds/057-pre-del-undo.exp b/testsuite/modules.50-cmds/057-pre-del-undo.exp index ed4f0dae4..d75def86a 100644 --- a/testsuite/modules.50-cmds/057-pre-del-undo.exp +++ b/testsuite/modules.50-cmds/057-pre-del-undo.exp @@ -32,7 +32,7 @@ set ts_2 "http://foobar.net" set ts_3 "http://foobar.com" set ts_new "$ts_1 $ts_2" # test colon char is correctly escaped in _modshare var -set tsmod_new "http\\\\://foobar.net:1:http\\\\://foobar.org:1" +set tsmod_new "http\\://foobar.net:1:http\\://foobar.org:1" set module "prepend/1.0" set modulefile "$modpath/$module" diff --git a/testsuite/modules.50-cmds/062-remove-delim.exp b/testsuite/modules.50-cmds/062-remove-delim.exp index c5d320f7c..d81e41db6 100644 --- a/testsuite/modules.50-cmds/062-remove-delim.exp +++ b/testsuite/modules.50-cmds/062-remove-delim.exp @@ -32,7 +32,7 @@ set ts_2 "http://foobar.net" set ts_3 "http://foobar.com" set ts_new "$ts_1 $ts_2" # test colon char is correctly escaped in _modshare var -set tsmod_new "http\\\\://foobar.net:1:http\\\\://foobar.org:1" +set tsmod_new "http\\://foobar.net:1:http\\://foobar.org:1" set env(testsuite) "$ts_1 $ts_2 $ts_3" set env(testsuite_modshare) "http\\://foobar.org:1:http\\://foobar.net:1:http\\://foobar.com:1" set module "remove/1.0" diff --git a/testsuite/modules.50-cmds/075-alias.exp b/testsuite/modules.50-cmds/075-alias.exp index a8ed23022..6a1b0ca3e 100644 --- a/testsuite/modules.50-cmds/075-alias.exp +++ b/testsuite/modules.50-cmds/075-alias.exp @@ -29,7 +29,7 @@ set module "alias/2.0" set modulefile "$modpath/$module" -set alias "ps -auxww \| grep modulecmd" +set alias "ps -auxww | grep modulecmd" # # For the different shells ... diff --git a/testsuite/modules.50-cmds/076-alias-sub.exp b/testsuite/modules.50-cmds/076-alias-sub.exp index b9d08ec8b..9116927f6 100644 --- a/testsuite/modules.50-cmds/076-alias-sub.exp +++ b/testsuite/modules.50-cmds/076-alias-sub.exp @@ -15,7 +15,7 @@ # Sub-Command: # # Comment: %C{ -# Tests the 'set-alias' substition of $1 and $* +# Tests the 'set-alias' substition of $1 and $* and special chars # }C% # ############################################################################## @@ -28,15 +28,15 @@ set module "alias/1.0" set modulefile "$modpath/$module" -set alias_sh {ls \$1 \$2 \| grep \$\*} -set alias_csh {ls \\!\\!:1 \\!\\!:2 \| grep \\!\*} -set alias_cmd {ls $1 $2 | grep $*} +set alias {ls $1 $2 | grep $*} +set alias_csh {ls !!:1 !!:2 | grep !*} + # # For the different shells ... # -lappend ans [list alias testsuite $alias_sh] +lappend ans [list alias testsuite $alias] lappend ans [list setpath LOADEDMODULES $module] lappend ans [list setpath _LMFILES_ $modulefile] @@ -44,7 +44,7 @@ lappend ans2 [list alias testsuite $alias_csh] lappend ans2 [list setpath LOADEDMODULES $module] lappend ans2 [list setpath _LMFILES_ $modulefile] -lappend ans3 [list alias testsuite $alias_cmd] +lappend ans3 [list alias testsuite $alias] lappend ans3 [list setpath LOADEDMODULES $module] lappend ans3 [list setpath _LMFILES_ $modulefile] @@ -60,12 +60,51 @@ foreach sh $supported_shells { if {$sh eq "cmd"} { test_cmd "$sh" "load $module" $ans3 } elseif {[lsearch -exact $csh_shells $sh] >= 0} { - test_cmd_re "$sh" "load $module" $ans2 + test_cmd "$sh" "load $module" $ans2 } else { - test_cmd_re "$sh" "load $module" $ans + test_cmd "$sh" "load $module" $ans + } +} + + +# +# Test special characters handling +# + +set module "alias/3.0" +set modulefile "$modpath/$module" + +set ans [list] +lappend ans [list alias testsuite {echo $(grep "report \"Modules " modulecmd.tcl | tr -d \\ | awk '{print $3}')}] +lappend ans [list setpath LOADEDMODULES $module] +lappend ans [list setpath _LMFILES_ $modulefile] + +set ans2 [list] +lappend ans2 [list alias testsuite {echo `grep "report "'"'"Modules " modulecmd.tcl | tr -d \\ | awk '{print $3}'`}] +lappend ans2 [list setpath LOADEDMODULES $module] +lappend ans2 [list setpath _LMFILES_ $modulefile] + +set ans3 [list] +lappend ans3 [list alias testsuite {echo (grep "report \"Modules " modulecmd.tcl | tr -d \\ | awk '{print $3}')}] +lappend ans3 [list setpath LOADEDMODULES $module] +lappend ans3 [list setpath _LMFILES_ $modulefile] + + +foreach sh $supported_shells { + switch -- $sh { + {sh} - {bash} - {ksh} - {zsh} { + test_cmd $sh "load $module" $ans + } + {csh} - {tcsh} { + test_cmd $sh "load $module" $ans2 + } + {fish} { + test_cmd $sh "load $module" $ans3 + } } } + # # Cleanup # @@ -77,7 +116,6 @@ unset ans3 unset modulefile unset module -unset alias_sh +unset alias unset alias_csh -unset alias_cmd diff --git a/testsuite/modules.50-cmds/151-module-onlytop.exp b/testsuite/modules.50-cmds/151-module-onlytop.exp index 987492186..d1464c68a 100644 --- a/testsuite/modules.50-cmds/151-module-onlytop.exp +++ b/testsuite/modules.50-cmds/151-module-onlytop.exp @@ -37,6 +37,13 @@ set moderr "$moderr_msgs: module: Invalid command 'foo'\n In '$modulefilere'\n$ testouterr_cmd_re "sh" "load $module" "ERR" "$moderr" testouterr_cmd_re "sh" "display $module" "ERR" "$modlin\n$modulefilere:\n\n$moderr\n$modlin" +set module "modbad/empty" +set modulefilere "$modpathre/$module" +set moderr "$moderr_msgs: module: Command 'help' not supported\n In '$modulefilere'\n$err_contact" + +testouterr_cmd_re "sh" "load $module" "ERR" "$moderr" +testouterr_cmd_re "sh" "display $module" "ERR" "$modlin\n$modulefilere:\n\n$moderr\n$modlin" + # # Cleanup diff --git a/testsuite/modules.70-maint/120-autoinit.exp b/testsuite/modules.70-maint/120-autoinit.exp index 1604f22b7..a33e8f43a 100644 --- a/testsuite/modules.70-maint/120-autoinit.exp +++ b/testsuite/modules.70-maint/120-autoinit.exp @@ -33,8 +33,6 @@ foreach elt [file split [file join [pwd] $MODULECMD]] { set modulecmd_path [eval file join $path_list] set modulecmd_pathre [regsub -all "\(\[.+?\]\)" $modulecmd_path {\\\1}] set moduleshome $install_prefix -set modulepathre [regsub -all "\(\[$.+?\]\)" $install_modulepath {\\\1}] -set install_prefixre [regsub -all {([$.+?])} $install_prefix {\\\1}] # compare init config files to determine if we can guess expected setup set insmodspath [file readable $install_initdir/.modulespath] @@ -159,14 +157,14 @@ set func_sh "$func_name\\\(\\\) {\n$func_silentdbg\n$func_quar_sh\n$func_modcmd_ set func_bash "$func_name\\\(\\\) {\n$func_silentdbg\n$func_quar_sh\n$func_modcmd_bash\n\\s*_mlstatus=\\\$\\\?;\n$func_clean_ifs\n};$add_func_sh" set func_ksh "$func_name\\\(\\\) {\n$func_silentdbg\n$func_quar_sh\n$func_modcmd_ksh\n\\s*_mlstatus=\\\$\\\?;\n$func_clean_ifs\n};$add_func_sh" set func_zsh "$func_name\\\(\\\) {\n$func_silentdbg\n$func_quar_zsh\n$func_modcmd_zsh\n\\s*_mlstatus=\\\$\\\?;\n$func_clean_ifs\n};$add_func_sh" -set func_csh "if \\\( \\\$\\\?histchars && \\\$\\\?prompt \\\) alias module 'set _histchars = \\\$histchars; unset histchars; set _prompt=\"\\\$prompt\"; set prompt=\"\"; eval `$install_tclsh $modulecmd_pathre csh \\\\!\\*`; set _exit=\"\\\$status\"; set histchars = \\\$_histchars; unset _histchars; set prompt=\"\\\$_prompt\"; unset _prompt; test 0 = \\\$_exit' ; -if \\\( \\\$\\\?histchars && \\\! \\\$\\\?prompt \\\) alias module 'set _histchars = \\\$histchars; unset histchars; eval `$install_tclsh $modulecmd_pathre csh \\\\!\\*`; set _exit=\"\\\$status\"; set histchars = \\\$_histchars; unset _histchars; test 0 = \\\$_exit' ; -if \\\( \\\! \\\$\\\?histchars && \\\$\\\?prompt \\\) alias module 'set _prompt=\"\\\$prompt\"; set prompt=\"\"; eval `$install_tclsh $modulecmd_pathre csh \\\\!\\*`; set _exit=\"\\\$status\"; set prompt=\"\\\$_prompt\"; unset _prompt; test 0 = \\\$_exit' ; -if \\\( \\\! \\\$\\\?histchars && \\\! \\\$\\\?prompt \\\) alias module 'eval `$install_tclsh $modulecmd_pathre csh \\\\!\\*`;' ;" -set func_tcsh "if \\\( \\\$\\\?histchars && \\\$\\\?prompt \\\) alias module 'set _histchars = \\\$histchars; unset histchars; set _prompt=\"\\\$prompt\"; set prompt=\"\"; eval `$install_tclsh $modulecmd_pathre tcsh \\\\!\\*`; set _exit=\"\\\$status\"; set histchars = \\\$_histchars; unset _histchars; set prompt=\"\\\$_prompt\"; unset _prompt; test 0 = \\\$_exit' ; -if \\\( \\\$\\\?histchars && \\\! \\\$\\\?prompt \\\) alias module 'set _histchars = \\\$histchars; unset histchars; eval `$install_tclsh $modulecmd_pathre tcsh \\\\!\\*`; set _exit=\"\\\$status\"; set histchars = \\\$_histchars; unset _histchars; test 0 = \\\$_exit' ; -if \\\( \\\! \\\$\\\?histchars && \\\$\\\?prompt \\\) alias module 'set _prompt=\"\\\$prompt\"; set prompt=\"\"; eval `$install_tclsh $modulecmd_pathre tcsh \\\\!\\*`; set _exit=\"\\\$status\"; set prompt=\"\\\$_prompt\"; unset _prompt; test 0 = \\\$_exit' ; -if \\\( \\\! \\\$\\\?histchars && \\\! \\\$\\\?prompt \\\) alias module 'eval `$install_tclsh $modulecmd_pathre tcsh \\\\!\\*`;' ;" +set func_csh "if \\\( \\\$\\\?histchars && \\\$\\\?prompt \\\) alias module 'set _histchars = \\\$histchars; unset histchars; set _prompt=\"\\\$prompt\"; set prompt=\"\"; eval \"`$install_tclsh $modulecmd_pathre csh \\\\!\\*:q`\"; set _exit=\"\\\$status\"; set histchars = \\\$_histchars; unset _histchars; set prompt=\"\\\$_prompt\"; unset _prompt; test 0 = \\\$_exit' ; +if \\\( \\\$\\\?histchars && \\\! \\\$\\\?prompt \\\) alias module 'set _histchars = \\\$histchars; unset histchars; eval \"`$install_tclsh $modulecmd_pathre csh \\\\!\\*:q`\"; set _exit=\"\\\$status\"; set histchars = \\\$_histchars; unset _histchars; test 0 = \\\$_exit' ; +if \\\( \\\! \\\$\\\?histchars && \\\$\\\?prompt \\\) alias module 'set _prompt=\"\\\$prompt\"; set prompt=\"\"; eval \"`$install_tclsh $modulecmd_pathre csh \\\\!\\*:q`\"; set _exit=\"\\\$status\"; set prompt=\"\\\$_prompt\"; unset _prompt; test 0 = \\\$_exit' ; +if \\\( \\\! \\\$\\\?histchars && \\\! \\\$\\\?prompt \\\) alias module 'eval \"`$install_tclsh $modulecmd_pathre csh \\\\!\\*:q`\";' ;" +set func_tcsh "if \\\( \\\$\\\?histchars && \\\$\\\?prompt \\\) alias module 'set _histchars = \\\$histchars; unset histchars; set _prompt=\"\\\$prompt\"; set prompt=\"\"; eval \"`$install_tclsh $modulecmd_pathre tcsh \\\\!\\*:q`\"; set _exit=\"\\\$status\"; set histchars = \\\$_histchars; unset _histchars; set prompt=\"\\\$_prompt\"; unset _prompt; test 0 = \\\$_exit' ; +if \\\( \\\$\\\?histchars && \\\! \\\$\\\?prompt \\\) alias module 'set _histchars = \\\$histchars; unset histchars; eval \"`$install_tclsh $modulecmd_pathre tcsh \\\\!\\*:q`\"; set _exit=\"\\\$status\"; set histchars = \\\$_histchars; unset _histchars; test 0 = \\\$_exit' ; +if \\\( \\\! \\\$\\\?histchars && \\\$\\\?prompt \\\) alias module 'set _prompt=\"\\\$prompt\"; set prompt=\"\"; eval \"`$install_tclsh $modulecmd_pathre tcsh \\\\!\\*:q`\"; set _exit=\"\\\$status\"; set prompt=\"\\\$_prompt\"; unset _prompt; test 0 = \\\$_exit' ; +if \\\( \\\! \\\$\\\?histchars && \\\! \\\$\\\?prompt \\\) alias module 'eval \"`$install_tclsh $modulecmd_pathre tcsh \\\\!\\*:q`\";' ;" set func_fish "function $func_name \\s*set -l _mlre ''; set -l _mlv; set -l _mlrv; \\s*for _mlv in \\\(string split ' ' \\\$MODULES_RUN_QUARANTINE\\\) @@ -450,12 +448,7 @@ if {(!$insmodspath || $modspath_exinstalled) && (!$insmodrc || $modrc_exinstalle lappend ans [list set MODULEPATH_modshare "(.*)"] lappend ans [list set LOADEDMODULES ""] lappend ans [list set MODULESHOME $moduleshome] - # no re escaping for R (need re escaping to better cope with lang escaping) - if {$shell eq "r"} { - lappend ans [list set MODULEPATH "$modulepathre:$install_prefixre/test/modulefiles:$install_prefixre/test/etc" "noescval"] - } else { - lappend ans [list set MODULEPATH "$modulepathre:$install_prefix/test/modulefiles:$install_prefix/test/etc"] - } + lappend ans [list set MODULEPATH "$install_modulepath:$install_prefix/test/modulefiles:$install_prefix/test/etc"] if {$install_versioning eq "y"} { lappend ans [list set MODULE_VERSION "(.*)"] } @@ -466,21 +459,11 @@ if {(!$insmodspath || $modspath_exinstalled) && (!$insmodrc || $modrc_exinstalle lappend ans [list set MODULE_VERSION_STACK "(.*)"] } lappend ans [list set MODULES_CMD $modulecmd_path] - # no re escaping for R (need re escaping to better cope with lang escaping) - if {$shell eq "r"} { - lappend ans [list set MODULEPATH_modshare "$modulepathre:1" "noescval"] - } else { - lappend ans [list set MODULEPATH_modshare "$modulepathre:1"] - } + lappend ans [list set MODULEPATH_modshare "$install_modulepath:1"] lappend ans [list set _LMFILES_ "$install_modulefilesdir/null"] lappend ans [list set LOADEDMODULES "null"] lappend ans [list set MODULESHOME $moduleshome] - # no re escaping for R (need re escaping to better cope with lang escaping) - if {$shell eq "r"} { - lappend ans [list set MODULEPATH "$modulepathre" "noescval"] - } else { - lappend ans [list set MODULEPATH "$modulepathre"] - } + lappend ans [list set MODULEPATH "$install_modulepath"] if {$install_versioning eq "y"} { lappend ans [list set MODULE_VERSION "(.*)"] } @@ -509,8 +492,6 @@ unset path_list unset modulecmd_pathre unset modulecmd_path unset moduleshome -unset modulepathre -unset install_prefixre if {[info exists fid]} { unset fid diff --git a/testsuite/modules.70-maint/130-aliases.exp b/testsuite/modules.70-maint/130-aliases.exp index acfb5bc67..ded4b6784 100644 --- a/testsuite/modules.70-maint/130-aliases.exp +++ b/testsuite/modules.70-maint/130-aliases.exp @@ -81,6 +81,7 @@ loc_rc4/default -> loc_rc4/2.0 loc_rc6/default -> loc_rc6/1.2 loc_rc6/new -> loc_rc6/1.2 loc_rc8/foo -> loc_rc8/.2.0 +loc_rc010/default -> loc_rc010/.1.0 loc_rcv1/default -> loc_rcv1/1.2 loc_rcv1/new -> loc_rcv1/1.2 loc_tr/bar -> loc_tr/3.0 @@ -205,6 +206,7 @@ loc_rc4/default -> loc_rc4/2.0 loc_rc6/default -> loc_rc6/1.2 loc_rc6/new -> loc_rc6/1.2 loc_rc8/foo -> loc_rc8/.2.0 +loc_rc010/default -> loc_rc010/.1.0 loc_rcv1/default -> loc_rcv1/1.2 loc_rcv1/new -> loc_rcv1/1.2 loc_tr/bar -> loc_tr/3.0 diff --git a/testsuite/modules.70-maint/150-append-path.exp b/testsuite/modules.70-maint/150-append-path.exp index 33476cf19..119ffe929 100644 --- a/testsuite/modules.70-maint/150-append-path.exp +++ b/testsuite/modules.70-maint/150-append-path.exp @@ -110,7 +110,7 @@ set env(FOO) "http://foobar.org,http://foobar.net" set ans [list] lappend ans [list set FOO "http://foobar.org,http://foobar.net,http://foobar.com,http://foobar.io,"] -lappend ans [list set FOO_modshare ":1:http\\\\://foobar.com:1:http\\\\://foobar.net:1:http\\\\://foobar.io:1:http\\\\://foobar.org:1"] +lappend ans [list set FOO_modshare ":1:http\\://foobar.com:1:http\\://foobar.net:1:http\\://foobar.io:1:http\\://foobar.org:1"] testouterr_cmd_re "sh" "append-path -d , FOO http://foobar.com,http://foobar.io," $ans "" testouterr_cmd_re "sh" "append-path -d , FOO http://foobar.com http://foobar.io," $ans "" diff --git a/testsuite/modules.70-maint/151-prepend-path.exp b/testsuite/modules.70-maint/151-prepend-path.exp index fe795e3dc..cd7c64041 100644 --- a/testsuite/modules.70-maint/151-prepend-path.exp +++ b/testsuite/modules.70-maint/151-prepend-path.exp @@ -110,7 +110,7 @@ set env(FOO) "http://foobar.org,http://foobar.net" set ans [list] lappend ans [list set FOO ",http://foobar.com,http://foobar.io,http://foobar.org,http://foobar.net"] -lappend ans [list set FOO_modshare ":1:http\\\\://foobar.com:1:http\\\\://foobar.net:1:http\\\\://foobar.io:1:http\\\\://foobar.org:1"] +lappend ans [list set FOO_modshare ":1:http\\://foobar.com:1:http\\://foobar.net:1:http\\://foobar.io:1:http\\://foobar.org:1"] testouterr_cmd_re "sh" "prepend-path -d , FOO ,http://foobar.com,http://foobar.io" $ans "" testouterr_cmd_re "sh" "prepend-path -d , FOO ,http://foobar.com http://foobar.io" $ans "" diff --git a/testsuite/modules.70-maint/152-remove-path.exp b/testsuite/modules.70-maint/152-remove-path.exp index d58d61bb1..8f55a1daf 100644 --- a/testsuite/modules.70-maint/152-remove-path.exp +++ b/testsuite/modules.70-maint/152-remove-path.exp @@ -123,7 +123,7 @@ set env(FOO) ",http://foobar.com,http://foobar.io,http://foobar.org,http://fooba set ans [list] lappend ans [list set FOO "http://foobar.org,http://foobar.net"] -lappend ans [list set FOO_modshare "http\\\\://foobar.net:1:http\\\\://foobar.org:1"] +lappend ans [list set FOO_modshare "http\\://foobar.net:1:http\\://foobar.org:1"] testouterr_cmd_re "sh" "remove-path -d , FOO ,http://foobar.com,http://foobar.io" $ans "" testouterr_cmd_re "sh" "remove-path -d , FOO ,http://foobar.com http://foobar.io" $ans "" diff --git a/testsuite/modules.80-deep/010-init_ts.exp b/testsuite/modules.80-deep/010-init_ts.exp index 8ec992fb2..f4b1635c6 100644 --- a/testsuite/modules.80-deep/010-init_ts.exp +++ b/testsuite/modules.80-deep/010-init_ts.exp @@ -102,3 +102,15 @@ set ivirt7 "modvirt/dir0/sub1" set ovirt7 "modvirt/dir0/sub1/6.0" set ivirt8 "modvirt/dir0" set ovirt8 "modvirt/dir0/sub1/6.0" + +set cdalias "moddalias" +set idalias0 "moddalias" +set odalias0 "moddalias/dir1/1" +set idalias1 "moddalias/dir1" +set odalias1 "moddalias/dir1/1" + +set cbadvers "badmodvers" +set ibadvers0 "badmodvers" +set obadvers0 "badmodvers/foo" +set ibadvers1 "badmodvers/dir1" +set obadvers1 "badmodvers/dir1/2.0" diff --git a/testsuite/modules.80-deep/020-load.exp b/testsuite/modules.80-deep/020-load.exp index 3a6c91f80..c0d113a7d 100644 --- a/testsuite/modules.80-deep/020-load.exp +++ b/testsuite/modules.80-deep/020-load.exp @@ -188,6 +188,31 @@ lappend ans [list setpath LOADEDMODULES $ovirt8] lappend ans [list setpath _LMFILES_ "$pvirt"] test_cmd_re "csh" "load $ivirt8" $ans + +set ans [list] +lappend ans [list setpath LOADEDMODULES $odalias0] +lappend ans [list setpath _LMFILES_ "$p$odalias0"] +test_cmd_re "csh" "load $idalias0" $ans + +set ans [list] +lappend ans [list setpath LOADEDMODULES $odalias1] +lappend ans [list setpath _LMFILES_ "$p$odalias1"] +test_cmd_re "csh" "load $idalias1" $ans + + +set ans [list] +lappend ans [list setpath LOADEDMODULES $obadvers0] +lappend ans [list setpath _LMFILES_ "$p$obadvers0"] +lappend ans [list ERR] +testouterr_cmd_re "csh" "load $ibadvers0" $ans "$error_msgs: Invalid ModulesVersion 'dir1/2.0' defined" + +set ans [list] +lappend ans [list setpath LOADEDMODULES $obadvers1] +lappend ans [list setpath _LMFILES_ "$p$obadvers1"] +lappend ans [list ERR] +testouterr_cmd_re "csh" "load $ibadvers1" $ans "$error_msgs: Invalid ModulesVersion 'dir1/2.0' defined" + + unset p unset ans diff --git a/testsuite/modules.80-deep/021-unload.exp b/testsuite/modules.80-deep/021-unload.exp index 6187d72c4..08a94d95c 100644 --- a/testsuite/modules.80-deep/021-unload.exp +++ b/testsuite/modules.80-deep/021-unload.exp @@ -36,6 +36,10 @@ set module_7 "modvirt/3.0" set modulefile_7 "$modulefile_5" set module_8 "modvirt/dir0/sub1/4.0" set modulefile_8 "$modulefile_5" +set module_9 "moddalias/dir1/1" +set modulefile_9 "$modpath/$module_9" +set module_10 "badmodvers/dir1/2.0" +set modulefile_10 "$modpath/$module_10" # @@ -210,6 +214,32 @@ testouterr_cmd "sh" "unload modvirt/dir0" $ans "" testouterr_cmd "sh" "unload modvirt" $ans "" +# set up the environment +set env(_LMFILES_) "$modulefile_9" +set env(LOADEDMODULES) "$module_9" + +set ans [list] +lappend ans [list unsetpath LOADEDMODULES] +lappend ans [list unsetpath _LMFILES_] + +testouterr_cmd "sh" "unload $module_9" $ans "" +testouterr_cmd "sh" "unload moddalias/dir1" $ans "" +testouterr_cmd "sh" "unload moddalias" $ans "" + + +# set up the environment +set env(_LMFILES_) "$modulefile_10" +set env(LOADEDMODULES) "$module_10" + +set ans [list] +lappend ans [list unsetpath LOADEDMODULES] +lappend ans [list unsetpath _LMFILES_] + +testouterr_cmd "sh" "unload $module_10" $ans "" +testouterr_cmd "sh" "unload badmodvers/dir1" $ans "" +testouterr_cmd "sh" "unload badmodvers" $ans "" + + # # Cleanup # @@ -235,3 +265,7 @@ unset module_7 unset modulefile_7 unset module_8 unset modulefile_8 +unset module_9 +unset modulefile_9 +unset module_10 +unset modulefile_10 diff --git a/testsuite/modules.80-deep/030-display.exp b/testsuite/modules.80-deep/030-display.exp index 5caa8a54b..2fa153023 100644 --- a/testsuite/modules.80-deep/030-display.exp +++ b/testsuite/modules.80-deep/030-display.exp @@ -60,6 +60,13 @@ testouterr_cmd_re "csh" "display $ivirt6" "OK" "$modlin\n$pvirtre$mw$ovirt6$sv$o testouterr_cmd_re "csh" "display $ivirt7" "OK" "$modlin\n$pvirtre$mw$ovirt7$sv$ovirt7$nl" testouterr_cmd_re "csh" "display $ivirt8" "OK" "$modlin\n$pvirtre$mw$ovirt8$sv$ovirt8$nl" +testouterr_cmd_re "csh" "display $idalias0" "OK" "$modlin\n$p$odalias0$mw$odalias0$nl" +testouterr_cmd_re "csh" "display $idalias1" "OK" "$modlin\n$p$odalias1$mw$odalias1$nl" + +set err_badvers "$error_msgs: Invalid ModulesVersion 'dir1/2.0' defined" +testouterr_cmd_re "csh" "display $ibadvers0" "ERR" "$err_badvers\n$modlin\n$p$obadvers0$mw$obadvers0$nl" +testouterr_cmd_re "csh" "display $ibadvers1" "ERR" "$err_badvers\n$modlin\n$p$obadvers1$mw$obadvers1$nl" + unset p unset lmf @@ -74,3 +81,5 @@ unset cf unset sv unset svs unset mdl + +unset err_badvers diff --git a/testsuite/modules.80-deep/050-whatis.exp b/testsuite/modules.80-deep/050-whatis.exp index 2442752ea..0c4ac52df 100644 --- a/testsuite/modules.80-deep/050-whatis.exp +++ b/testsuite/modules.80-deep/050-whatis.exp @@ -29,4 +29,10 @@ testouterr_cmd_re "csh" "whatis $ivirt6" "OK" "$header\n\\s*$ovirt6: $ovirt6" testouterr_cmd_re "csh" "whatis $ivirt7" "OK" "$header\n\\s*$ovirt5: $ovirt5\\s*$ovirt6: $ovirt6\\s*$ovirt7: $ovirt7" testouterr_cmd_re "csh" "whatis $ivirt8" "OK" "$header\n\\s*$ovirt5: $ovirt5\\s*$ovirt6: $ovirt6\\s*$ovirt8: $ovirt8" +testouterr_cmd_re "csh" "whatis $idalias0" "OK" "$header\n $odalias0: $odalias0" +testouterr_cmd_re "csh" "whatis $idalias1" "OK" "$header\n $odalias1: $odalias1" + +testouterr_cmd_re "csh" "whatis $ibadvers0" "OK" "$header\n $obadvers1: $obadvers1\n $obadvers0: $obadvers0" +testouterr_cmd_re "csh" "whatis $ibadvers1" "OK" "$header\n $obadvers1: $obadvers1" + unset header diff --git a/testsuite/modules.80-deep/999-cleanup.exp b/testsuite/modules.80-deep/999-cleanup.exp index 286489cfc..40379103a 100644 --- a/testsuite/modules.80-deep/999-cleanup.exp +++ b/testsuite/modules.80-deep/999-cleanup.exp @@ -99,3 +99,15 @@ unset ivirt7 unset ovirt7 unset ivirt8 unset ovirt8 + +unset cdalias +unset idalias0 +unset odalias0 +unset idalias1 +unset odalias1 + +unset cbadvers +unset ibadvers0 +unset obadvers0 +unset ibadvers1 +unset obadvers1 diff --git a/testsuite/modules.90-avail/070-full.exp b/testsuite/modules.90-avail/070-full.exp index 1fbfec66e..ab8ffa809 100644 --- a/testsuite/modules.90-avail/070-full.exp +++ b/testsuite/modules.90-avail/070-full.exp @@ -43,89 +43,92 @@ set rrep [expr {$test_cols - $len - 2 - $lrep}] set ts_sh "[string repeat {-} $lrep] $modpath [string repeat {-} $rrep] alias/1.0 info/specified(foo) loc_sym/alias1 modbad/is-saved spread/7.0 alias/2.0 info/type loc_sym/alias2 modbad/is-used spread/8.0 -append/0.1 info/user loc_sym/alias3 modbad/path spreadrc/dir1/1.0 -append/0.2 info/userexp loc_sym/alias4 modbad/paths spreadrc/dir2/1.0 -append/0.3 inforc/1.0 loc_sym/alias5 modbad/prepend-path spreadrc/dir3/1.0 -append/0.4 inforc/2.0(avail:bar:default) loc_sym/alias6 modbad/remove-path spreadrc/dir4/1.0 -append/0.5 inforc/foo(@) loc_sym/alias7 module/2.0 spreadrc/dir5/1.0 -append/1.0 load/00 loc_sym/alias8 module/bad spreadrc/dir6/1.0 -append/1.1 load/10 loc_sym/alias9 module/empty spreadrc/dir7/1.0 -append/1.3 load/11 loc_sym/alias10 module/err spreadrc/dir8/1.0 -append/1.4 load/12 loc_sym/alias11 module/lbad symlink/0.9 -append/1.5 load/13 loc_sym/exec1 module/lerr symlink/1(@) -append/1.6 load/14 loc_sym/exec2 module/lunk symlink/1.2(default:new) -append/1.7 load/15 loc_sym/exec3 module/meta symlink/bar(@) -append/2.0 load/16 loc_sym/getvers1 module/relpath symlink2/1.0 -append/2.1 load/17 loc_sym/getvers2 module/unk symlink2/2.0 -append/2.2 load/18 loc_sym/getvers3 modvar/modfile system/1.0 -append/2.3 load/19 loc_sym/getvers4 modvar/submodfile system/2.0 -append/2.4 load/20 loc_sym/getvers5 prepend/0.1 test/1.0 -append/4.0 load/21 loc_sym/getvers6 prepend/0.2 test/1.2 -append/4.1 load/22 loc_sym/getvers7 prepend/0.3 test/2.0 -append/5.0 load/23 loc_sym/getvers8 prepend/0.4 tr2_loc(trreg) -append/6.0 load/24 loc_sym/getvers9 prepend/0.5 tr2_loc/al1(tr2unstable:@) -averssort/1(@) load/25 loc_sym/getvers10 prepend/1.0 tr2_loc/al2(tr2bar:@) -averssort/1.2.4(@) load/26 loc_sym/versinf1 prepend/1.1 tr2_loc/al3(default:tr2exp:trreg:@) -averssort/1.10(@) load/27 loc_sym/versinf2 prepend/1.3 tr2_loc/al4(@) -bad/after(good) load/28 loc_sym/versinf3 prepend/1.4 tr2_loc/al5(default:trreg:@) -bad/before load/29 loc_sym/versinf4 prepend/1.5 tr_loc/al1(tr2unstable:trunstable:@) -bad2/body load/30 loc_sym/versinf5 prepend/1.6 tr_loc/al2(default:tr2bar:tr2exp:trbar:trreg:@) -bad2/proc load/all(default) loc_sym/versinf6 prepend/1.7 tr_loc/al3(trexp:@) -break/1.0 loc_def/default loc_sym/versinf7 prepend/1.8 tr_loc/al4(@) -break/2.0 loc_def/truedef loc_sym/version1 prepend/1.9 tr_loc/al5(@) -break/3.0 loc_dv1/1.0 loc_sym/version2 prepend/2.0 trace/all_off -break/4.0 loc_dv1/2.0 loc_sym/version3 prepend/2.1 trace/all_on -break/5.0 loc_dv2/1.0(default) loc_sym/version4 prepend/2.2 uname/cache -break/6.0 loc_dv2/2.0 loc_sym/version5 prepend/2.3 uname/domain -chdir/1.0 loc_dv3/1.0 loc_sym/version6 prepend/2.4 uname/machine -chdir/2.0 loc_dv3/2.0 loc_sym/version7 prepend/3.0 uname/nodename -chdir/3.0 loc_dv4/1.0 loc_sym/version8 prepend/3.1 uname/release -chdir/4.0 loc_dv6/1.0 loc_sym/version9 prereq/full uname/sysname -coll/a loc_dv6/2.0/1.0 loc_sym/version10 prereq/fullpath uname/unk -coll/b loc_dv7/1.0 loc_sym/version11 prereq/module uname/version -coll/c loc_dv7/2.0(default) loc_sym/version12 prereq/orlist unsetenv/0.8 -coll/d loc_dv7/2.0/1.0 loc_sym/version13 prereq/relpath unsetenv/0.9 -conflict/full loc_dv7/3.0 loc_sym/version14 puts/1 unsetenv/1.0 -conflict/fullpath loc_dv8/1.0 loc_sym/version15 puts/2 use/1.0(default) -conflict/module loc_dv8/2.0 loc_sym/version16 puts/3 use/2.0 -conflict/relpath loc_dv9/1.0(default) loc_sym/version17 puts/4 use/2.1 -continue/1.0 loc_dv9/2.0 loc_sym/version18 puts/5 use/2.2 -continue/2.0 loc_dvv1/1.0(default) loc_sym/version19 puts/6 use/3.0 -continue/3.0 loc_dvv1/2.0 loc_sym/version20 puts/7 use/3.1 -continue/4.0 loc_fq/1.0 loc_sym/version21 puts/8 use/3.2 -continue/5.0 loc_rc1/1.0(foo) loc_sym/version22 recurs/modA use/4.0 -continue/6.0 loc_rc1/2.0 loc_sym/version23 recurs/modB use/4.1 -dirmodalias(@) loc_rc2/1.0(bar:blah:foo) loc_sym/version24 remove/0.3 user/adv -dirmodalias/1.0 loc_rc2/2.0 loc_sym/version25 remove/0.4 user/advanced -dirmodvirt loc_rc3/1.0(default) loc_sym/version26 remove/0.5 user/exp -dirmodvirt/1.0 loc_rc3/2.0(cur:stable) loc_tr(reg) remove/1.0 user/expert -empty/1.0 loc_rc3/3.0(chk:exp:new:test) loc_tr/1.0(cur:stable) remove/1.3 user/nov -eschars/1.0 loc_rc4/1.0 loc_tr/2.0(next:tr2unstable:trunstable:unstable) remove/1.4 user/novice -exit/1.0 loc_rc4/2.0(default) loc_tr/3.0(bar:default:exp:foo:reg:tr2bar:tr2exp:trbar:trexp:trreg) remove/1.5 user/undef -exit/2.0 loc_rc4/3.0 loc_tr/al1(unstable:@) remove/1.6 verbose/msg -exit/3.0 loc_rc5/1.0 loc_tr/al2(bar:default:exp:reg:trexp:@) remove/1.7 verbose/off -exit/4.0 loc_rc5/2.0 loc_tr/al3(default:exp:reg:@) remove/2.0 verbose/on -getenv/1.0 loc_rc6/0.9 loc_tr/al4(default:reg:@) remove/2.3 verbose/undef -help/2.0 loc_rc6/1(@) loc_virt1/1.0 remove/2.4 versions/1.1 -info/command loc_rc6/1.2(default:new) loc_virt1/2.0 remove/3.0 versions/1.2 -info/commandexp loc_rc6/bar(@) loc_virt1/3.0 remove/3.1 versions/1.3 -info/isavail loc_rc7/0.9 loc_virt1/4.0 remove/4.0 verssort/1 -info/isloaded loc_rc7/1(@) loc_virt2/1.0 remove/4.1 verssort/1.2.1 -info/issaved loc_rc7/1.2 loc_virt2/2.0 remove/4.2 verssort/1.2.4 -info/isused loc_rc7/bar(@) log/badfac setenv/0.8 verssort/1.8-2015-12-01 -info/loaded loc_rc8/0.9(@) log/err_both_1 setenv/1.0 verssort/1.8-2016-02-01 -info/mode1 loc_rc8/1.0 log/err_both_2 source/0.9 verssort/1.10 -info/mode2 loc_rcv1/1(@) log/err_file source/1.0 whatis/lines -info/mode3 loc_rcv1/1.1 log/err_syslog source/1.1 whatis/multiple -info/mode4 loc_rcv1/1.2(default:new) modbad/append-path source/1.2 whatis/none -info/mode5 loc_rcv1/2.0 modbad/autoinit spread/1.0 whatis/single -info/mode6 loc_rcv1/bar(@) modbad/foo spread/2.0 whatis/string -info/name loc_rcv2/1.2 modbad/help spread/3.0 x-resource/1 +alias/3.0 info/user loc_sym/alias3 modbad/path spreadrc/dir1/1.0 +append/0.1 info/userexp loc_sym/alias4 modbad/paths spreadrc/dir2/1.0 +append/0.2 inforc/1.0 loc_sym/alias5 modbad/prepend-path spreadrc/dir3/1.0 +append/0.3 inforc/2.0(avail:bar:default) loc_sym/alias6 modbad/remove-path spreadrc/dir4/1.0 +append/0.4 inforc/foo(@) loc_sym/alias7 module/2.0 spreadrc/dir5/1.0 +append/0.5 load/00 loc_sym/alias8 module/bad spreadrc/dir6/1.0 +append/1.0 load/10 loc_sym/alias9 module/empty spreadrc/dir7/1.0 +append/1.1 load/11 loc_sym/alias10 module/err spreadrc/dir8/1.0 +append/1.3 load/12 loc_sym/alias11 module/lbad symlink/0.9 +append/1.4 load/13 loc_sym/exec1 module/lerr symlink/1(@) +append/1.5 load/14 loc_sym/exec2 module/lunk symlink/1.2(default:new) +append/1.6 load/15 loc_sym/exec3 module/meta symlink/bar(@) +append/1.7 load/16 loc_sym/getvers1 module/relpath symlink2/1.0 +append/2.0 load/17 loc_sym/getvers2 module/unk symlink2/2.0 +append/2.1 load/18 loc_sym/getvers3 modvar/modfile system/1.0 +append/2.2 load/19 loc_sym/getvers4 modvar/submodfile system/2.0 +append/2.3 load/20 loc_sym/getvers5 prepend/0.1 test/1.0 +append/2.4 load/21 loc_sym/getvers6 prepend/0.2 test/1.2 +append/4.0 load/22 loc_sym/getvers7 prepend/0.3 test/2.0 +append/4.1 load/23 loc_sym/getvers8 prepend/0.4 tr2_loc(trreg) +append/5.0 load/24 loc_sym/getvers9 prepend/0.5 tr2_loc/al1(tr2unstable:@) +append/6.0 load/25 loc_sym/getvers10 prepend/1.0 tr2_loc/al2(tr2bar:@) +averssort/1(@) load/26 loc_sym/versinf1 prepend/1.1 tr2_loc/al3(default:tr2exp:trreg:@) +averssort/1.2.4(@) load/27 loc_sym/versinf2 prepend/1.3 tr2_loc/al4(@) +averssort/1.10(@) load/28 loc_sym/versinf3 prepend/1.4 tr2_loc/al5(default:trreg:@) +bad/after(good) load/29 loc_sym/versinf4 prepend/1.5 tr_loc/al1(tr2unstable:trunstable:@) +bad/before load/30 loc_sym/versinf5 prepend/1.6 tr_loc/al2(default:tr2bar:tr2exp:trbar:trreg:@) +bad2/body load/all(default) loc_sym/versinf6 prepend/1.7 tr_loc/al3(trexp:@) +bad2/proc loc_def/default loc_sym/versinf7 prepend/1.8 tr_loc/al4(@) +break/1.0 loc_def/truedef loc_sym/version1 prepend/1.9 tr_loc/al5(@) +break/2.0 loc_dv1/1.0 loc_sym/version2 prepend/2.0 trace/all_off +break/3.0 loc_dv1/2.0 loc_sym/version3 prepend/2.1 trace/all_on +break/4.0 loc_dv2/1.0(default) loc_sym/version4 prepend/2.2 uname/cache +break/5.0 loc_dv2/2.0 loc_sym/version5 prepend/2.3 uname/domain +break/6.0 loc_dv3/1.0 loc_sym/version6 prepend/2.4 uname/machine +chdir/1.0 loc_dv3/2.0 loc_sym/version7 prepend/3.0 uname/nodename +chdir/2.0 loc_dv4/1.0 loc_sym/version8 prepend/3.1 uname/release +chdir/3.0 loc_dv6/1.0 loc_sym/version9 prereq/full uname/sysname +chdir/4.0 loc_dv6/2.0/1.0 loc_sym/version10 prereq/fullpath uname/unk +coll/a loc_dv7/1.0 loc_sym/version11 prereq/module uname/version +coll/b loc_dv7/2.0(default) loc_sym/version12 prereq/orlist unsetenv/0.8 +coll/c loc_dv7/2.0/1.0 loc_sym/version13 prereq/relpath unsetenv/0.9 +coll/d loc_dv7/3.0 loc_sym/version14 puts/1 unsetenv/1.0 +conflict/full loc_dv8/1.0 loc_sym/version15 puts/2 use/1.0(default) +conflict/fullpath loc_dv8/2.0 loc_sym/version16 puts/3 use/2.0 +conflict/module loc_dv9/1.0(default) loc_sym/version17 puts/4 use/2.1 +conflict/relpath loc_dv9/2.0 loc_sym/version18 puts/5 use/2.2 +continue/1.0 loc_dvv1/1.0(default) loc_sym/version19 puts/6 use/3.0 +continue/2.0 loc_dvv1/2.0 loc_sym/version20 puts/7 use/3.1 +continue/3.0 loc_fq/1.0 loc_sym/version21 puts/8 use/3.2 +continue/4.0 loc_rc1/1.0(foo) loc_sym/version22 recurs/modA use/4.0 +continue/5.0 loc_rc1/2.0 loc_sym/version23 recurs/modB use/4.1 +continue/6.0 loc_rc2/1.0(bar:blah:foo) loc_sym/version24 remove/0.3 user/adv +dirmodalias(@) loc_rc2/2.0 loc_sym/version25 remove/0.4 user/advanced +dirmodalias/1.0 loc_rc3/1.0(default) loc_sym/version26 remove/0.5 user/exp +dirmodvirt loc_rc3/2.0(cur:stable) loc_tr(reg) remove/1.0 user/expert +dirmodvirt/1.0 loc_rc3/3.0(chk:exp:new:test) loc_tr/1.0(cur:stable) remove/1.3 user/nov +empty/1.0 loc_rc4/1.0 loc_tr/2.0(next:tr2unstable:trunstable:unstable) remove/1.4 user/novice +eschars/1.0 loc_rc4/2.0(default) loc_tr/3.0(bar:default:exp:foo:reg:tr2bar:tr2exp:trbar:trexp:trreg) remove/1.5 user/undef +exit/1.0 loc_rc4/3.0 loc_tr/al1(unstable:@) remove/1.6 verbose/msg +exit/2.0 loc_rc5/1.0 loc_tr/al2(bar:default:exp:reg:trexp:@) remove/1.7 verbose/off +exit/3.0 loc_rc5/2.0 loc_tr/al3(default:exp:reg:@) remove/2.0 verbose/on +exit/4.0 loc_rc6/0.9 loc_tr/al4(default:reg:@) remove/2.3 verbose/undef +getenv/1.0 loc_rc6/1(@) loc_virt1/1.0 remove/2.4 versions/1.1 +help/2.0 loc_rc6/1.2(default:new) loc_virt1/2.0 remove/3.0 versions/1.2 +info/command loc_rc6/bar(@) loc_virt1/3.0 remove/3.1 versions/1.3 +info/commandexp loc_rc7/0.9 loc_virt1/4.0 remove/4.0 verssort/1 +info/isavail loc_rc7/1(@) loc_virt2/1.0 remove/4.1 verssort/1.2.1 +info/isloaded loc_rc7/1.2 loc_virt2/2.0 remove/4.2 verssort/1.2.4 +info/issaved loc_rc7/bar(@) log/badfac setenv/0.6 verssort/1.8-2015-12-01 +info/isused loc_rc8/0.9(@) log/err_both_1 setenv/0.8 verssort/1.8-2016-02-01 +info/loaded loc_rc8/1.0 log/err_both_2 setenv/1.0 verssort/1.10 +info/mode1 loc_rc010/2.0 log/err_file source/0.9 whatis/lines +info/mode2 loc_rcv1/1(@) log/err_syslog source/1.0 whatis/multiple +info/mode3 loc_rcv1/1.1 modbad/append-path source/1.1 whatis/none +info/mode4 loc_rcv1/1.2(default:new) modbad/autoinit source/1.2 whatis/single +info/mode5 loc_rcv1/2.0 modbad/empty spread/1.0 whatis/string +info/mode6 loc_rcv1/bar(@) modbad/foo spread/2.0 x-resource/1 +info/name loc_rcv2/1.2 modbad/help spread/3.0 info/others loc_rcv2/1.5 modbad/info-loaded spread/4.0 info/shells loc_rcv2/2.0 modbad/is-avail spread/5.0 info/shellsexp loc_sym/1.0 modbad/is-loaded spread/6.0 " set ts_sh_small "- $modpath.deep - +badmodvers/dir1/2.0 +badmodvers/foo dir2/1.0(d1) dir2/3.0(d3) modalias/1.0(@) @@ -134,6 +137,8 @@ modalias/dir1/1.0 modalias/dir1/2.0(@) modalias/dir2/2.0 modalias/dir2/3.0(@) +moddalias(@) +moddalias/dir1/1 moddef/dir2/1.0(default) moddef/dir2/2.0 modload/dir2/1.0(md1) @@ -194,6 +199,8 @@ version/dir2/2.0/rc2 version/dir2/3.0 " set ts_sh_noflag "- $modpath.deep - +badmodvers/dir1/2.0 +badmodvers/foo dir2/1.0 dir2/3.0 modalias/1.0 @@ -202,6 +209,8 @@ modalias/dir1/1.0 modalias/dir1/2.0 modalias/dir2/2.0 modalias/dir2/3.0 +moddalias +moddalias/dir1/1 moddef/dir2/1.0 moddef/dir2/2.0 modload/dir2/1.0 @@ -265,20 +274,20 @@ set len [string length $modpath.deep] set lrep [expr {($test_cols_othos - $len - 2)/2}] set rrep [expr {$test_cols_othos - $len - 2 - $lrep}] set ts_sh_noflag_othos "[string repeat {-} $lrep] $modpath.deep [string repeat {-} $rrep] -dir2/1.0 modtr/3.0 modtr/dir5/subdir/mod5.0 modvirt/dir1/1.0 trmod/dir3 -dir2/3.0 modtr/al1 modulerc/dir1 modvirt/dir1/2.0 trmod/dir3/al2 -modalias/1.0 modtr/al4 modulerc/dir1/1.0 modvirt/dir2/2.0 version/dir1 -modalias/3.0 modtr/al5 modulerc/dir1/2.0 modvirt/dir2/3.0 version/dir1/1.0 -modalias/dir1/1.0 modtr/al6 modulerc/dir2/1.0 plain/dir1/1.0 version/dir1/2.0 -modalias/dir1/2.0 modtr/dir1/1.0 modulerc/dir2/1.0/rc1 plain/dir1/2.0 version/dir2/1.0 -modalias/dir2/2.0 modtr/dir2/2.0 modulerc/dir2/1.0/rc2 plain/dir2/1.0 version/dir2/2.0 -modalias/dir2/3.0 modtr/dir3/al2 modulerc/dir2/2.0 plain/dir2/2.0 version/dir2/2.0/rc1 -moddef/dir2/1.0 modtr/dir3/al3 modulerc/dir2/3.0 tr2mod/al1 version/dir2/2.0/rc2 -moddef/dir2/2.0 modtr/dir4 modvirt/1.0 tr2mod/al5 version/dir2/3.0 -modload/dir2/1.0 modtr/dir4/al7 modvirt/3.0 tr2mod/dir3/al2 -modload/dir2/3.0 modtr/dir4/al8 modvirt/dir0/sub1/4.0 trmod -modsym/dir1/1.0 modtr/dir4/mod4.0 modvirt/dir0/sub1/5.0 trmod/al1 -modsym/dir2/2.0 modtr/dir5/subdir modvirt/dir0/sub1/6.0 trmod/al5 " +badmodvers/dir1/2.0 modload/dir2/1.0 modtr/dir4/al7 modvirt/3.0 tr2mod/dir3/al2 +badmodvers/foo modload/dir2/3.0 modtr/dir4/al8 modvirt/dir0/sub1/4.0 trmod +dir2/1.0 modsym/dir1/1.0 modtr/dir4/mod4.0 modvirt/dir0/sub1/5.0 trmod/al1 +dir2/3.0 modsym/dir2/2.0 modtr/dir5/subdir modvirt/dir0/sub1/6.0 trmod/al5 +modalias/1.0 modtr/3.0 modtr/dir5/subdir/mod5.0 modvirt/dir1/1.0 trmod/dir3 +modalias/3.0 modtr/al1 modulerc/dir1 modvirt/dir1/2.0 trmod/dir3/al2 +modalias/dir1/1.0 modtr/al4 modulerc/dir1/1.0 modvirt/dir2/2.0 version/dir1 +modalias/dir1/2.0 modtr/al5 modulerc/dir1/2.0 modvirt/dir2/3.0 version/dir1/1.0 +modalias/dir2/2.0 modtr/al6 modulerc/dir2/1.0 plain/dir1/1.0 version/dir1/2.0 +modalias/dir2/3.0 modtr/dir1/1.0 modulerc/dir2/1.0/rc1 plain/dir1/2.0 version/dir2/1.0 +moddalias modtr/dir2/2.0 modulerc/dir2/1.0/rc2 plain/dir2/1.0 version/dir2/2.0 +moddalias/dir1/1 modtr/dir3/al2 modulerc/dir2/2.0 plain/dir2/2.0 version/dir2/2.0/rc1 +moddef/dir2/1.0 modtr/dir3/al3 modulerc/dir2/3.0 tr2mod/al1 version/dir2/2.0/rc2 +moddef/dir2/2.0 modtr/dir4 modvirt/1.0 tr2mod/al5 version/dir2/3.0 " # # test