diff options
author | Hans-Joachim Lankenau <hjs@openoffice.org> | 2010-01-12 13:31:15 +0100 |
---|---|---|
committer | Hans-Joachim Lankenau <hjs@openoffice.org> | 2010-01-12 13:31:15 +0100 |
commit | b84e7328695132c1fd12c3911453fb508625b21c (patch) | |
tree | ffb190234ee103a9a556ceb0574bdf872324863d /solenv/bin/deliver.pl | |
parent | 0fc304b08af65547b9e3226e72881b2f4a955ac1 (diff) |
aus112: #i108254# deal with cygwin .exe magic which changed in cygwin 1.7
Diffstat (limited to 'solenv/bin/deliver.pl')
-rwxr-xr-x | solenv/bin/deliver.pl | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/solenv/bin/deliver.pl b/solenv/bin/deliver.pl index 0d6c8b27afa4..c31d211ec903 100755 --- a/solenv/bin/deliver.pl +++ b/solenv/bin/deliver.pl @@ -113,7 +113,15 @@ $delete_common = 1; # for "-delete": if defined delete files fro if ($^O ne 'cygwin') { # iz59477 - cygwin needes a dot "." at the end of filenames to disable $maybedot = ''; # some .exe transformation magic. } else { - $maybedot = '.'; + my $cygvernum = `uname -r`; + my @cygvernum = split( /\./, $cygvernum); + $cygvernum = shift @cygvernum; + $cygvernum .= shift @cygvernum; + if ( $cygvernum lt 17 ) { + $maybedot = '.'; + } else { + $maybedot = ''; # no longer works with cygwin 1.7. other magic below. + } } ($gui = lc($ENV{GUI})) || die "Can't determine 'GUI'. Please set environment.\n"; @@ -832,6 +840,11 @@ sub copy_if_newer sleep $try; $try ++; $success = rename($temp_file, $to); + if ( $^O eq 'cygwin' && $to =~ /\.bin$/) { + # hack to survive automatically added .exe for executables renamed to + # *.bin - will break if there is intentionally a .bin _and_ .bin.exe file. + $success = rename( "$to.exe", $to ) if -f "$to.exe"; + } } if ( $success ) { # handle special packaging of *.dylib files for Mac OS X |