File modules-3.1.6.dif of Package Modules

--- Makefile.in
+++ Makefile.in
@@ -37,17 +37,17 @@
 LIBS = -ltcl@TCL_VERSION@ @TCLX_LIBS@ @X11_LIBS@ @X_EXTRA_LIBS@ @LIBS@
 
 # Standard definition (a'la GNU)
-prefix = @prefix@
+prefix = $(DESTDIR)@prefix@
 exec_prefix = @exec_prefix@
-man_prefix = @prefix@
+man_prefix = $(DESTDIR)@prefix@
 
 CFLAGS = @CFLAGS@ -DINSTPATH=\"$(prefix)\"
 LDFLAGS = @LDFLAGS@
 
 # Directory in which to install binaries, module files, and init files
 bindir = $(exec_prefix)/bin
-filedir = $(prefix)/modulefiles
-initdir = $(prefix)/init
+filedir = $(prefix)/share/modules/modulefiles
+initdir = $(prefix)/share/modules/init
 
 SHELL =	/bin/sh
 
--- config.h.in
+++ config.h.in
@@ -210,6 +210,9 @@
 /* Define if you have the syslog function.  */
 #undef HAVE_SYSLOG
 
+/* Define if you have the mkstemp function.  */
+#undef HAVE_MKSTEMP
+
 /* Define if you have the tempnam function.  */
 #undef HAVE_TEMPNAM
 
--- configure.in
+++ configure.in
@@ -79,7 +79,7 @@
 dnl also expand @VERSION@ in path
 DEFAULTPATH=default
 if test "$prefix" != "NONE" ; then
-  DEFAULTPATH=`echo $prefix | sed -e s%@VERSION@%$DEFAULTPATH%g`
+  DEFAULTPATH=/usr/share/modules
   BASEPREFIX=`echo $prefix | sed -e s%@VERSION@%%g`
   prefix=`echo $prefix | sed -e s%@VERSION@%$VERSION%g`
   NODEFAULTPATH=$prefix
@@ -127,7 +127,7 @@
 AC_CHECK_LIB(socket, socket)
 AC_CHECK_LIB(nsl, t_accept)
 AC_PATH_XTRA 
-AC_HAVE_FUNCS(strdup strtok uname gethostname getdomainname tempnam tmpnam \
+AC_HAVE_FUNCS(strdup strtok uname gethostname getdomainname mkstemp tempnam tmpnam \
 	syslog dup2)
 AC_PATH_PROG_SEARCH(_CPPSTDIN, cpp, /lib /usr/lib /usr/lang \
 	/usr/local/lang /usr/ccs/lib, [${CC} -E])
@@ -506,7 +506,7 @@
 		AC_MAKE_INCLUDE(tclx_includes, TCLX_INC_DIR)
 		AC_MAKE_LIBRARY(tclx_libraries, TCLX_LIB_DIR)
 		TCLX_LIBS="-ltclx"
-		AC_REQUIRE([AC_PATH_XTRA])
+		dnl AC_REQUIRE([AC_PATH_XTRA])
 	fi)
 dnl
 dnl --------------------------------------------------------------
@@ -518,7 +518,7 @@
 dnl   --with-skel-path
 dnl
 AC_ARG_WITH(module-path,
-	[  --with-module-path=<path>   use module path=<path>        [/usr/local/Modules/modulefiles]],
+	[  --with-module-path=<path>   use module path=<path>        [/usr/share/modules/modulefiles]],
 	MODULEPATH="$withval"
 	AC_MSG_RESULT([MODULEPATH = $with_module_path])
 	AC_DEFINE_UNQUOTED(MODULEPATH, "$withval")
--- doc/Makefile.in
+++ doc/Makefile.in
@@ -25,8 +25,8 @@
 
 # Directory in which to install man pages
 mandir = @mandir@
-man1dir = $(mandir)/man1
-man4dir = $(mandir)/man4
+man1dir = $(DESTDIR)/$(mandir)/man1
+man4dir = $(DESTDIR)/$(mandir)/man4
 
 SHELL = /bin/sh
 
--- etc/Makefile.in
+++ etc/Makefile.in
@@ -17,14 +17,14 @@
 INSTALL_PROGRAM = $(INSTALL) -m 0755
 INSTALL_DATA = $(INSTALL) -m 0644
 
-# Standard definition (a'la GNU)
-prefix = @prefix@
+
+prefix = $(DESTDIR)/@prefix@
 exec_prefix = @exec_prefix@
-man_prefix = @prefix@
+man_prefix = $(DESTDIR)/@mandir@
 
 # Directory in which to install scripts
 bindir = $(exec_prefix)/bin
-filedir = $(prefix)/modulefiles
+filedir = $(prefix)/share/modules/modulefiles
 
 SHELL = /bin/sh
 
--- etc/global/profile.modules.in
+++ etc/global/profile.modules.in
@@ -11,4 +11,4 @@
                     *) . @DEFAULTPATH@/init/sh ;; 	# default for scripts
 esac
 
-trap 1 2 3
+trap - 1 2 3
--- ext/Makefile.in
+++ ext/Makefile.in
@@ -18,13 +18,13 @@
 INSTALL_DATA = $(INSTALL) -m 0644
 
 # Standard definition (a'la GNU)
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-man_prefix = @prefix@
+prefix = $(DESTDIR)/@prefix@
+exec_prefix = $(DESTDIR)/@exec_prefix@
+man_prefix = $(DESTDIR)/@mandir@
 
 # Directory in which to install scripts
 bindir = $(exec_prefix)/bin
-filedir = $(prefix)/modulefiles
+filedir = $(prefix)/share/modules/modulefiles
 
 SHELL = /bin/sh
 
--- init/.modulespath.in
+++ init/.modulespath.in
@@ -14,6 +14,6 @@
 #
 
 @VERSIONPATH@					# location of version files
-@BASEPREFIX@$MODULE_VERSION/modulefiles		# Module pkg modulefiles
+#@BASEPREFIX@$MODULE_VERSION/modulefiles		# Module pkg modulefiles
 @MODULEPATH@					# General module files
 # @prefix@/your_contribs			# Edit for your requirements
--- init/Makefile.in
+++ init/Makefile.in
@@ -18,14 +18,14 @@
 INSTALL_DATA = $(INSTALL) -m 0644
 
 # Standard definition (a'la GNU)
-prefix = @prefix@
+prefix = $(DESTDIR)/@prefix@
 exec_prefix = @exec_prefix@
-man_prefix = @prefix@
+man_prefix = $(DESTDIR)/@mandir@
 
 # Directory in which to install binaries, module files, and init files
 bindir = $(exec_prefix)/bin
-filedir = $(prefix)/modulefiles
-initdir = $(prefix)/init
+filedir = $(prefix)/share/modules/modulefiles
+initdir = $(prefix)/share/modules/init
 
 SHELL = /bin/sh
 
--- init/bash.in
+++ init/bash.in
@@ -8,9 +8,9 @@
 fi
 export MODULE_VERSION_STACK
 
-module() { eval `@BASEPREFIX@$MODULE_VERSION/bin/modulecmd bash $*`; }
+module() { eval `@BASEPREFIX@/bin/modulecmd bash $*`; }
 
-MODULESHOME=@prefix@
+MODULESHOME=@prefix@/share/modules
 export MODULESHOME
 
 if [ "${LOADEDMODULES:-}" = "" ]; then
@@ -19,6 +19,6 @@
 fi
 
 if [ "${MODULEPATH:-}" = "" ]; then
-  MODULEPATH=`sed 's/#.*$//' ${MODULESHOME}/init/.modulespath | awk 'NF==1{printf("%s:",$1)}'`
+  MODULEPATH=`sed 's/#.*$//' ${MODULESHOME}/init/.modulespath | awk 'NF==1{printf("%s:",$1)}' | sed 's/:$//'`
   export MODULEPATH
 fi
--- init/csh.in
+++ init/csh.in
@@ -9,7 +9,7 @@
 	setenv MODULE_VERSION		"@VERSION@"
 	setenv MODULE_VERSION_STACK	"@VERSION@"
 endif
-set exec_prefix='@BASEPREFIX@$MODULE_VERSION'
+set exec_prefix='@BASEPREFIX@'
 
 if ( $?histchars ) then
   set _histchars = $histchars
@@ -27,10 +27,10 @@
 endif
 unset exec_prefix
 
-setenv MODULESHOME @prefix@
+setenv MODULESHOME @prefix@/share/modules
 
 if (! $?MODULEPATH ) then
-  setenv MODULEPATH `sed 's/#.*$//' ${MODULESHOME}/init/.modulespath | awk 'NF==1{printf("%s:",$1)}'`
+  setenv MODULEPATH `sed 's/#.*$//' ${MODULESHOME}/init/.modulespath | awk 'NF==1{printf("%s:",$1)}' | sed 's/:$//'`
 endif
 
 if (! $?LOADEDMODULES ) then
--- init/ksh.in
+++ init/ksh.in
@@ -8,9 +8,9 @@
 fi
 export MODULE_VERSION_STACK
 
-module() { eval `@BASEPREFIX@$MODULE_VERSION/bin/modulecmd ksh $*`; }
+module() { eval `@BASEPREFIX@/bin/modulecmd ksh $*`; }
 
-MODULESHOME=@prefix@
+MODULESHOME=@prefix@/share/modules
 export MODULESHOME
 
 if [ "${LOADEDMODULES:-}" = "" ]; then
@@ -19,6 +19,6 @@
 fi
 
 if [ "${MODULEPATH:-}" = "" ]; then
-  MODULEPATH=`sed 's/#.*$//' ${MODULESHOME}/init/.modulespath | awk 'NF==1{printf("%s:",$1)}'`
+  MODULEPATH=`sed 's/#.*$//' ${MODULESHOME}/init/.modulespath | awk 'NF==1{printf("%s:",$1)}' | sed 's/:$//'`
   export MODULEPATH
 fi
--- init/perl.in
+++ init/perl.in
@@ -8,15 +8,15 @@
 
 sub module {
         local ($exec_prefix);
-        $exec_prefix = "@BASEPREFIX@".$ENV{MODULE_VERSION};
+        $exec_prefix = "@BASEPREFIX@";
 
 	eval `$exec_prefix/bin/modulecmd perl @_`;
 }
 
-$ENV{MODULESHOME} = "@prefix@";
+$ENV{MODULESHOME} = "@prefix@/share/modules";
 
 if (! defined $ENV{MODULEPATH} ) {
-  $ENV{MODULEPATH} = `sed 's/#.*$//' ${MODULESHOME}/init/.modulespath | awk 'NF==1{printf("%s:",$1)}'` 
+  $ENV{MODULEPATH} = `sed 's/#.*$//' ${MODULESHOME}/init/.modulespath | awk 'NF==1{printf("%s:",$1)}' | sed 's/:$//'` 
 }
 
 if (! defined $ENV{LOADEDMODULES} ) {
--- init/python.in
+++ init/python.in
@@ -6,7 +6,7 @@
 else:
         os.environ['MODULE_VERSION_STACK'] = os.environ['MODULE_VERSION']
 
-os.environ['MODULESHOME'] = '@prefix@'
+os.environ['MODULESHOME'] = '@prefix@/share/modules'
 
 if not os.environ.has_key('MODULEPATH'):
         os.environ['MODULEPATH'] = os.popen("""sed 's/#.*$//' ${MODULESHOME}/init/.modulespath | awk 'NF==1{printf("%s:",$1)}'""").readline()
--- init/sh.in
+++ init/sh.in
@@ -8,9 +8,9 @@
 fi
 export MODULE_VERSION_STACK
 
-module() { eval `@BASEPREFIX@$MODULE_VERSION/bin/modulecmd sh $*`; }
+module() { eval `@BASEPREFIX@/bin/modulecmd sh $*`; }
 
-MODULESHOME=@prefix@
+MODULESHOME=@prefix@/share/modules
 export MODULESHOME
 
 if [ "${LOADEDMODULES:-}" = "" ]; then
@@ -19,6 +19,6 @@
 fi
 
 if [ "${MODULEPATH:-}" = "" ]; then
-  MODULEPATH=`sed 's/#.*$//' ${MODULESHOME}/init/.modulespath | awk 'NF==1{printf("%s:",$1)}'`
+  MODULEPATH=`sed 's/#.*$//' ${MODULESHOME}/init/.modulespath | awk 'NF==1{printf("%s:",$1)}' | sed 's/:$//'`
   export MODULEPATH
 fi
--- init/tcsh.in
+++ init/tcsh.in
@@ -5,7 +5,7 @@
 	setenv MODULE_VERSION 		"@VERSION@"
 	setenv MODULE_VERSION_STACK 	"@VERSION@"
 endif
-set exec_prefix='@BASEPREFIX@$MODULE_VERSION'
+set exec_prefix='@BASEPREFIX@'
 
 if ( $?histchars ) then
   set histchar = `echo $histchars | cut -c1`
@@ -19,10 +19,10 @@
 endif
 unset exec_prefix
 
-setenv MODULESHOME @prefix@
+setenv MODULESHOME @prefix@/share/modules
 
 if (! $?MODULEPATH ) then
-  setenv MODULEPATH `sed 's/#.*$//' ${MODULESHOME}/init/.modulespath | awk 'NF==1{printf("%s:",$1)}'`
+  setenv MODULEPATH `sed 's/#.*$//' ${MODULESHOME}/init/.modulespath | awk 'NF==1{printf("%s:",$1)}' | sed 's/:$//'`
 endif
 
 if (! $?LOADEDMODULES ) then
--- init/zsh.in
+++ init/zsh.in
@@ -8,9 +8,9 @@
 fi
 export MODULE_VERSION_STACK
 
-module() { eval `@BASEPREFIX@$MODULE_VERSION/bin/modulecmd zsh $*`; }
+module() { eval `@BASEPREFIX@/bin/modulecmd zsh $*`; }
 
-MODULESHOME=@prefix@
+MODULESHOME=@prefix@/share/modules
 export MODULESHOME
 
 if [ "${LOADEDMODULES:-}" = "" ]; then
@@ -19,6 +19,6 @@
 fi
 
 if [ "${MODULEPATH:-}" = "" ]; then
-  MODULEPATH=`sed 's/#.*$//' ${MODULESHOME}/init/.modulespath | awk 'NF==1{printf("%s:",$1)}'`
+  MODULEPATH=`sed 's/#.*$//' ${MODULESHOME}/init/.modulespath | awk 'NF==1{printf("%s:",$1)}' | sed 's/:$//'`
   export MODULEPATH
 fi
--- modulefiles/Makefile.in
+++ modulefiles/Makefile.in
@@ -17,13 +17,13 @@
 INSTALL_DATA = $(INSTALL) -m 0644
 
 # Standard definition (a'la GNU)
-prefix = @prefix@
+prefix = $(DESTDIR)@prefix@
 exec_prefix = @exec_prefix@
-man_prefix = @prefix@
+man_prefix = $(DESTDIR)@mandir@
 
-# Directory in which to module files
-filedir = $(prefix)/modulefiles
-versdir = @VERSIONPATH@
+
+filedir = $(prefix)/share/modules/modulefiles
+versdir = $(prefix)/share/modules
 
 SHELL = /bin/sh
 
--- utility.c
+++ utility.c
@@ -741,6 +741,7 @@
     char		*val = NULL,	/** Stored value (is a pointer!)     **/
 			*key;		/** Tcl hash key		     **/
     int			 i;		/** Loop counter		     **/
+    int                 fd;
     char		*sourceCommand; /** Command used to source the alias **/
 
     /**
@@ -760,6 +761,12 @@
      **  The default for aliasfile, if no shell sourcing is used, is stdout.
      **/
 
+#ifdef HAVE_MKSTEMP
+    char             aliasfilename[] = "/tmp/M_od_.XXXXXX";
+    if (fd =  mkstemp(aliasfilename) < 0)
+        if( OK != ErrorLogger( ERR_OPEN, LOC, aliasfilename, "append", NULL))
+            return( TCL_ERROR);	/** -------- EXIT (FAILURE) -------> **/
+#else
 #ifdef HAVE_TEMPNAM
     char*            aliasfilename = (char *)tempnam(NULL, "M_od_");
 #else
@@ -770,6 +777,7 @@
     char*            aliasfilename = "M_od_temp";
 #endif /* not HAVE_TMPNAM */
 #endif /* not HAVE_TEMPNAM */
+#endif /* not HAVE_MKSTEMP */
 #endif /* not EVAL_ALIAS */
 
     table[0] = aliasSetHashTable;
@@ -803,9 +811,15 @@
 	 **  Open the file ...
 	 **/
 
+#ifdef HAVE_MKSTEMP
+	if( !( aliasfile = fdopen(fd, "w+"))) {
+	    if( OK != ErrorLogger( ERR_OPEN, LOC, aliasfilename, "append", NULL))
+		return( TCL_ERROR);	/** -------- EXIT (FAILURE) -------> **/
+#else
 	if( !( aliasfile = fopen((char *) aliasfilename, "w+"))) {
 	    if( OK != ErrorLogger( ERR_OPEN, LOC, aliasfilename, "append", NULL))
 		return( TCL_ERROR);	/** -------- EXIT (FAILURE) -------> **/
+#endif
 
 	} else {
 
openSUSE Build Service is sponsored by