Prepend to PATH, not append

This commit is contained in:
Andrew Johnson
2017-01-16 10:46:56 -06:00
parent 49e0e23f76
commit 7310d78057

View File

@@ -5,7 +5,7 @@
# Copyright (c) 2002 The Regents of the University of California, as
# Operator of Los Alamos National Laboratory.
# EPICS BASE is distributed subject to a Software License Agreement found
# in file LICENSE that is included with this distribution.
# in file LICENSE that is included with this distribution.
#*************************************************************************
#
# Convert configure/RELEASE file(s) into something else.
@@ -119,15 +119,15 @@ sub dllPath {
unlink $outfile;
open(OUT, ">$outfile") or die "$! creating $outfile";
print OUT "\@ECHO OFF\n";
print OUT "PATH \%PATH\%;", join(';', binDirs()), "\n";
print OUT "PATH ", join(';', binDirs(), '%PATH%'), "\n";
close OUT;
}
sub relPaths {
unlink $outfile;
open(OUT, ">$outfile") or die "$! creating $outfile";
print OUT "export PATH=\$PATH:",
join(':', map {m/\s/ ? "\"$_\"" : $_ } binDirs()), "\n";
print OUT "export PATH=",
join(':', map {m/\s/ ? "\"$_\"" : $_ } binDirs(), '$PATH'), "\n";
close OUT;
}
@@ -150,22 +150,22 @@ sub binDirs {
sub cdCommands {
die "Architecture not set (use -a option)" unless ($arch);
my @includes = grep !m/^(RULES | TEMPLATE_TOP)$/x, @apps;
unlink($outfile);
open(OUT,">$outfile") or die "$! creating $outfile";
my $startup = $cwd;
$startup =~ s/^$root/$iocroot/o if ($opt_t);
$startup =~ s/([\\"])/\\\1/g; # escape back-slashes and double-quotes
print OUT "startup = \"$startup\"\n";
my $ioc = $cwd;
$ioc =~ s/^.*\///; # iocname is last component of directory name
print OUT "putenv(\"ARCH=$arch\")\n";
print OUT "putenv(\"IOC=$ioc\")\n";
foreach my $app (@includes) {
my $iocpath = my $path = $macros{$app};
$iocpath =~ s/^$root/$iocroot/o if ($opt_t);
@@ -188,16 +188,16 @@ sub cdCommands {
sub envPaths {
die "Architecture not set (use -a option)" unless ($arch);
my @includes = grep !m/^ (RULES | TEMPLATE_TOP) $/x, @apps;
unlink($outfile);
open(OUT,">$outfile") or die "$! creating $outfile";
my $ioc = $cwd;
$ioc =~ s/^.*\///; # iocname is last component of directory name
print OUT "epicsEnvSet(\"ARCH\",\"$arch\")\n";
print OUT "epicsEnvSet(\"IOC\",\"$ioc\")\n";
foreach my $app (@includes) {
my $iocpath = my $path = $macros{$app};
$iocpath =~ s/^$root/$iocroot/o if ($opt_t);
@@ -224,7 +224,7 @@ sub checkRelease {
expandRelease(\%check, \@order);
delete $check{TOP};
delete $check{EPICS_HOST_ARCH};
while (my ($parent, $ppath) = each %check) {
if (exists $macros{$parent} &&
AbsPath($macros{$parent}) ne AbsPath($ppath)) {
@@ -269,4 +269,3 @@ sub checkRelease {
print "\n" if $status;
exit $status;
}