~ubuntu-branches/ubuntu/utopic/modules/utopic-proposed

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
@VERSIONING@if (! defined $ENV{MODULE_VERSION} ) {
@VERSIONING@	$ENV{"MODULE_VERSION_STACK"}="@VERSION@";
@VERSIONING@	$ENV{"MODULE_VERSION"}="@VERSION@";
@VERSIONING@} else {
@VERSIONING@	$ENV{"MODULE_VERSION_STACK"}=$ENV{"MODULE_VERSION"};
@VERSIONING@}

sub module {
	local ($exec_prefix);
@VERSIONING@	$exec_prefix = "/usr/share/modules/".$ENV{"MODULE_VERSION"};
@VERSIONING@	eval `$exec_prefix/bin/modulecmd perl @_`;

@NOTVERSIONING@	$exec_prefix = "/usr/bin";
@NOTVERSIONING@	eval `$exec_prefix/modulecmd perl @_`;
}

$ENV{"MODULESHOME"} = "/usr/share/modules";

if (! defined $ENV{"MODULEPATH"} ) {
	open(IN, "$ENV{'MODULESHOME'}/init/.modulespath") || die "cannot open '.modulespath' file: $!\n";
	$ENV{"MODULEPATH"} = join(":", grep(/\S/, map { s/^\s*//g; s/[\s#].*$//g; $_ } <IN>));
	close IN;
}

if (! defined $ENV{"LOADEDMODULES"} ) {
	$ENV{"LOADEDMODULES"} = "";
}

1;