|
From: Jeff S. <jsq...@us...> - 2004-03-08 17:10:12
|
Update of /cvsroot/env-switcher/modules-oscar/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25616/src Modified Files: oscar.tcl Log Message: Fix for RFE 905191: add "switcher-reload" alias which simply does a "module unload oscar-modules; module load oscar-modules". This flushes out the entire set of OSCAR-loaded modules (including switcher-loaded modules), and then re-loads them. Index: oscar.tcl =================================================================== RCS file: /cvsroot/env-switcher/modules-oscar/src/oscar.tcl,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** oscar.tcl 27 Oct 2002 12:24:07 -0000 1.6 --- oscar.tcl 8 Mar 2004 16:45:46 -0000 1.7 *************** *** 15,23 **** module-whatis "Sets up the OSCAR modules subsystem." ! # Tell modules to use the datadir, where the directory tree containing ! # all the OSCAR-related modulesfiles live set omdir /opt/modules/oscar-modulefiles ! module use $omdir # Set the MANPATH to have just a ":" in it. This is undocumented man --- 15,33 ---- module-whatis "Sets up the OSCAR modules subsystem." ! # Need to do some things differently if we're loading vs. unloading set omdir /opt/modules/oscar-modulefiles ! set am_removing [module-info mode remove] ! ! # Tell modules to use the datadir, where the directory tree containing ! # all the OSCAR-related modulesfiles live. Only do this if we're not ! # unloading this modulefile. This is because upon unload, if we ! # "unuse" this directory and then try to "module unload" the files ! # below, it won't work. We'll unuse this directory if we're unloading ! # *after* we do all the unload of individual modules. ! ! if { ! $am_removing } { ! module use $omdir ! } # Set the MANPATH to have just a ":" in it. This is undocumented man *************** *** 41,42 **** --- 51,61 ---- module load [file tail $modulefile] } + + # Per the note above, only unuse the directory if we're unloading. + # Note that we leave it "use" (vs. "unuse") because when we're + # unloading, the modules infrastructure will automatically change the + # meaning of "use" to "unuse". + + if { $am_removing } { + module use $omdir + } |