summaryrefslogtreecommitdiff
path: root/set_soenv.in
diff options
context:
space:
mode:
authorTor Lillqvist <tlillqvist@suse.com>2011-09-19 10:36:05 +0300
committerTor Lillqvist <tlillqvist@suse.com>2011-09-19 10:41:45 +0300
commit43d7604a23a0f669f6d1bb49fe8dc16f1ebfecce (patch)
tree616eafcec3258fc40629f0f08988547357084496 /set_soenv.in
parent410499bd40ab2f4fe4452e1a668bbcb37b41feac (diff)
Avoid reordering elements already in PATH for Cygwin
For instance: If we have /opt/lo/bin in PATH already in front of /usr/bin, we don't want to put /usr/bin in front of it again.
Diffstat (limited to 'set_soenv.in')
-rwxr-xr-xset_soenv.in25
1 files changed, 13 insertions, 12 deletions
diff --git a/set_soenv.in b/set_soenv.in
index 9261ccaf6f35..375940e48a28 100755
--- a/set_soenv.in
+++ b/set_soenv.in
@@ -1092,26 +1092,28 @@ elsif ($platform =~ m/cygwin/)
$tmppath = CygFormat($COMPATH).$BIN;
$tmppath .= $ds."amd64" if $CL_X64;
$tmppath =~ s/^\/\//\//;
- $PATH .= $ps.$tmppath;
+ if ( "$PATH:$oldPATH" !~ /(?:[:]|\A)(?:$tmppath)(?:[:]|\Z)/ ) {
+ $PATH .= $ps.$tmppath;
+ }
$tmppath = CygFormat($MSPDB_PATH);
- # for MSVC to find mspdb71.dll
- if ( $PATH !~ /(?:[:]|\A)(?:$tmppath)(?:[:]|\Z)/ ) {
+ # for MSVC to find mspdb*.dll
+ if ( "$PATH:$oldPATH" !~ /(?:[:]|\A)(?:$tmppath)(?:[:]|\Z)/ ) {
$PATH .= $ps.$tmppath;
}
# need midl.exe
$tmppath = CygFormat($MIDL_PATH);
- if ( $PATH !~ /(?:[:]|\A)(?:$tmppath)(?:[:]|\Z)/ ) {
+ if ( "$PATH:$oldPATH" !~ /(?:[:]|\A)(?:$tmppath)(?:[:]|\Z)/ ) {
$PATH .= $ps.$tmppath;
}
# needs csc.exe
$tmppath = CygFormat($CSC_PATH);
- if ( $PATH !~ /(?:[:]|\A)(?:$tmppath)(?:[:]|\Z)/ ) {
+ if ( "$PATH:$oldPATH" !~ /(?:[:]|\A)(?:$tmppath)(?:[:]|\Z)/ ) {
$PATH .= $ps.$tmppath;
}
# Installer needs some files if the Windows Installer SDK
$tmppath = CygFormat($WINDOWS_SDK_HOME);
- if ( $PATH !~ /(?:[:]|\A)(?:$tmppath\/bin)(?:[:]|\Z)/i ) {
+ if ( "$PATH:$oldPATH" !~ /(?:[:]|\A)(?:$tmppath\/bin)(?:[:]|\Z)/i ) {
$PATH .= $ps.$tmppath.$BIN;
}
@@ -1119,28 +1121,27 @@ elsif ($platform =~ m/cygwin/)
{ $PATH .= $ps.CygFormat($ASM_PATH);
}
- # Possible cygwin paths must follow behind the OOo and MS paths
+ # Possible cygwin paths must follow behind the OOo and MS paths.
+ # What the above comment means I have no idea.
# Check if $PERL_PATH is already set in PATH
$tmppath = CygFormat($PERL_PATH);
- if ( ! ( $PATH =~ /(?:[:]|\A)(?:$tmppath)(?:[:]|\Z)/ ) )
- {
+ if ( "$PATH:$oldPATH" !~ /(?:[:]|\A)(?:$tmppath)(?:[:]|\Z)/ ) {
$PATH .= $ps.$tmppath;
}
# makensis directory
$NSIS_PATH = PathFormat('@NSIS_PATH@');
$tmppath = CygFormat($NSIS_PATH);
- if ( $PATH !~ /(?:[:]|\A)(?:$tmppath)(?:[:]|\Z)/ ) {
+ if ( "$PATH:$oldPATH" !~ /(?:[:]|\A)(?:$tmppath)(?:[:]|\Z)/ ) {
$PATH .= $ps.$tmppath;
}
# path to sn.exe (signing) for Windows users.
my $sn_path = PathFormat('@DOTNET_FRAMEWORK_HOME@/bin');
$tmppath = CygFormat($sn_path);
- if ( $PATH !~ /(?:[:]|\A)(?:$tmppath)(?:[:]|\Z)/ ) {
+ if ( "$PATH:$oldPATH" !~ /(?:[:]|\A)(?:$tmppath)(?:[:]|\Z)/ ) {
$PATH .= $ps.$tmppath;
}
-
# Add the rest of the original path if it is still missing.
if (($^O eq "cygwin")) { # Not for ActiveState perl
my $expandedPATH = $PATH;