[Libreoffice-commits] .: 5 commits - set_soenv.in
Tor Lillqvist
tml at kemper.freedesktop.org
Mon Sep 19 00:57:39 PDT 2011
set_soenv.in | 142 ++++++++++++++---------------------------------------------
1 file changed, 36 insertions(+), 106 deletions(-)
New commits:
commit 02c29d0bb25044b73dd073555ae2d908eb12e7c6
Author: Tor Lillqvist <tlillqvist at suse.com>
Date: Mon Sep 19 10:54:04 2011 +0300
Drop unused WinFormat function
diff --git a/set_soenv.in b/set_soenv.in
index 64f25d3..5ffd45f 100755
--- a/set_soenv.in
+++ b/set_soenv.in
@@ -2329,69 +2329,6 @@ sub CygFormat
return $variable;
}
#----------------------------------------------------------
-# Function name: WinFormat
-# Description: Format variables to Windows Format.
-# Arguments: 1. Variable (string)
-# Return value: Reformatted String
-#----------------------------------------------------------
-sub WinFormat
-{ my ( $variable, $d1 );
- $variable = $_[ 0 ];
- $variable =~ s/^\s+//g ; #remove leading spaces
- $variable =~ s/\s+$//g ; #remove trailing spaces
- $variable =~ s/(\$\{?\w+\}?)/$1/eeg ; # expand the variables
- $variable =~ s/(\$\{?\w+\}?)/$1/eeg ; # expand the variables twice!
- $variable =~ s/:+/:/g ; # remove multiple ;
-
- # Some variables are already in DOS path format, return early.
- if ( $variable =~ /\\/ ) {
- return $variable;
- }
- if ( $variable eq ";" ) {
- # Ignore single ';'
- return $variable;
- }
- if ( $variable =~ /;/ and $variable =~ /\// ) {
- # Mixed mode path-style entry, separated with ;, like CLASSPATH
- return $variable;
- }
-
- # Search for posix path entry and replace with cygpath -w entry
- # ( -d if filename contains space )
-
- # Normal paths
-
- # One special case is if "perl " is prepended.
- $variable =~ /^(perl\s+)?(.*)$/;
- my $perlpre = $1;
- if ( !defined($perlpre) ) {
- $perlpre = "";
- }
- $variable = $2;
-
- if ( $variable =~ /^\/[\w\.~ ]+/ ) {
- if ( $variable =~ / / ) {
- # Use DOS 8.3 style to avoid quoting
- chomp( $variable = qx{cygpath -d "$variable"} );
- } else {
- # Use "normal" filenames
- chomp( $variable = qx{cygpath -w "$variable"} );
- }
- } else {
- # relative or absolute DOS paths here
- $variable =~ s#/#\\#g;
- }
-
- $variable = $perlpre.$variable;
- if ( ($perlpre ne "") && ($^O eq "cygwin")) {
- # Cygwin's perl needs quoted backslashes
- $variable =~ s#\\#\\\\#g;
- }
-
- return $variable;
-}
-
-#----------------------------------------------------------
# Function name: WinPath
# Description: Reformat a $sep seperated path using DOS paths.
# Arguments: 1. Variable (string)
commit d6c245d87c14e8b08208e6afa12b27e8c74d381d
Author: Tor Lillqvist <tlillqvist at suse.com>
Date: Mon Sep 19 10:48:29 2011 +0300
Drop ActiveState Perl support
Why make life harder on purpose? On Cygwin, we support the Cygwin
Perl, period.
diff --git a/set_soenv.in b/set_soenv.in
index 375940e..64f25d3 100755
--- a/set_soenv.in
+++ b/set_soenv.in
@@ -1143,33 +1143,29 @@ elsif ($platform =~ m/cygwin/)
}
# Add the rest of the original path if it is still missing.
- if (($^O eq "cygwin")) { # Not for ActiveState perl
- my $expandedPATH = $PATH;
- $expandedPATH =~ s/(\$\w+)/$1/eeg;
-
- # fix situations where PATH may look like /bin:"C:\blah\bleh":/ugh
- my $fixedPATH = $oldPATH;
- if ( $oldPATH =~ /"/ ) {
- $fixedPATH = "";
- foreach my $pathentry ( split( '"',$oldPATH ) ) {
- if ( ( $pathentry =~ /^$ps/ ) || ( $pathentry =~ /$ps$/ ) ) {
- $fixedPATH .= $pathentry;
- } else {
- chomp( $pathentry = qx{cygpath -d "$pathentry"} ) ;
- chomp( $pathentry = qx{cygpath -u "$pathentry"} ) ;
- $fixedPATH .= $pathentry;
- }
- }
+ my $expandedPATH = $PATH;
+ $expandedPATH =~ s/(\$\w+)/$1/eeg;
+
+ # fix situations where PATH may look like /bin:"C:\blah\bleh":/ugh
+ my $fixedPATH = $oldPATH;
+ if ( $oldPATH =~ /"/ ) {
+ $fixedPATH = "";
+ foreach my $pathentry ( split( '"',$oldPATH ) ) {
+ if ( ( $pathentry =~ /^$ps/ ) || ( $pathentry =~ /$ps$/ ) ) {
+ $fixedPATH .= $pathentry;
+ } else {
+ chomp( $pathentry = qx{cygpath -d "$pathentry"} ) ;
+ chomp( $pathentry = qx{cygpath -u "$pathentry"} ) ;
+ $fixedPATH .= $pathentry;
}
+ }
+ }
- foreach my $pathentry (split($ps,$fixedPATH)) {
- if ( ! ( $expandedPATH =~ /(?:$ps|\A)(?:$pathentry)(?:$ps|\Z)/ ) ) {
- $PATH .= $ps.$pathentry;
- $expandedPATH .= $ps.$pathentry;
- }
+ foreach my $pathentry (split($ps,$fixedPATH)) {
+ if ( ! ( $expandedPATH =~ /(?:$ps|\A)(?:$pathentry)(?:$ps|\Z)/ ) ) {
+ $PATH .= $ps.$pathentry;
+ $expandedPATH .= $ps.$pathentry;
}
- } else {
- $PATH .= $ps.$oldPATH;
}
# The path now is in cygwin posix format
@@ -2180,6 +2176,9 @@ sub CheckPathExist
else
{ # Don't check under ActiveState Perl (Windows). The path is possibly
# posix and it cannot handle it.
+ # Hmm, but the above test also checks for existance, so presumably
+ # the mention of ActiveState in the above comment is just a red
+ # herring.
return "true";
}
}
commit 43d7604a23a0f669f6d1bb49fe8dc16f1ebfecce
Author: Tor Lillqvist <tlillqvist at suse.com>
Date: Mon Sep 19 10:36:05 2011 +0300
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.
diff --git a/set_soenv.in b/set_soenv.in
index 9261cca..375940e 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;
commit 410499bd40ab2f4fe4452e1a668bbcb37b41feac
Author: Tor Lillqvist <tlillqvist at suse.com>
Date: Mon Sep 19 10:21:24 2011 +0300
Surely /usr/bin already is in PATH on Cygwin
It would be a weird PATH otherwise. (And if that is the case,
presumably there is a good reason for it, then, and we shouldn't force
/usr/bin there.)
diff --git a/set_soenv.in b/set_soenv.in
index 5fac10f..9261cca 100755
--- a/set_soenv.in
+++ b/set_soenv.in
@@ -1127,11 +1127,6 @@ elsif ($platform =~ m/cygwin/)
{
$PATH .= $ps.$tmppath;
}
- # Check if $CYGWIN_PATH is already set in PATH
- $tmppath = CygFormat($CYGWIN_PATH);
- if ( $PATH !~ /(?:[:]|\A)(?:$tmppath)(?:[:]|\Z)/ ) {
- $PATH .= $ps.$tmppath;
- }
# makensis directory
$NSIS_PATH = PathFormat('@NSIS_PATH@');
$tmppath = CygFormat($NSIS_PATH);
commit f0d4c09228206ca67ebc660baff0ff2e0316b105
Author: Tor Lillqvist <tlillqvist at suse.com>
Date: Mon Sep 19 09:50:17 2011 +0300
Bin weird leftover from OOo's native MinGW thing
I don't see the need to explicitly prefix PATH with /usr/bin in the
generated 'bootstrap' file. Surely /usr/bin is in PATH anyway for any
sane setup, and if there are other directories in front of it in PATH,
that is then on purpose.
diff --git a/set_soenv.in b/set_soenv.in
index aad44a0..5fac10f 100755
--- a/set_soenv.in
+++ b/set_soenv.in
@@ -2124,8 +2124,6 @@ $bootfile = "bootstrap";
open( OUT, ">$bootfile" ) ||
die "Cannot open $bootfile: $!\n";
print OUT "#!/bin/sh\n";
-if ( $MINGW eq "yes" )
-{ print OUT 'PATH="/usr/bin:$PATH" : export PATH'."\n"; }
close( OUT ) || print "Can't close $bootfile: $!";
system(`cat bootstrap.1 >> bootstrap`);
system(`chmod +x bootstrap`);
More information about the Libreoffice-commits
mailing list