Index: modules/.spec.in diff -c modules/.spec.in:1.1.1.1 modules/.spec.in:1.2 *** modules/.spec.in:1.1.1.1 Tue Jun 27 17:17:32 2000 --- modules/.spec.in Fri Aug 3 12:59:32 2001 *************** *** 7,26 **** Packager: Eric Roman (modified by R.K.Owen Group: Utilities/Shell Copyright: GPL ! Source: ftp://owen.sj.ca.us/pub/rkowen/modules/modules-@VERSION@.tar.gz ! Patch: modules-linux.patch %description The Modules package provides for the dynamic modification of a user's environment via modulefiles. Each modulefile contains the information needed to configure the shell for an application. Once the Modules ! package is initialized, the environment can be modified on a per-module ! basis using the module command which interprets modulefiles. Typically ! modulefiles instruct the module command to alter or set shell environment ! variables such as PATH, MANPATH, etc. modulefiles may be shared by many ! users on a system and users may have their own collection to supplement ! or replace the shared modulefiles. The modules environment is common ! on SGI/Crays and many workstation farms. # prep section. Tell RPM how to untar. --- 7,25 ---- Packager: Eric Roman (modified by R.K.Owen Group: Utilities/Shell Copyright: GPL ! Source: ftp://modules.sourceforge.net/pub/modules/modules-@VERSION@.tar.gz %description The Modules package provides for the dynamic modification of a user's environment via modulefiles. Each modulefile contains the information needed to configure the shell for an application. Once the Modules ! package is initialized, the environment can be modified dynamically ! on a per-module basis using the module command which interprets ! modulefiles. Typically modulefiles instruct the module command to alter or ! set shell environment variables such as PATH, MANPATH, etc. modulefiles ! may be shared by many users on a system and users may have their own ! collection to supplement or replace the shared modulefiles. The modules ! environment is common on SGI/Crays and many workstation farms. # prep section. Tell RPM how to untar. *************** *** 29,43 **** %patch # build section. Tell RPM how to run make %build ./configure \ ! --prefix=/usr/local/Modules/@VERSION@ \ --with-version-path=/usr/local/Modules/versions \ --with-module-path=/usr/local/Modules/modulefiles \ --with-etc-path=/etc \ --with-skel-path=/etc/skel \ --x-include=/usr/include/X11 \ ! --x-libraries=/usr/X11/lib --with-tcl-include=/usr/include \ --with-tcl-libraries=/usr/lib make --- 28,43 ---- %patch # build section. Tell RPM how to run make + %buildroot /usr/local/Modules/test %build ./configure \ ! --prefix=/usr \ --with-version-path=/usr/local/Modules/versions \ --with-module-path=/usr/local/Modules/modulefiles \ --with-etc-path=/etc \ --with-skel-path=/etc/skel \ --x-include=/usr/include/X11 \ ! --x-libraries=/usr/X11R6/lib --with-tcl-include=/usr/include \ --with-tcl-libraries=/usr/lib make *************** *** 50,71 **** %files # Tell RPM where to find the files that just spewed all over the disk... ! /usr/local/Modules/@VERSION@/bin/modulecmd ! /usr/local/Modules/@VERSION@/init/bash ! /usr/local/Modules/@VERSION@/init/csh ! /usr/local/Modules/@VERSION@/init/perl ! /usr/local/Modules/@VERSION@/init/sh ! /usr/local/Modules/@VERSION@/init/tcsh ! /usr/local/Modules/@VERSION@/init/zsh ! /usr/local/Modules/@VERSION@/init/ksh ! /usr/local/Modules/@VERSION@/init/.modulespath ! /usr/local/Modules/@VERSION@/man/man1/module.1 ! /usr/local/Modules/@VERSION@/man/man4/modulefile.4 ! /usr/local/Modules/@VERSION@/bin/add.modules ! /usr/local/Modules/@VERSION@/bin/mkroot ! /usr/local/Modules/@VERSION@/modulefiles/modules ! /usr/local/Modules/@VERSION@/modulefiles/module-info ! /usr/local/Modules/@VERSION@/modulefiles/null ! /usr/local/Modules/@VERSION@/modulefiles/use.own ! /usr/local/Modules/@VERSION@/modulefiles/dot ! /usr/local/Modules/versions/@VERSION@ --- 50,69 ---- %files # Tell RPM where to find the files that just spewed all over the disk... ! /usr/bin/modulecmd ! /etc/Modules/init/bash ! /etc/Modules/init/csh ! /etc/Modules/init/perl ! /etc/Modules/init/sh ! /etc/Modules/init/tcsh ! /etc/Modules/init/zsh ! /etc/Modules/init/ksh ! /etc/Modules/init/.modulespath ! /usr/man/man1/module.1 ! /usr/man/man4/modulefile.4 ! /etc/Modules/modulefiles/modules ! /etc/Modules/modulefiles/module-info ! /etc/Modules/modulefiles/module-cvs ! /etc/Modules/modulefiles/null ! /etc/Modules/modulefiles/use.own ! /etc/Modules/modulefiles/dot Index: modules/ChangeLog diff -c modules/ChangeLog:1.8 modules/ChangeLog:1.10 *** modules/ChangeLog:1.8 Wed Jul 11 14:56:35 2001 --- modules/ChangeLog Fri Aug 3 12:59:32 2001 *************** *** 6,11 **** --- 6,22 ---- or spelling correction your name will probably not be listed.) **************************** Release 3.1 ****************************** + Modules 3.1.4 + Fri Aug 3 12:45:55 PDT 2001 R.K. Owen (rk@owen.sj.ca.us) + * Some preliminary steps to a rpm file. + * Added bz2 files to distribution mix. + * Fixed "module swap" to put the substituted module in the + same path location as the old. Also added a number of tests + for this feature. + (Bug was pointed out by Leo Butler ) + * Added tests for the "is-loaded" modulefile command introduced + back in 3.0.8-rko. + * Fixed up some documents. Modules 3.1.3 Wed Jul 11 14:30:53 PDT 2001 R.K. Owen (rk@owen.sj.ca.us) * Added module-cvs modulefile for easy CVS/ftp access to the Index: modules/INSTALL.RH7x diff -c modules/INSTALL.RH7x:1.1 modules/INSTALL.RH7x:1.2 *** modules/INSTALL.RH7x:1.1 Mon Jul 9 11:21:36 2001 --- modules/INSTALL.RH7x Mon Jul 16 12:04:10 2001 *************** *** 8,14 **** R.K. Owen, Ph.D. KooZ Software ! rk@owen.sj.ca.us 1. Introduction _______________ --- 8,14 ---- R.K. Owen, Ph.D. KooZ Software ! rk@owen.sj.ca.us 1. Introduction _______________ *************** *** 120,126 **** be explained below. _________________________________________________________________________ ! f [ -x /etc/custom/bashrc ]; then . /etc/custom/bashrc fi _________________________________________________________________________ --- 120,126 ---- be explained below. _________________________________________________________________________ ! if [ -x /etc/custom/bashrc ]; then . /etc/custom/bashrc fi _________________________________________________________________________ *************** *** 170,176 **** It's intended for the user's alias customizations. If $ENV is not defined, then nothing is sourced! ! 3.0 Skeleton Files __________________ RedHat is fairly light on the skeleton dot files. Of those --- 170,176 ---- It's intended for the user's alias customizations. If $ENV is not defined, then nothing is sourced! ! 3. Skeleton Files __________________ RedHat is fairly light on the skeleton dot files. Of those *************** *** 180,186 **** is to source the system /etc/bashrc to overcome this deficiency inherent to sh/bash/ksh. ! 4.0 Custom System Files _______________________ If you have followed the above recommendations, then you are now --- 180,186 ---- is to source the system /etc/bashrc to overcome this deficiency inherent to sh/bash/ksh. ! 4. Custom System Files _______________________ If you have followed the above recommendations, then you are now *************** *** 190,533 **** would be set to /usr/local/Modules/src/modules-3.x.y if that is where you have unpacked the module sources. ! ! ! Should have Tcl 8.x. Earlier versions may work, but not supported. ! Recent sources can be found ! at http://dev.scriptics.com/ . Build Tcl using a directory ! structure anticipating a modules environment, such as: ! configure --prefix=/usr/local/pkg/tcltk/8.x.y/ ! ! For later use, define the environment variable TCLTKROOT to ! /usr/local/pkg/tcltk/8.x.y/ in this case. ! ! Decide where you will place your local module files and the root ! for the module package. It should be a file system separate from ! your system root, else it may get wiped out with every OS upgrade. ! For this document, the root /usr/local/Modules/ will be used. ! The local module files will be placed in /usr/local/Modules/modulefiles/. ! This will remain constant regardless what module version is used. ! Put the module version files in /usr/local/Modules/versions/. This ! directory is only visible if the "modules" modulefile is loaded, ! and is only intended for switching between differing module command ! versions. ! ! The root for the a particular version of modules will have an ! indicative name, such as /usr/local/Modules/@VERSION@/, where ! @VERSION@ will get substituted with something like 3.0.8-rko . ! Once the installation is done, put a symbolic link in the ! /usr/local/Modules directory named default pointing to the version ! (e.g. "cd /usr/local/Modules; ln -s @VERSION@ default", where you ! have substituted the actual version for @VERSION@). ! ! 2.2 Building and Installing Modules ! ___________________________________ ! ! First - I recommend placing the sources into /usr/local/Modules/src/ ! either from the tar file or CVS. ! ! Second - modify the RKOConfigure file, which looks something like this, ! to the actual paths used: ! ! #!/bin/sh ! CFLAGS=-g ! LDFLAGS=-g ! CC=gcc ! export CFLAGS LDFLAGS CC ! TCLTKROOT=/usr/local/tcltk/8.2.3 ! export TCLTKROOT ! ! ./configure \ ! --prefix=/usr/local/Modules/@VERSION@ \ ! --with-module-path=/usr/local/Modules/modulefiles \ ! --with-version-path=/usr/local/Modules/versions \ ! --with-etc-path=/etc \ ! --with-skel-path=/etc/skel \ ! --with-split-size=960 \ ! --x-includes=/usr/include/X11 \ ! --x-libraries=/usr/X11/lib \ ! --with-tcl-include=$TCLTKROOT/include \ ! --with-tcl-libraries=$TCLTKROOT/lib ! exit ! ! Then run ./RKOConfigure to configure the sources for your machine. ! Run "./configure --help" to view some of the other options. ! ! After the sources are configured then: ! make ! make check # only if you have dejagnu available ! make install ! ! Each successive step depends on successfully completing the previous steps. ! However, don't expect everything to work once it's installed, ! because the system rc files and the user rc `dot' files need to be ! modified to use modules. ! ! Make sure you have a "default" symbolic link in /usr/local/Modules ! to point to some version, since the system rc files will refer to ! it. ! ! 2.3 Setting Up the Shell RC Files ! _________________________________ ! ! Here's a quick tutorial on Shell rc (run-command) files. ! When a user logs in and if they have /bin/csh(/bin/sh) as their shell, ! the first rc fire to be parsed by the shell is /etc/csh.login & ! /etc/csh.cshrc (/etc/profile) (the order is implementation dependent), ! and then the user's $HOME/.cshrc ($HOME/.kshenv) and finally ! $HOME/.login ($HOME/.profile). All the other login shells are based on ! /bin/csh and /bin/sh with additional features and rc files. ! ! Certain environment variables and aliases (functions) need to be set for ! Modules to work correctly. This is handled by the Module init files ! in /usr/local/Modules/default/init, which contains separate init files ! for each of the various supported shells, where default is a symbolic ! link to a module command version. ! ! 2.3.1 Global Shell RC Files ! ___________________________ ! ! Since Modules sets & appends to several environment variables it's a good ! idea to set them up with the default system values, else the compilers, ! loaders, man pages, etc. may not find the default system paths if not ! listed in the appropriate environment variables. ! ! Look in ./etc/global for example rc files (csh.login, profile) that ! defines most of the variables you'll likely need. ! (These files are not yet tailored to each different platform. The ! current ones are targeted at GNU/Linux systems.) ! None of the environment variables are needed directly for a correct ! Modules environment. ! ! The Modules specific commands are located in ./etc/global and are named ! ``csh.modules'' and ``profile.modules''. These files should be copied ! to /etc [or where ever you specified with the --with-etc-path= ! option to the configure script]. ! These files will be source'd from the users' .login and .profile . Edit ! these files if you want certain modules to be automatically loaded by ! every user. Currently, it loads only ``null'' which does absolutely ! nothing. ! ! 2.3.2 Skeleton Shell RC (``Dot'') Files ! _______________________________________ ! ! You have these, I presume? If you don't now is the time to set them up. ! The skeleton files provide a ``default'' environment when new users are ! added to your system. The files are usually placed in /etc/skel [or ! where ever you specified with the --with-skel-path= option to the ! configure script], and contains a minimal set of ``dot'' files and ! directories that every new user should start with. The skeleton files ! are copied to the new user's $HOME directory with the ``-m'' option to ! the ``useradd'' command. A set of example ``dot'' files are located in ! ./etc/skel . Copy everything but the .*.in and CVS files and ! directories to the skeleton directory. Edit and tailor for your own ! system. ! ! If you have a pre-existing set of skeleton files, then make sure ! the following minimum set exists: .cshrc, .login, .kshenv, .profile . ! They can be automatically updated with: ! env HOME=/etc/skel /usr/local/Modules/default/bin/add.modules ! and hit return. Inspect the new ``dot'' files and if OK, then ! remove all the .*.old (original) files. ! ! An alternative way of setting-up the users' dot files can be found ! in ./ext. This model can be used with the --with-dot-ext configure ! option. ! ! 2.3.3 User Shell RC (``Dot'') Files ! ___________________________________ ! ! The final step for a functioning Modules environment is to modify the ! user ``dot'' files to source the right files. ! One way to do this is to put a message in the /etc/motd telling each ! user to run the command: ! /usr/local/Modules/default/bin/add.modules ! which is a sophisticated script that parses their existing ``dot'' ! files pre-pending the appropriate commands to initialize the Modules ! environment. The user can re-run this script and it will find ! and remember what modules they have initially loaded, strip out ! the previous module initialization and restore it with an upgraded ! one. If the user lacks a necessary ``dot'' file, the script will ! copy one over from the skeleton directory. The user will have ! to logout and login for it to come into effect. ! ! Another way is for the system administrator to "su - username" to ! each user and run it interactively. The process can be semi-automated ! with a single line command that obviates the need for direct interaction: ! ! su - username -c "yes | /usr/local/Modules/default/bin/add.modules" ! ! Power users can create a script to directly parse the /etc/passwd file ! to perform this command. For the rest of us, just copy the passwd file ! and edit it appropriately to execute this command for each valid user. ! ! 2.4 Module Files ! ________________ ! ! Once the above steps have been performed, then it's important to ! have module files in each of the modulefile directories. The ! install will place the following module files (for example): ! ------------------- /usr/local/Modules/3.0.9-rko/modulefiles ------------------- ! dot module-info modules null use.own ! ! If you don't have your own module files in /usr/local/Modules/modulefiles ! then copy ``null'' to that directory. On some systems an empty ! modulefile directory will cause a core dump, on other systems no problem. ! ! Use /usr/local/Modules/default/modulefiles/modules as a template for ! creating your own module files. For more information do ! module load modules ! and then you have ready access to the module(1) modulefile(4) man ! pages, as well as the versions directory. Study the man pages carefully. ! The version directory may look something like this: ! ------------------------- /usr/local/Modules/versions --------------------------3.0.5-rko 3.0.6-rko 3.0.7-rko 3.0.8-rko 3.0.9-rko ! ! ! The model you should use for modulefiles is ``name/version''. For ! example my /usr/local/Modules/modulefiles directory has a directory ! named ``netscape'' which contains the following module files: 301, 405c, ! 451c, etc. When it's displayed with ``module avail'' it looks something ! like this: ! ! netscape/301 ! netscape/405c ! netscape/451c(default) ! netscape/45c ! netscape/46 ! ! The default is established with .version file in the netscape directory ! and it looks something like this: ! ! #%Module1.0########################################################### ! ## ! ## version file for Netscape ! ## ! set ModulesVersion "451c" ! ! If the user does ``module load netscape'', then the default ! netscape/451c will be used. The default can be instantly changed by ! editing the .version file to point to a different module file in that ! directory. If no .version file exists then Modules will just assume the ! last module in the alphabetical ordered directory listing as the ! default. ! ! 3. Package Location Suggestions ! _______________________________ ! ! To make Modules a useful tool in your environment, it's a good idea to ! use some discipline and may require some work in placing binaries and man ! pages in suitable locations. It's a way to stop using /usr/local/bin as ! a catch-all dump for every miscellaneous binary, especially the ones ! that don't get used too often. There are some scripts to help this along. ! For this discussion I will use the mythical ``foobar'' package. I've ! down-loaded the sources in a form of a gzip'd tar file - ! foobar-1.2.3.tar.gz . ! ! Most sources can be placed anywhere, and in most cases will configure ! and build without any problems. For this example I will do everything ! from /tmp. I unload the sources with ``tar -xzf foobar-1.2.3.tar.gz'' ! which creates a directory in the current working directory (/tmp) named ! ./foobar-1.2.3 . Cd to this directory and run the configure script ! ./configure --prefix=/usr/local/pkg/foobar/1.2.3 ! and it should configure the sources to place all necessary files to ! that location. Continue the build, typically with: ! make ! make check ! make install ! ! The binaries, libraries, man pages, and info pages are now placed ! in /usr/local/pkg/foobar/1.2.3 . If you need to create the ``root'' ! yourself, then load the ``modules'' module with ``module load modules''. ! Use the ``mkroot -m'' script to create a collection of ./bin, ./etc, ! ./lib, ./man/ directories. Install the items as needed, then use ! ``mkroot -c'' to clean out the empty directories. ! ! Finally, after installing the binaries, etc. then create a module file ! using another module file as a template and place it somewhere in the ! modulefile hierarchy. Also be sure to keep your original sources ! somewhere. If you had no problems just copy the original gzip'd tar file ! to, say, /usr/src. ! ! If your module file is new and somewhat involved, then it's a good idea ! to do "module load use.own" to create your own private modules directory ! off your $HOME directory. It's a good place to test module files, or to ! keep your own private collection of module files. ! ! The following is an example of the module configuration for ! rk@owen.sj.ca.us "module avail" ! ! ------------------------- /usr/local/Modules/versions -------------------------- ! 3.0.5-rko 3.0.6-rko 3.0.7-rko 3.0.8-rko 3.0.9-rko ! ! ------------------- /usr/local/Modules/3.0.8-rko/modulefiles ------------------- ! dot module-info modules null use.own ! ! ------------------------ /usr/local/Modules/modulefiles ------------------------ ! F/970328 gif2png/2.0.1(default) perl5/005static ! RKO gnuplot/3.7 pgp/pgp-5.0 ! X/bohr http postgres/6.5.1 ! X/console java/1.1.6v5(default) postgres/7.0(default) ! X/dark java/1.2.2RC4 python/1.5.2c ! X/dirac jpeg/6b samba/1.9.18p2 ! X/light l2h sfw ! X/owen lesstif slatec/4.1 ! X/xfig libpng/1.0.5 sniff ! acrobat/3.0.2 linklint/2.1 staroffice/5.1 ! acrobat/4.0 netcdf tcltk/8.0.5(default) ! apache/1.3.12(default) netscape/6.0.0pr1 tcltk/8.2.3 ! apache/1.3.9 new tex/te ! applix/4.4.2(default) nntp texinfo/3.12 ! applix/shelf/2.0 ntp/3-5.92 vastf90/3.4N5 ! aux ntp/3-5.93e vmware/2.0 ! cxref/1.4b openssl/0.9.5 workman ! cxref/1.5b oracle/8i xgks ! dejagnu/1.3 pbm/1mar94p1 xpdf/0.90 ! gcc/2.95.2 perl5/004 ! gettext/0.10.35 perl5/005(default) ! ! -------------------------- /u/owen/rk/privatemodules --------------------------- ! dump htm4.old m4html yyy/xxx/test/2.0 ! htm4 librko umask ! htm4.new librko.xxx yyy/xxx/test/1.0 ! ! The module list I use for compiling modules (plus some additional things) ! from "module list" ! ! Currently Loaded Modulefiles: ! 1) applix/4.4.2 3) gcc/2.95.2 5) tcltk/8.2.3 ! 2) null 4) dejagnu/1.3 6) use.own ! ! ! 4. Upgrading Module Commands ! ____________________________ ! ! The theory is that Modules should use a similar package/version locality ! as the package environments it helps define. Switching between versions ! of the module command should be as easy as switching between different ! packages via the module command. ! ! Suppose there is a change from 3.0.5-rko to version 3.0.6-rko. The goal ! is to semi-automate the changes to the user ``dot'' files, such that ! the the user can be oblivious to the change. ! ! The first step is to install the new module command & files to ! /usr/local/Modules/3.0.6-rko/. ! Test it out by loading with "module load modules 3.0.6-rko". ! You may get an error like: ! 3.0.6-rko(25):ERROR:152: Module 'modules' is currently not loaded ! This is OK and will likely go away with future versions. ! ! Make sure you have the new version with "module --version". ! If it seems stable enough for yourself, then advertise it to ! your adventureous users. ! ! Once you are satisfied that it appears to work adequately well, then ! go into /usr/local/Modules remove the old "default" symbolic link ! to the new versions. For example: ! cd /usr/local/Modules ! rm default; ln -s 3.0.6-rko default ! ! This new version is now the default, and will be referenced by ! all the users that log in and those that haven't loaded a specific ! module command version. --- 190,285 ---- would be set to /usr/local/Modules/src/modules-3.x.y if that is where you have unpacked the module sources. ! The system files provided in the modules sources references a `default' ! directory. If you follow the template provided by the RKOConfigure script ! and are doing a configure with ! ./configure --prefix=/usr/local/Modules/@VERSION@ ... ! then the different module versions are placed in /usr/local/Modules. ! In this directory, the stable module version directory should be ! set as a symbolic link named `default'. New versions of the modules ! package can be added, tried and tested before making it the operable ! version for the general users. ! ! (This is described in further detail in sect 2.1 of the INSTALL document.) ! ! 4.1 System Environment Variables ! ________________________________ ! ! There are many environment variables that are used by the various tools ! found on a Unix system. For example: `man' looks at $MANPATH to search ! for man directories. The system shell files should define these environment ! variables so that the modulefiles can append onto them. It's not a ! requirement, but it does make things explicitly clear. ! ! MANPATH UNIX man documentation search path ! PATH executable search path ! XAPPLRESDIR X11 resource location search path ! ! The following environment variables are typically found on Unix systems ! with dynamically loaded libraries and GNU compilers and tools ! ! CPLUS_INCLUDE_PATH g++ include directory search path ! C_INCLUDE_PATH gcc include directory search path ! INFOPATH GNU info documentation search path ! LD_LIBRARY_PATH run-time dynamically loaded libraries search path ! LD_RUN_PATH ELF object settable run-time dynamically loaded ! library directory search path ! LIBRARY_PATH generic ld library directory search path ! ! These environment variables are specific to GNOME and application ! development. ! ! GNOME_LIBCONFIG_PATH GNOME library definition script search path ! GNOME_PATH GNOME application and library package search path ! ! ! 4.2 C-shell System Files ! ________________________ ! ! The C-shell /etc/custom files that were referenced in section 2.1 ! are located in $MODULES_SRC/etc/global. The files of ! interest are: ! ! csh.cshrc Per-process run-command script. ! Defines `module' alias, and alias `sh' to `bash'. ! ! csh.login Per-session run-command script. ! Sets the environment variables mentioned in sect 4.2. ! Sources the csh.modules script and sets $ENV ! to $HOME/.bashrc (see sects 2.2 & 2.3). ! ! csh.modules Sources the appropriate C-shell (or derivative) ! modules init script in the `default' modules ! directory (see sect 4.0). ! ! ! 4.3 Bourne Shell Derivative System Files ! ________________________________________ ! ! The bash & ksh /etc/custom files that were alluded to in sections 2.2 & 2.3 ! are located in $MODULES_SRC/etc/global. As mentioned in sect 2.2 we do ! not use a strict Bourne shell, because of its limitations; therefore, ! only the derivative shells will and should be used. ! The files of interest are: ! ! bashrc Per-process run-command script. ! Defines a module shell function, and defines a ! shell function for `sh' to reference `bash' instead. ! ! profile Per-session run-command script. ! Sets the environment variables mentioned in sect 4.2. ! Sources the profile.modules script and sets $ENV ! to $HOME/.bashrc (see sects 2.2 & 2.3). ! ! profile.modules Sources the appropriate Bourne shell (or derivative) ! modules init script in the `default' modules ! directory (see sect 4.0). ! ! ! 5. Disclaimer ! _____________ ! ! The files provided by the modules package are only templates. ! You will probably need to modify these files for your own system ! and requirements. Index: modules/Makefile.in diff -c modules/Makefile.in:1.10 modules/Makefile.in:1.12 *** modules/Makefile.in:1.10 Sat Jun 9 22:35:53 2001 --- modules/Makefile.in Fri Aug 3 13:18:00 2001 *************** *** 1,7 **** ########################################################################### # # File: Makefile.in ! # Revision: $Id: Makefile.in,v 1.10 2001/06/10 05:35:53 rkowen Exp $ # Created: 94/06/18 # Author: Leif Hedstrom # --- 1,7 ---- ########################################################################### # # File: Makefile.in ! # Revision: $Id: Makefile.in,v 1.12 2001/08/03 20:18:00 rkowen Exp $ # Created: 94/06/18 # Author: Leif Hedstrom # *************** *** 25,30 **** --- 25,32 ---- SED = sed TAR = tar GZIP = gzip + BZIP2 = bzip2 + CVS = cvs FIND = find XARGS = xargs RM = rm *************** *** 153,161 **** @echo "You may need to run this twice!" @echo "===============================" ! dist: $(srcdir)/configure @echo "checking out ${DISTNAME} into directory modules" ! cvs -f checkout -r \ `${SED} -n -e 's/^.*NEW TAG.*"\(.*\)".*$$/\1/p' ${srcdir}/version.c` \ modules @echo "renaming directory to ${DISTNAME}" --- 155,169 ---- @echo "You may need to run this twice!" @echo "===============================" ! dist: distgz distbz2 ! ! distgz : ${DISTNAME}.tar.gz ! ! distbz2 : ${DISTNAME}.tar.bz2 ! ! ${DISTNAME}.tar.gz : $(srcdir)/configure @echo "checking out ${DISTNAME} into directory modules" ! ${CVS} -f checkout -r \ `${SED} -n -e 's/^.*NEW TAG.*"\(.*\)".*$$/\1/p' ${srcdir}/version.c` \ modules @echo "renaming directory to ${DISTNAME}" *************** *** 169,186 **** @echo "removing directory ${DISTNAME}" ${RM} -r ${DISTNAME} patch: $(srcdir)/configure @echo "Creating patch file -- do this after CVS tagging" ! cvs rdiff -c \ -r `${SED} -n -e 's/^.*OLD TAG.*"\(.*\)".*$$/\1/p' ${srcdir}/version.c` \ -r `${SED} -n -e 's/^.*NEW TAG.*"\(.*\)".*$$/\1/p' ${srcdir}/version.c` \ ! modules | gzip -c \ > modules-`${SED} -n -e 's/^.*OLD TAG.*"modules-\([0-9]*\)-\([0-9]*\)-\([0-9]*\)".*$$/\1.\2.\3/p' ${srcdir}/version.c`-`${SED} -n -e 's/^.*NEW TAG.*"modules-\([0-9]*\)-\([0-9]*\)-\([0-9]*\)".*$$/\1.\2.\3/p' ${srcdir}/version.c`.diff.gz tag: @echo "CVS tagging - TAG = "\ `${SED} -n -e 's/^.*NEW TAG.*"\(.*\)".*$$/\1/p' ${srcdir}/version.c` ! cvs rtag -F \ `${SED} -n -e 's/^.*NEW TAG.*"\(.*\)".*$$/\1/p' ${srcdir}/version.c` \ modules --- 177,203 ---- @echo "removing directory ${DISTNAME}" ${RM} -r ${DISTNAME} + ${DISTNAME}.tar.bz2 : ${DISTNAME}.tar.gz + @echo "Creating ${DISTNAME}.tar.bz2" + ${GZIP} -d -c ${DISTNAME}.tar.gz | ${BZIP2} > ${DISTNAME}.tar.bz2 + patch: $(srcdir)/configure @echo "Creating patch file -- do this after CVS tagging" ! ${CVS} rdiff -c \ -r `${SED} -n -e 's/^.*OLD TAG.*"\(.*\)".*$$/\1/p' ${srcdir}/version.c` \ -r `${SED} -n -e 's/^.*NEW TAG.*"\(.*\)".*$$/\1/p' ${srcdir}/version.c` \ ! modules | ${GZIP} -c \ > modules-`${SED} -n -e 's/^.*OLD TAG.*"modules-\([0-9]*\)-\([0-9]*\)-\([0-9]*\)".*$$/\1.\2.\3/p' ${srcdir}/version.c`-`${SED} -n -e 's/^.*NEW TAG.*"modules-\([0-9]*\)-\([0-9]*\)-\([0-9]*\)".*$$/\1.\2.\3/p' ${srcdir}/version.c`.diff.gz + ${CVS} rdiff -c \ + -r `${SED} -n -e 's/^.*OLD TAG.*"\(.*\)".*$$/\1/p' ${srcdir}/version.c` \ + -r `${SED} -n -e 's/^.*NEW TAG.*"\(.*\)".*$$/\1/p' ${srcdir}/version.c` \ + modules | ${BZIP2} -c \ + > modules-`${SED} -n -e 's/^.*OLD TAG.*"modules-\([0-9]*\)-\([0-9]*\)-\([0-9]*\)".*$$/\1.\2.\3/p' ${srcdir}/version.c`-`${SED} -n -e 's/^.*NEW TAG.*"modules-\([0-9]*\)-\([0-9]*\)-\([0-9]*\)".*$$/\1.\2.\3/p' ${srcdir}/version.c`.diff.bz2 tag: @echo "CVS tagging - TAG = "\ `${SED} -n -e 's/^.*NEW TAG.*"\(.*\)".*$$/\1/p' ${srcdir}/version.c` ! ${CVS} rtag -F \ `${SED} -n -e 's/^.*NEW TAG.*"\(.*\)".*$$/\1/p' ${srcdir}/version.c` \ modules *************** *** 191,205 **** ftp-local: # this should be done by the maintainer (R.K.Owen) only! ! @echo "placing $(DISTNAME).tar.gz" -@if [ -e $(DISTNAME).tar.gz ]; then \ cp $(DISTNAME).tar.gz /u/ftp/pub/rkowen/modules; \ else echo "Can't find $(DISTNAME).tar.gz"; fi -@XXX=modules-`${SED} -n -e 's/^.*OLD TAG.*"modules-\([0-9]*\)-\([0-9]*\)-\([0-9]*\)".*$$/\1.\2.\3/p' ${srcdir}/version.c`-`${SED} -n -e 's/^.*NEW TAG.*"modules-\([0-9]*\)-\([0-9]*\)-\([0-9]*\)".*$$/\1.\2.\3/p' ${srcdir}/version.c`.diff.gz ; \ echo "placing $$XXX"; \ if [ -e $$XXX ]; then \ cp $$XXX /u/ftp/pub/rkowen/modules; \ else echo "Can't find $$XXX"; fi -@echo "placing modules.lsm" -@if [ -e modules.lsm ]; then \ cp modules.lsm /u/ftp/pub/rkowen/modules; \ --- 208,230 ---- ftp-local: # this should be done by the maintainer (R.K.Owen) only! ! @echo "placing $(DISTNAME).tar.{gz|bz2}" -@if [ -e $(DISTNAME).tar.gz ]; then \ cp $(DISTNAME).tar.gz /u/ftp/pub/rkowen/modules; \ else echo "Can't find $(DISTNAME).tar.gz"; fi + -@if [ -e $(DISTNAME).tar.bz2 ]; then \ + cp $(DISTNAME).tar.bz2 /u/ftp/pub/rkowen/modules; \ + else echo "Can't find $(DISTNAME).tar.bz2"; fi -@XXX=modules-`${SED} -n -e 's/^.*OLD TAG.*"modules-\([0-9]*\)-\([0-9]*\)-\([0-9]*\)".*$$/\1.\2.\3/p' ${srcdir}/version.c`-`${SED} -n -e 's/^.*NEW TAG.*"modules-\([0-9]*\)-\([0-9]*\)-\([0-9]*\)".*$$/\1.\2.\3/p' ${srcdir}/version.c`.diff.gz ; \ echo "placing $$XXX"; \ if [ -e $$XXX ]; then \ cp $$XXX /u/ftp/pub/rkowen/modules; \ else echo "Can't find $$XXX"; fi + -@XXX=modules-`${SED} -n -e 's/^.*OLD TAG.*"modules-\([0-9]*\)-\([0-9]*\)-\([0-9]*\)".*$$/\1.\2.\3/p' ${srcdir}/version.c`-`${SED} -n -e 's/^.*NEW TAG.*"modules-\([0-9]*\)-\([0-9]*\)-\([0-9]*\)".*$$/\1.\2.\3/p' ${srcdir}/version.c`.diff.bz2 ; \ + echo "placing $$XXX"; \ + if [ -e $$XXX ]; then \ + cp $$XXX /u/ftp/pub/rkowen/modules; \ + else echo "Can't find $$XXX"; fi -@echo "placing modules.lsm" -@if [ -e modules.lsm ]; then \ cp modules.lsm /u/ftp/pub/rkowen/modules; \ *************** *** 211,225 **** # do local files first ... mostly to verify their existence # this should be done by the maintainer (R.K.Owen) only! @echo "placing sunsite.unc.edu files"; ! -@XXX=modules-`${SED} -n -e 's/^.*OLD TAG.*"modules-\([0-9]*\)-\([0-9]*\)-\([0-9]*\)".*$$/\1.\2.\3/p' ${srcdir}/version.c`-`${SED} -n -e 's/^.*NEW TAG.*"modules-\([0-9]*\)-\([0-9]*\)-\([0-9]*\)".*$$/\1.\2.\3/p' ${srcdir}/version.c`.diff.gz ; \ ! echo "placing modules.lsm $$XXX $(DISTNAME).tar.gz"; \ ! ./.ftp modules.lsm $$XXX $(DISTNAME).tar.gz; ftp-sourceforge-rko: @echo "placing modules.sourceforge.net files"; ! -@XXX=modules-`${SED} -n -e 's/^.*OLD TAG.*"modules-\([0-9]*\)-\([0-9]*\)-\([0-9]*\)".*$$/\1.\2.\3/p' ${srcdir}/version.c`-`${SED} -n -e 's/^.*NEW TAG.*"modules-\([0-9]*\)-\([0-9]*\)-\([0-9]*\)".*$$/\1.\2.\3/p' ${srcdir}/version.c`.diff.gz ; \ ! echo "placing modules.lsm $$XXX $(DISTNAME).tar.gz"; \ ! scp modules.lsm $$XXX $(DISTNAME).tar.gz rkowen@shell.sourceforge.net:ftp clean: rm -f modulecmd *.o core --- 236,250 ---- # do local files first ... mostly to verify their existence # this should be done by the maintainer (R.K.Owen) only! @echo "placing sunsite.unc.edu files"; ! -@XXX=modules-`${SED} -n -e 's/^.*OLD TAG.*"modules-\([0-9]*\)-\([0-9]*\)-\([0-9]*\)".*$$/\1.\2.\3/p' ${srcdir}/version.c`-`${SED} -n -e 's/^.*NEW TAG.*"modules-\([0-9]*\)-\([0-9]*\)-\([0-9]*\)".*$$/\1.\2.\3/p' ${srcdir}/version.c`.diff."*" ; \ ! echo "placing modules.lsm $$XXX $(DISTNAME).tar.*"; \ ! ./.ftp modules.lsm $$XXX $(DISTNAME).tar.*; ftp-sourceforge-rko: @echo "placing modules.sourceforge.net files"; ! -@XXX=modules-`${SED} -n -e 's/^.*OLD TAG.*"modules-\([0-9]*\)-\([0-9]*\)-\([0-9]*\)".*$$/\1.\2.\3/p' ${srcdir}/version.c`-`${SED} -n -e 's/^.*NEW TAG.*"modules-\([0-9]*\)-\([0-9]*\)-\([0-9]*\)".*$$/\1.\2.\3/p' ${srcdir}/version.c`.diff."*" ; \ ! echo "placing modules.lsm $$XXX $(DISTNAME).tar."*""; \ ! scp modules.lsm $$XXX $(DISTNAME).tar."*" rkowen@shell.sourceforge.net:ftp clean: rm -f modulecmd *.o core Index: modules/cmdPath.c diff -c modules/cmdPath.c:1.3 modules/cmdPath.c:1.4 *** modules/cmdPath.c:1.3 Mon Jul 9 11:21:36 2001 --- modules/cmdPath.c Wed Jul 25 21:59:25 2001 *************** *** 30,36 **** ** ** ** ************************************************************************ **/ ! static char Id[] = "@(#)$Id: cmdPath.c,v 1.3 2001/07/09 18:21:36 rkowen Exp $"; static void *UseId[] = { &UseId, Id }; /** ************************************************************************ **/ --- 30,36 ---- ** ** ** ************************************************************************ **/ ! static char Id[] = "@(#)$Id: cmdPath.c,v 1.4 2001/07/26 04:59:25 rkowen Exp $"; static void *UseId[] = { &UseId, Id }; /** ************************************************************************ **/ *************** *** 122,128 **** char *oldpath; /** Old value of 'var' **/ char *newpath; /** New value of 'var' **/ char *sw_marker = APP_SW_MARKER; /** arbitrary default **/ ! char *startp, *endp; /** regexp match endpts **/ int append = 1; /** append or prepend **/ #if WITH_DEBUGGING_CALLBACK --- 122,128 ---- char *oldpath; /** Old value of 'var' **/ char *newpath; /** New value of 'var' **/ char *sw_marker = APP_SW_MARKER; /** arbitrary default **/ ! char *startp=NULL, *endp=NULL; /** regexp match endpts **/ int append = 1; /** append or prepend **/ #if WITH_DEBUGGING_CALLBACK *************** *** 160,166 **** ** prepend or append. The default is append. **/ ! if( !( append = strncmp( argv[0], "pre", 3))) sw_marker = PRE_SW_MARKER; /** --- 160,166 ---- ** prepend or append. The default is append. **/ ! if( !( append = !!strncmp( argv[0], "pre", 3))) sw_marker = PRE_SW_MARKER; /** *************** *** 247,253 **** ** Otherwise we have to take care on prepending vs. appending ... ** If there is a append or prepend marker within the variable (see ** modules_def.h) the changes are made according to this markers. Other- ! ** wise append and prepaend will be relative to the strings begin or end. **/ } else { --- 247,253 ---- ** Otherwise we have to take care on prepending vs. appending ... ** If there is a append or prepend marker within the variable (see ** modules_def.h) the changes are made according to this markers. Other- ! ** wise append and prepend will be relative to the strings begin or end. **/ } else { *************** *** 265,271 **** ** Append/Prepend marker found **/ ! if( !append) { char ch = *endp; *endp = '\0'; strcpy(newpath, oldpath); --- 265,271 ---- ** Append/Prepend marker found **/ ! if( append) { char ch = *endp; *endp = '\0'; strcpy(newpath, oldpath); *************** *** 276,281 **** --- 276,283 ---- } else { char ch = *startp; *startp = '\0'; + strcpy(newpath, oldpath); + if (newpath[strlen(newpath)-1] != ':') strcat(newpath, ":"); strcpy(newpath, argv[2]); if (*oldpath != ':') strcat(newpath, ":"); strcat(newpath, oldpath); *************** *** 358,366 **** char *oldpath, /** Old value of 'var' **/ *tmppath, /** Temp. buffer for 'var' **/ *searchpath, ! *sw_marker = APP_SW_MARKER; /** arbitrary default **/ ! int start_offset = 0, ! end_offset = 0; Tcl_RegExp regexpPtr = (Tcl_RegExp) NULL, begexpPtr = (Tcl_RegExp) NULL, midexpPtr = (Tcl_RegExp) NULL, --- 360,370 ---- char *oldpath, /** Old value of 'var' **/ *tmppath, /** Temp. buffer for 'var' **/ *searchpath, ! *sw_marker = APP_SW_MARKER, /** arbitrary default **/ ! *startp=NULL, *endp=NULL; /** regexp match endpts **/ ! int start_offset = 0, /** match offsets **/ ! end_offset = 0, ! path_len = 0; /** length of unmatched path **/ Tcl_RegExp regexpPtr = (Tcl_RegExp) NULL, begexpPtr = (Tcl_RegExp) NULL, midexpPtr = (Tcl_RegExp) NULL, *************** *** 374,380 **** /** ** Check arguments. There should be give 3 args: ! ** argv[0] - prepend/append ** argv[1] - varname ** argv[2] - value **/ --- 378,384 ---- /** ** Check arguments. There should be give 3 args: ! ** argv[0] - prepend/append/remove-path ** argv[1] - varname ** argv[2] - value **/ *************** *** 434,439 **** --- 438,444 ---- } strcpy( oldpath, tmppath); + path_len = strlen(oldpath); cleanse_path( argv[2], buffer, PATH_BUFLEN); *************** *** 469,484 **** begexpPtr = Tcl_RegExpCompile(interp, searchpath); _TCLCHK(interp) ! if( Tcl_RegExpExec(interp, begexpPtr, oldpath, oldpath)) { _TCLCHK(interp) regexpPtr = begexpPtr; /** ! ** Copy from the beginning of the stringp[0] to one ! ** character before endp[0] **/ start_offset = 0; end_offset = -1; } else { --- 474,491 ---- begexpPtr = Tcl_RegExpCompile(interp, searchpath); _TCLCHK(interp) ! if( Tcl_RegExpExec(interp, begexpPtr, oldpath, oldpath) > 0) { _TCLCHK(interp) regexpPtr = begexpPtr; /** ! ** Copy from the beginning of the startp to one ! ** character before endp **/ + Tcl_RegExpRange(begexpPtr, 0, &startp, &endp); start_offset = 0; end_offset = -1; + path_len -= (endp - startp - 1); } else { *************** *** 488,494 **** midexpPtr = Tcl_RegExpCompile(interp, searchpath); _TCLCHK(interp) ! if( Tcl_RegExpExec(interp, midexpPtr, oldpath, oldpath)) { _TCLCHK(interp) regexpPtr = midexpPtr; --- 495,501 ---- midexpPtr = Tcl_RegExpCompile(interp, searchpath); _TCLCHK(interp) ! if( Tcl_RegExpExec(interp, midexpPtr, oldpath, oldpath) > 0) { _TCLCHK(interp) regexpPtr = midexpPtr; *************** *** 497,503 **** --- 504,512 ---- ** character before endp[0] **/ + Tcl_RegExpRange(midexpPtr, 0, &startp, &endp); start_offset = 1; end_offset = -1; + path_len -= (endp - startp - 2); } else { *************** *** 507,513 **** endexpPtr = Tcl_RegExpCompile(interp, searchpath); _TCLCHK(interp) ! if( Tcl_RegExpExec(interp, endexpPtr, oldpath, oldpath)) { _TCLCHK(interp) regexpPtr = endexpPtr; --- 516,522 ---- endexpPtr = Tcl_RegExpCompile(interp, searchpath); _TCLCHK(interp) ! if( Tcl_RegExpExec(interp, endexpPtr, oldpath, oldpath) > 0) { _TCLCHK(interp) regexpPtr = endexpPtr; *************** *** 516,522 **** --- 525,533 ---- ** through endp[0] **/ + Tcl_RegExpRange(endexpPtr, 0, &startp, &endp); start_offset = 0; end_offset = 0; + path_len -= (endp - startp - 1); } else { *************** *** 526,532 **** onlyexpPtr = Tcl_RegExpCompile(interp, searchpath); _TCLCHK(interp) ! if(Tcl_RegExpExec(interp, onlyexpPtr, oldpath, oldpath)) { _TCLCHK(interp) /** --- 537,543 ---- onlyexpPtr = Tcl_RegExpCompile(interp, searchpath); _TCLCHK(interp) ! if(Tcl_RegExpExec(interp, onlyexpPtr, oldpath, oldpath) > 0) { _TCLCHK(interp) /** *************** *** 592,599 **** ** the module was formed around. **/ ! if((g_flags & M_SWSTATE1) && Tcl_RegExpExec(interp, ! markexpPtr, oldpath, oldpath)) { /** ** If I don't have enough space to replace the oldpath with the --- 603,610 ---- ** the module was formed around. **/ ! if((g_flags & M_SWSTATE1) && ! (Tcl_RegExpExec(interp, ! markexpPtr, oldpath, oldpath) > 0)) { /** ** If I don't have enough space to replace the oldpath with the *************** *** 601,613 **** ** recreate the PATH variable. **/ ! char* newenv, *startp=NULL, *endp=NULL; ! _TCLCHK(interp) ! Tcl_RegExpRange(markexpPtr, 0, &startp, &endp); ! if( NULL == ( newenv = (char*) malloc( ! startp + start_offset - oldpath + strlen(sw_marker) + ! strlen(argv[1]) + strlen(endp) + end_offset + 1) )) { if( OK != ErrorLogger( ERR_ALLOC, LOC, NULL)) { free( oldpath); --- 612,620 ---- ** recreate the PATH variable. **/ ! char* newenv; ! if(NULL == (newenv=(char*) malloc(path_len + strlen(sw_marker) + 1) )) { if( OK != ErrorLogger( ERR_ALLOC, LOC, NULL)) { free( oldpath); *************** *** 615,621 **** } } - Tcl_RegExpRange(regexpPtr, 0, &startp, &endp); *(startp + start_offset) = '\0'; if(*(endp + end_offset) == '\0') { --- 622,627 ---- *************** *** 630,636 **** /** ** Just store the value with the marker into the environment. I'm not ! ** checking to see if it changed because the only case that a PATH-type ** variable will be unset is when I remove the only path remaining in ** the variable. So, using moduleSetenv is not necessary here. **/ --- 636,642 ---- /** ** Just store the value with the marker into the environment. I'm not ! ** checking if it changed because the only case that a PATH-type ** variable will be unset is when I remove the only path remaining in ** the variable. So, using moduleSetenv is not necessary here. **/ *************** *** 641,654 **** } else { /** SW_STATE1 **/ - char *startp, *endp; - /** ** We must be in SW_STATE3 or not in SW_STATE at all. ** Removing the marker should be just like removing any other path. **/ - Tcl_RegExpRange(regexpPtr, 0, &startp, &endp); strcpy( startp + start_offset, endp); /** --- 647,657 ---- *************** *** 666,672 **** Tcl_SetVar2( interp, "env", argv[1], oldpath, TCL_GLOBAL_ONLY); _TCLCHK(interp) ! } /** SW_STATE1 **/ /** ** Free what has been used and return on success --- 669,675 ---- Tcl_SetVar2( interp, "env", argv[1], oldpath, TCL_GLOBAL_ONLY); _TCLCHK(interp) ! } /** ! SW_STATE1 **/ /** ** Free what has been used and return on success Index: modules/version.c diff -c modules/version.c:1.9 modules/version.c:1.12 *** modules/version.c:1.9 Wed Jul 11 14:56:35 2001 --- modules/version.c Fri Aug 3 12:59:32 2001 *************** *** 1,4 **** ! const char *version_string = "3.1.3"; ! const char *date_string = "2001-07-04"; ! /* NEW TAG "modules-3-1-3" */ ! /* OLD TAG "modules-3-1-2" */ --- 1,4 ---- ! const char *version_string = "3.1.4"; ! const char *date_string = "2001-08-03"; ! /* NEW TAG "modules-3-1-4" */ ! /* OLD TAG "modules-3-1-3" */ Index: modules/etc/global/bashrc.in diff -c modules/etc/global/bashrc.in:1.1 modules/etc/global/bashrc.in:1.2 *** modules/etc/global/bashrc.in:1.1 Mon Jul 9 11:21:37 2001 --- modules/etc/global/bashrc.in Mon Jul 16 12:04:10 2001 *************** *** 10,16 **** -ksh|ksh|*/ksh) modules_shell=ksh ;; -bash|bash|*/bash) modules_shell=bash ;; esac ! eval "module() { eval `@BASEPREFIX@\$MODULE_VERSION/bin/modulecmd $modules_shell $*`; }" unset modules_shell --- 10,16 ---- -ksh|ksh|*/ksh) modules_shell=ksh ;; -bash|bash|*/bash) modules_shell=bash ;; esac ! eval "module() { eval \`@BASEPREFIX@\$MODULE_VERSION/bin/modulecmd $modules_shell \$*\`; }" unset modules_shell Index: modules/etc/global/profile.in diff -c modules/etc/global/profile.in:1.2 modules/etc/global/profile.in:1.3 *** modules/etc/global/profile.in:1.2 Mon Jul 9 11:21:37 2001 --- modules/etc/global/profile.in Mon Jul 16 12:04:10 2001 *************** *** 10,81 **** # # UNIX man documentation search path if [ x"$MANPATH" == x ]; then ! setenv MANPATH /usr/man:/usr/share/man:/usr/X11R6/man fi ! setenv MANPATH "$MANPATH":/usr/local/man:/usr/local/X11/man ! setenv MANPATH "$MANPATH":/usr/local/X11R6/man # GNU info documentation search path if [ x"$INFOPATH" == x ]; then ! setenv INFOPATH /usr/info:/usr/lib/info:/usr/gnu/info fi ! INFOPATH= "$INFOPATH":/usr/local/info # gcc include directory search path if [ x"$C_INCLUDE_PATH" == x ]; then ! C_INCLUDE_PATH=/usr/include:/usr/X11R6/include fi ! C_INCLUDE_PATH="$C_INCLUDE_PATH":/usr/local/include # g++ include directory search path if [ x"$CPLUS_INCLUDE_PATH" == x ]; then ! CPLUS_INCLUDE_PATH /usr/include:/usr/X11R6/include fi ! CPLUS_INCLUDE_PATH "$CPLUS_INCLUDE_PATH":/usr/local/include # generic ld library directory search path if [ x"$LIBRARY_PATH" == x ]; then ! LIBRARY_PATH=/lib:/usr/lib:/usr/X11R6/lib fi ! LIBRARY_PATH="$LIBRARY_PATH":/usr/local/lib # Linux (and most Unixes) run-time dynamically loaded libraries search path if [ x"$LD_LIBRARY_PATH" == x ]; then ! LD_LIBRARY_PATH=/lib:/usr/lib:/usr/X11R6/lib fi ! LD_LIBRARY_PATH="$LD_LIBRARY_PATH":/usr/local/lib # ELF object settable run-time dynamically loaded library directory search path # see ld -rpath if [ x"$LD_RUN_PATH" == x ]; then ! LD_RUN_PATH=/lib:/usr/lib:/usr/X11R6/lib fi ! LD_RUN_PATH="$LD_RUN_PATH":/usr/local/lib # X11 resource location search path if [ x"$XAPPLRESDIR" == x ]; then ! XAPPLRESDIR=/usr/lib/X11/app-defaults fi ! XAPPLRESDIR="$XAPPLRESDIR":/usr/local/X11/app-defaults # GNOME application and library package search path if [ x"$GNOME_PATH" == x ]; then ! GNOME_PATH=/usr fi ! GNOME_PATH="$GNOME_PATH":/usr/local # GNOME library definition script search path (generally `$GNOME_PATH'/lib) if [ x"$GNOME_LIBCONFIG_PATH" == x ]; then ! GNOME_LIBCONFIG_PATH=/usr/lib fi ! GNOME_LIBCONFIG_PATH="$GNOME_LIBCONFIG_PATH":/usr/local/lib # executable search path (this sets $path too) if [ x"$PATH" == x ]; then ! PATH=/bin:/usr/bin:/usr/X11R6/bin:/sbin:/usr/sbin fi ! PATH=/usr/local/bin:/usr/local/X11/bin:"$PATH" ! PATH="$PATH":/etc:/usr/etc:/usr/local/etc:. export MANPATH INFOPATH C_INCLUDE_PATH CPLUS_INCLUDE_PATH LIBRARY_PATH export LD_LIBRARY_PATH LD_RUN_PATH XAPPLRESDIR GNOME_PATH GNOME_LIBCONFIG_PATH --- 10,81 ---- # # UNIX man documentation search path if [ x"$MANPATH" == x ]; then ! MANPATH=/usr/man:/usr/share/man:/usr/X11R6/man fi ! MANPATH="$MANPATH":/usr/local/man:/usr/local/X11/man ! MANPATH="$MANPATH":/usr/local/X11R6/man # GNU info documentation search path if [ x"$INFOPATH" == x ]; then ! INFOPATH=/usr/info:/usr/lib/info:/usr/gnu/info fi ! INFOPATH="$INFOPATH":/usr/local/info # gcc include directory search path if [ x"$C_INCLUDE_PATH" == x ]; then ! C_INCLUDE_PATH=/usr/include:/usr/X11R6/include fi ! C_INCLUDE_PATH="$C_INCLUDE_PATH":/usr/local/include # g++ include directory search path if [ x"$CPLUS_INCLUDE_PATH" == x ]; then ! CPLUS_INCLUDE_PATH=/usr/include:/usr/X11R6/include fi ! CPLUS_INCLUDE_PATH="$CPLUS_INCLUDE_PATH":/usr/local/include # generic ld library directory search path if [ x"$LIBRARY_PATH" == x ]; then ! LIBRARY_PATH=/lib:/usr/lib:/usr/X11R6/lib fi ! LIBRARY_PATH="$LIBRARY_PATH":/usr/local/lib # Linux (and most Unixes) run-time dynamically loaded libraries search path if [ x"$LD_LIBRARY_PATH" == x ]; then ! LD_LIBRARY_PATH=/lib:/usr/lib:/usr/X11R6/lib fi ! LD_LIBRARY_PATH="$LD_LIBRARY_PATH":/usr/local/lib # ELF object settable run-time dynamically loaded library directory search path # see ld -rpath if [ x"$LD_RUN_PATH" == x ]; then ! LD_RUN_PATH=/lib:/usr/lib:/usr/X11R6/lib fi ! LD_RUN_PATH="$LD_RUN_PATH":/usr/local/lib # X11 resource location search path if [ x"$XAPPLRESDIR" == x ]; then ! XAPPLRESDIR=/usr/lib/X11/app-defaults fi ! XAPPLRESDIR="$XAPPLRESDIR":/usr/local/X11/app-defaults # GNOME application and library package search path if [ x"$GNOME_PATH" == x ]; then ! GNOME_PATH=/usr fi ! GNOME_PATH="$GNOME_PATH":/usr/local # GNOME library definition script search path (generally `$GNOME_PATH'/lib) if [ x"$GNOME_LIBCONFIG_PATH" == x ]; then ! GNOME_LIBCONFIG_PATH=/usr/lib fi ! GNOME_LIBCONFIG_PATH="$GNOME_LIBCONFIG_PATH":/usr/local/lib # executable search path (this sets $path too) if [ x"$PATH" == x ]; then ! PATH=/bin:/usr/bin:/usr/X11R6/bin:/sbin:/usr/sbin fi ! PATH=/usr/local/bin:/usr/local/X11/bin:"$PATH" ! PATH="$PATH":/etc:/usr/etc:/usr/local/etc:. export MANPATH INFOPATH C_INCLUDE_PATH CPLUS_INCLUDE_PATH LIBRARY_PATH export LD_LIBRARY_PATH LD_RUN_PATH XAPPLRESDIR GNOME_PATH GNOME_LIBCONFIG_PATH *************** *** 85,91 **** # module initialization # if [ -x /etc/custom/profile.modules ]; then ! source /etc/custom/profile.modules # put system-wide module loads here # module load null fi --- 85,91 ---- # module initialization # if [ -x /etc/custom/profile.modules ]; then ! . /etc/custom/profile.modules # put system-wide module loads here # module load null fi Index: modules/testsuite/modulefiles/info/isloaded diff -c /dev/null modules/testsuite/modulefiles/info/isloaded:1.1 *** /dev/null Fri Aug 3 13:40:48 2001 --- modules/testsuite/modulefiles/info/isloaded Wed Jul 25 21:59:25 2001 *************** *** 0 **** --- 1,31 ---- + #%Module1.0 + + ############################################################################## + # Modules Revision 3.0 + # Providing a flexible user environment + # + # File: info/%M% + # Revision: %I% + # First Edition: 2001/07/25 + # Last Mod.: %U%, %G% + # + # Authors: R.K. Owen, rk@owen.sj.ca.us + # + # Description: Testuite modulefile + # Command: + # Sub-Command: setenv, is-loaded + # + # Invocation: load @M@/@V@ + # Result: %R{ + # setenv _LMFILES_ ${_LMFILES_}:@M@/@V@ + # setenv LOADEDMODULES ${LOADEDMODULES}:@P@/@M@/@V@ + # setenv testsuite 1 or 0 + # }R% + # Comment: %C{ + # The 'is-loaded name' command retrieves whether + # the given module 'name' is loaded or not + # }C% + # + ############################################################################## + + setenv testsuite "[is-loaded info/name]" Index: modules/testsuite/modulefiles/loc_dv1/1.0 diff -c modules/testsuite/modulefiles/loc_dv1/1.0:1.1.1.1 modules/testsuite/modulefiles/loc_dv1/1.0:1.2 *** modules/testsuite/modulefiles/loc_dv1/1.0:1.1.1.1 Tue Jun 27 17:17:33 2000 --- modules/testsuite/modulefiles/loc_dv1/1.0 Wed Jul 25 21:59:25 2001 *************** *** 20,28 **** # }R% # Comment: %C{ # This is an empty module file used for checking the ! # locating of a default module file if not explicite # version is specified. ! # This one will nor be selected, because there is an- # other valid one with a higher version number in the # same directory. # }C% --- 20,28 ---- # }R% # Comment: %C{ # This is an empty module file used for checking the ! # locating of a default module file if not explicit # version is specified. ! # This one will not be selected, because there is an- # other valid one with a higher version number in the # same directory. # }C% Index: modules/testsuite/modulefiles/loc_dv1/2.0 diff -c modules/testsuite/modulefiles/loc_dv1/2.0:1.1.1.1 modules/testsuite/modulefiles/loc_dv1/2.0:1.2 *** modules/testsuite/modulefiles/loc_dv1/2.0:1.1.1.1 Tue Jun 27 17:17:33 2000 --- modules/testsuite/modulefiles/loc_dv1/2.0 Wed Jul 25 21:59:25 2001 *************** *** 24,30 **** # }R% # Comment: %C{ # This is an empty module file used for checking the ! # locating of a default module file if not explicite # version is specified. # This one is selected by version number (2.0 > 1.0). # }C% --- 24,30 ---- # }R% # Comment: %C{ # This is an empty module file used for checking the ! # locating of a default module file if not explicit # version is specified. # This one is selected by version number (2.0 > 1.0). # }C% Index: modules/testsuite/modules.50-cmds/088-info-isloaded.exp diff -c /dev/null modules/testsuite/modules.50-cmds/088-info-isloaded.exp:1.1 *** /dev/null Fri Aug 3 13:40:48 2001 --- modules/testsuite/modules.50-cmds/088-info-isloaded.exp Wed Jul 25 21:59:25 2001 *************** *** 0 **** --- 1,132 ---- + ############################################################################## + # Modules Revision 3.0 + # Providing a flexible user environment + # + # File: modules.50-cmds/%M% + # Revision: %I% + # First Edition: 2001/07/25 + # Last Mod.: %U%, %G% + # + # Authors: R.K. Owen, rk@owen.sj.ca.us + # + # Description: Testuite testsequence + # Command: load + # Modulefiles: info/isloaded + # Sub-Command: + # + # Comment: %C{ + # Tests the 'is-loaded name' module subcommand for all + # allowed shell types. + # }C% + # + ############################################################################## + + # + # Variables. This test forces a module load command. It will result in the + # environment variables "_LMFILES_", "LOADEDMODULES" and "testsuite" to + # be set up + # + + set module "info/name" + set modulefile "$env(MODULEPATH)/$module" + set modulex "info/isloaded" + set modulefilex "$env(MODULEPATH)/$modulex" + set modules "$module:$modulex" + set modulefiles "$modulefile:$modulefilex" + + # + # Test the case when the given module is loaded + # + + # + # set up the environment + # + set env(_LMFILES_) "$modulefile" + set env(LOADEDMODULES) "$module" + + # + # For the different shells ... + # + + set lmf_sh "_LMFILES_='$modulefiles';export _LMFILES_;" + set lm_sh "LOADEDMODULES='$modules';export LOADEDMODULES;" + set ts_sh "testsuite='1';export testsuite;" + + set lmf_csh "setenv _LMFILES_ '$modulefiles';" + set lm_csh "setenv LOADEDMODULES '$modules';" + set ts_csh "setenv testsuite '1';" + + set lmf_perl "\$ENV{'_LMFILES_'} = '$modulefiles';" + set lm_perl "\$ENV{'LOADEDMODULES'} = '$modules';" + set ts_perl "\$ENV{'testsuite'} = '1';" + + # + # The tests + # + + test_cmd "sh" "load $modulex" "$lmf_sh$lm_sh$ts_sh" + test_cmd "ksh" "load $modulex" "$lmf_sh$lm_sh$ts_sh" + test_cmd "zsh" "load $modulex" "$lmf_sh$lm_sh$ts_sh" + test_cmd "csh" "load $modulex" "$lmf_csh$lm_csh$ts_csh" + test_cmd "tcsh" "load $modulex" "$lmf_csh$lm_csh$ts_csh" + test_cmd "perl" "load $modulex" "$lmf_perl$lm_perl$ts_perl" + + # + # Test the case when the given module is not loaded + # + + # + # set up the environment + # + unset env(_LMFILES_) + unset env(LOADEDMODULES) + + # + # For the different shells ... + # + + set lmf_sh "_LMFILES_='$modulefilex';export _LMFILES_;" + set lm_sh "LOADEDMODULES='$modulex';export LOADEDMODULES;" + set ts_sh "testsuite='0';export testsuite;" + + set lmf_csh "setenv _LMFILES_ '$modulefilex';" + set lm_csh "setenv LOADEDMODULES '$modulex';" + set ts_csh "setenv testsuite '0';" + + set lmf_perl "\$ENV{'_LMFILES_'} = '$modulefilex';" + set lm_perl "\$ENV{'LOADEDMODULES'} = '$modulex';" + set ts_perl "\$ENV{'testsuite'} = '0';" + + # + # The tests + # + + test_cmd "sh" "load $modulex" "$lmf_sh$lm_sh$ts_sh" + test_cmd "ksh" "load $modulex" "$lmf_sh$lm_sh$ts_sh" + test_cmd "zsh" "load $modulex" "$lmf_sh$lm_sh$ts_sh" + test_cmd "csh" "load $modulex" "$lmf_csh$lm_csh$ts_csh" + test_cmd "tcsh" "load $modulex" "$lmf_csh$lm_csh$ts_csh" + test_cmd "perl" "load $modulex" "$lmf_perl$lm_perl$ts_perl" + + # + # Cleanup + # + + unset ts_sh + unset lm_sh + unset lmf_sh + + unset ts_csh + unset lm_csh + unset lmf_csh + + unset ts_perl + unset lm_perl + unset lmf_perl + + unset modulefile + unset module + unset modulefilex + unset modulex + unset modulefiles + unset modules Index: modules/testsuite/modules.50-cmds/170-swap.exp diff -c /dev/null modules/testsuite/modules.50-cmds/170-swap.exp:1.1 *** /dev/null Fri Aug 3 13:40:48 2001 --- modules/testsuite/modules.50-cmds/170-swap.exp Wed Jul 25 21:59:25 2001 *************** *** 0 **** --- 1,163 ---- + ############################################################################## + # Modules Revision 3.0 + # Providing a flexible user environment + # + # File: modules.50-cmds/%M% + # Revision: %I% + # First Edition: 2001/07/25 + # Last Mod.: %U%, %G% + # + # Authors: R.K. Owen, + # + # Description: Testuite testsequence + # Command: swap + # Modulefiles: loc_dv1/1.0, loc_dv1/2.0, + # loc_dv2/1.0, loc_dv2/2.0, + # loc_dv3/1.0, loc_dv3/2.0, + # Sub-Command: + # + # Comment: %C{ + # Tests the 'swap' module subcommand for all allowed + # shell types. + # }C% + # + ############################################################################## + + set mod11 "loc_dv1/1.0" + set mod12 "loc_dv1/2.0" + set mod21 "loc_dv2/1.0" + set mod22 "loc_dv2/2.0" + set mod31 "loc_dv3/1.0" + set mod32 "loc_dv3/2.0" + + set mod11p "$env(MODULEPATH)/$mod11" + set mod12p "$env(MODULEPATH)/$mod12" + set mod21p "$env(MODULEPATH)/$mod21" + set mod22p "$env(MODULEPATH)/$mod22" + set mod31p "$env(MODULEPATH)/$mod31" + set mod32p "$env(MODULEPATH)/$mod32" + + set module "$mod11:$mod21:$mod31" + set modulefile "$mod11p:$mod21p:$mod31p" + + # + # set up the environment + # + set env(_LMFILES_) "$modulefile" + set env(LOADEDMODULES) "$module" + + # + # Swap the 1st in list + # For the different shells ... + # + + set module "$mod12:$mod21:$mod31" + set modulefile "$mod12p:$mod21p:$mod31p" + + set lmf_sh "_LMFILES_='$modulefile';export _LMFILES_;" + set lm_sh "LOADEDMODULES='$module';export LOADEDMODULES;" + + set lmf_csh "setenv _LMFILES_ '$modulefile';" + set lm_csh "setenv LOADEDMODULES '$module';" + + set lmf_perl "\$ENV{'_LMFILES_'} = '$modulefile';" + set lm_perl "\$ENV{'LOADEDMODULES'} = '$module';" + + # + # The tests + # + + test_cmd "sh" "swap $mod11 $mod12" "$lmf_sh$lm_sh" + test_cmd "ksh" "swap $mod11 $mod12" "$lmf_sh$lm_sh" + test_cmd "zsh" "swap $mod11 $mod12" "$lmf_sh$lm_sh" + test_cmd "csh" "swap $mod11 $mod12" "$lmf_csh$lm_csh" + test_cmd "tcsh" "swap $mod11 $mod12" "$lmf_csh$lm_csh" + test_cmd "perl" "swap $mod11 $mod12" "$lmf_perl$lm_perl" + + # + # Swap the 2nd in list + # For the different shells ... + # + + set module "$mod11:$mod22:$mod31" + set modulefile "$mod11p:$mod22p:$mod31p" + + set lmf_sh "_LMFILES_='$modulefile';export _LMFILES_;" + set lm_sh "LOADEDMODULES='$module';export LOADEDMODULES;" + + set lmf_csh "setenv _LMFILES_ '$modulefile';" + set lm_csh "setenv LOADEDMODULES '$module';" + + set lmf_perl "\$ENV{'_LMFILES_'} = '$modulefile';" + set lm_perl "\$ENV{'LOADEDMODULES'} = '$module';" + + # + # The tests + # + + test_cmd "sh" "swap $mod21 $mod22" "$lmf_sh$lm_sh" + test_cmd "ksh" "swap $mod21 $mod22" "$lmf_sh$lm_sh" + test_cmd "zsh" "swap $mod21 $mod22" "$lmf_sh$lm_sh" + test_cmd "csh" "swap $mod21 $mod22" "$lmf_csh$lm_csh" + test_cmd "tcsh" "swap $mod21 $mod22" "$lmf_csh$lm_csh" + test_cmd "perl" "swap $mod21 $mod22" "$lmf_perl$lm_perl" + + # + # Swap the last in list + # For the different shells ... + # + + set module "$mod11:$mod21:$mod32" + set modulefile "$mod11p:$mod21p:$mod32p" + + set lmf_sh "_LMFILES_='$modulefile';export _LMFILES_;" + set lm_sh "LOADEDMODULES='$module';export LOADEDMODULES;" + + set lmf_csh "setenv _LMFILES_ '$modulefile';" + set lm_csh "setenv LOADEDMODULES '$module';" + + set lmf_perl "\$ENV{'_LMFILES_'} = '$modulefile';" + set lm_perl "\$ENV{'LOADEDMODULES'} = '$module';" + + # + # The tests + # + + test_cmd "sh" "swap $mod31 $mod32" "$lmf_sh$lm_sh" + test_cmd "ksh" "swap $mod31 $mod32" "$lmf_sh$lm_sh" + test_cmd "zsh" "swap $mod31 $mod32" "$lmf_sh$lm_sh" + test_cmd "csh" "swap $mod31 $mod32" "$lmf_csh$lm_csh" + test_cmd "tcsh" "swap $mod31 $mod32" "$lmf_csh$lm_csh" + test_cmd "perl" "swap $mod31 $mod32" "$lmf_perl$lm_perl" + + # + # Cleanup + # + + unset env(_LMFILES_) + unset env(LOADEDMODULES) + + unset lm_sh + unset lmf_sh + + unset lm_csh + unset lmf_csh + + unset lm_perl + unset lmf_perl + + unset modulefile + unset module + + unset mod11 + unset mod12 + unset mod21 + unset mod22 + unset mod31 + unset mod32 + unset mod11p + unset mod12p + unset mod21p + unset mod22p + unset mod31p + unset mod32p