@@ -319,6 +319,7 @@ def test_make_module_req(self):
319319 open (os .path .join (eb .installdir , 'bla.jar' ), 'w' ).write ('bla.jar' )
320320 os .mkdir (os .path .join (eb .installdir , 'bin' ))
321321 os .mkdir (os .path .join (eb .installdir , 'bin' , 'testdir' ))
322+ os .mkdir (os .path .join (eb .installdir , 'sbin' ))
322323 os .mkdir (os .path .join (eb .installdir , 'share' ))
323324 os .mkdir (os .path .join (eb .installdir , 'share' , 'man' ))
324325 # this is not a path that should be picked up
@@ -330,13 +331,19 @@ def test_make_module_req(self):
330331 self .assertTrue (re .search (r"^prepend-path\s+CLASSPATH\s+\$root/bla.jar$" , guess , re .M ))
331332 self .assertTrue (re .search (r"^prepend-path\s+CLASSPATH\s+\$root/foo.jar$" , guess , re .M ))
332333 self .assertTrue (re .search (r"^prepend-path\s+MANPATH\s+\$root/share/man$" , guess , re .M ))
334+ # bin/ is not added to $PATH if it doesn't include files
333335 self .assertFalse (re .search (r"^prepend-path\s+PATH\s+\$root/bin$" , guess , re .M ))
336+ self .assertFalse (re .search (r"^prepend-path\s+PATH\s+\$root/sbin$" , guess , re .M ))
337+ # no include/ subdirectory, so no $CPATH update statement
334338 self .assertFalse (re .search (r"^prepend-path\s+CPATH\s+.*$" , guess , re .M ))
335339 elif get_module_syntax () == 'Lua' :
336340 self .assertTrue (re .search (r'^prepend_path\("CLASSPATH", pathJoin\(root, "bla.jar"\)\)$' , guess , re .M ))
337341 self .assertTrue (re .search (r'^prepend_path\("CLASSPATH", pathJoin\(root, "foo.jar"\)\)$' , guess , re .M ))
338342 self .assertTrue (re .search (r'^prepend_path\("MANPATH", pathJoin\(root, "share/man"\)\)$' , guess , re .M ))
343+ # bin/ is not added to $PATH if it doesn't include files
339344 self .assertFalse (re .search (r'^prepend_path\("PATH", pathJoin\(root, "bin"\)\)$' , guess , re .M ))
345+ self .assertFalse (re .search (r'^prepend_path\("PATH", pathJoin\(root, "sbin"\)\)$' , guess , re .M ))
346+ # no include/ subdirectory, so no $CPATH update statement
340347 self .assertFalse (re .search (r'^prepend_path\("CPATH", .*\)$' , guess , re .M ))
341348 else :
342349 self .assertTrue (False , "Unknown module syntax: %s" % get_module_syntax ())
@@ -346,8 +353,10 @@ def test_make_module_req(self):
346353 guess = eb .make_module_req ()
347354 if get_module_syntax () == 'Tcl' :
348355 self .assertTrue (re .search (r"^prepend-path\s+PATH\s+\$root/bin$" , guess , re .M ))
356+ self .assertFalse (re .search (r"^prepend-path\s+PATH\s+\$root/sbin$" , guess , re .M ))
349357 elif get_module_syntax () == 'Lua' :
350358 self .assertTrue (re .search (r'^prepend_path\("PATH", pathJoin\(root, "bin"\)\)$' , guess , re .M ))
359+ self .assertFalse (re .search (r'^prepend_path\("PATH", pathJoin\(root, "sbin"\)\)$' , guess , re .M ))
351360 else :
352361 self .assertTrue (False , "Unknown module syntax: %s" % get_module_syntax ())
353362
0 commit comments