Browse Source

Fix where PERL5LIB is blank

git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1936 f882894a-f735-0410-b71e-b25c423dba1c
Ton Voon 18 years ago
parent
commit
f00e6a9676
1 changed files with 3 additions and 1 deletions
  1. 3 1
      tools/build_perl_modules

+ 3 - 1
tools/build_perl_modules

@@ -74,7 +74,9 @@ foreach my $tarball (@tarballs) {
 	chdir $dir or die "Can't chdir into $dir";
 	chdir $dir or die "Can't chdir into $dir";
 
 
 	# Need to add this so this module is found for subsequent ones
 	# Need to add this so this module is found for subsequent ones
-	$ENV{PERL5LIB}="$topdir/$dir/blib/lib:$ENV{PERL5LIB}";
+	my @dirs = split(":", $ENV{PERL5LIB} || "");
+	unshift @dirs, "$topdir/$dir/blib/lib";
+	$ENV{PERL5LIB}=join(":", @dirs);
 
 
 	if ($opts->{t}) {
 	if ($opts->{t}) {
 		system("make test") == 0 or die "Can't run make test failed";
 		system("make test") == 0 or die "Can't run make test failed";