Commit Graph

20 Commits

Author SHA1 Message Date
Xavier Delaruelle
63f5918d4c init: do not load modulerc config is env already set
If MODULEPATH or LOADEDMODULES is already set, do not source the
modulerc configuration file in init scripts.

As a consequence, if .modulespath sets a module path, then modulerc will
be ignored which clarifies how default configuration is loaded: if both
.modulespath and modulerc are defined, .modulespath takes precedence
over modulerc.

So if .modulespath sets a module path, all loaded modules defined in the
modulerc file will be ignored.
2017-03-06 06:09:15 +01:00
Xavier Delaruelle
99668416d8 Introduce an installation process
Introduce an 'install' target in makefiles to provide an installation
process for modules-tcl.

Defines installation paths with Makefile variables in order to avoid
having a ./configure step. Install paths are set during the 'make' step
by passing 'prefix', 'libexecdir', 'mandir', etc arguments to the make
command. If no path definitions are passed to the 'make' command,
installation will be made in '/usr/local/modules-tcl' by default.

Installation paths provided (or set from the default value found in
Makefile) are saved at the 'make' step in a .makeinstallpath file. Then
at the 'make install' step, this .makeinstallpath file is read and make
knows where to install modules-tcl.

These paths definitions are also used to translate *.in init script to
their installed version.

modulecmd.tcl script is by default set to be installed in the libexec
directory to follow FHS specification (as this script is an executable
but not directly accessed by users).
2017-03-06 05:32:37 +01:00
Xavier Delaruelle
3a1847d0a4 init: set MODULEPATH if not defined
Initialize MODULEPATH variable if not defined, with an empty string or
with the content of the init/.modulespath file if it exists and it is
readable. This file contains a list of module paths, one per line or
many per line separated by colon character.

This way of initializing MODULEPATH has been retrieved from C version
init scripts in order for sysadmins to keep a familiar concept to set
default MODULEPATH.
2017-03-06 05:32:01 +01:00
Xavier Delaruelle
1a4c236302 init: set empty LOADEDMODULES if not defined 2017-03-06 05:32:01 +01:00
Xavier Delaruelle
8f32d8485f init: do not source init/modulerc if not readable 2017-03-05 09:21:59 +01:00
Xavier Delaruelle
14575a3497 init: get and set TCLSH in init scripts
As for MODULESHOME, get 'tclsh' location from Makefile then replace
'@TCLSH@' pattern in shell init scripts with found location rather than
guessing it in the init scripts.

By doing so, same 'tclsh' location search is applied to all init
scripts. Search is performed with 'command' to look at a predefined list
of PATHs in order to be resilient to the current PATH content.
2017-03-05 09:21:59 +01:00
Xavier Delaruelle
fce5ac6733 init: normalize use and replacement of MODULESHOME
Simplify guess of MODULESHOME location by more relying on 'make'
capabilities than 'perl'.

Adapt init scripts for the different shells to use the MODULESHOME
variable that is replaced during the 'make' process rather than
${MODULESHOME}, $env(MODULESHOME), etc.

By the way, use a replacement pattern closer to what 'configure' is using
with '@MODULESHOME@' rather than '$MODULESHOME' which was confusing in
shell scripts.
2017-03-05 09:21:59 +01:00
Xavier Delaruelle
71149543a0 init: fix TCLSH typo in python script 2017-01-20 15:25:11 -06:00
Xavier Delaruelle
c64d18efcf Fix Python autoinit, error and x-resource rendering
Python code used to define the module command (autoinit action) was
broken (syntax errors) and not Python3-compatible. Error rendering is
also fixed here for Python3 compliance. Code used to process x-resource
is adapted to comply with Python recommendation [1] (subprocess.Popen
should be used instead of os.popen).

Python init script is also modified by this commit to use same code as
the one generated by autoinit action with call to subprocess.Popen
rather than os.popen.

[1] https://docs.python.org/2/library/os.html#os.popen
2016-08-13 05:21:15 -05:00
Kent Mein
62d0440524 Make things work with python3. 2016-03-25 09:58:45 -05:00
Kent Mein
bd4a515a7d Moved things out of the tcl directory.
Kent
2013-01-10 15:48:30 -06:00
rkowen
7aea93b75a Rolled in the cmake addition from version 3.2.8,
and the new perl.pm & python.py init files.
2010-10-04 22:06:44 +00:00
rkowen
90e2bf2f40 Merged in the final of the 3.2.7b changes to the init/ files. 2009-09-22 18:59:31 +00:00
rkowen
36115508f3 Changed the sed '\t' to a tab char so it would work on Solaris. 2009-09-22 16:25:04 +00:00
rkowen
c9936f9817 Rolled in the remaining 3.2.7 changes to the main branch. 2009-08-03 16:23:58 +00:00
rkowen
ec359b9ae7 Removed the acconfig.h file since it's essentially in the configure.ac now.
Reworked all the init,skel,add.* files to handle versioning or no.
Added Makefile.am to ./etc/ and ./ext/ for cleaner installs.
2002-06-14 06:15:21 +00:00
rminsk
63dca8d74c Was not setting the environment variable MODULESHOME 2001-03-22 18:59:38 +00:00
rminsk
b7142f0928 Removing blank lines 2001-01-16 23:25:22 +00:00
rminsk
54d98b3dcb Fixing typeo's 2001-01-16 23:24:09 +00:00
rminsk
4a8ab93ee7 Adding python init files. 2001-01-16 21:09:36 +00:00