Kaydet (Commit) ebef1822 authored tarafından Christian Lohmaier's avatar Christian Lohmaier Kaydeden (comit) David Tardon

don't override TMPDIR with /tmp on cygwin, cleanup TMPDIR/TMP handling

on cygwin, configure forced TMPDIR to /tmp, regardless whether it is set
or not. And while it respects an existing value of TMP, TMP is only used
in a few places. Changes the ones that explicitly check for TMP to
prefer TMPDIR, and don't duplicate configure's check in other scripts.

Change-Id: Ia8ac3f8d92e5f971c5237b85f66f7c0a58932930
Reviewed-on: https://gerrit.libreoffice.org/3701Reviewed-by: 's avatarDavid Tardon <dtardon@redhat.com>
Tested-by: 's avatarDavid Tardon <dtardon@redhat.com>
üst 0a20a9c0
......@@ -534,7 +534,6 @@ export TELEPATHY_CFLAGS=$(gb_SPACE)@TELEPATHY_CFLAGS@
export TELEPATHY_LIBS=$(gb_SPACE)@TELEPATHY_LIBS@
export THES_SYSTEM_DIR=@THES_SYSTEM_DIR@
export TLS=@TLS@
@x_Cygwin@ export TMP=@TMP_DIRECTORY@
export TMPDIR=@TEMP_DIRECTORY@
export TYPO_EXTENSION_PACK=@TYPO_EXTENSION_PACK@
export UNIXWRAPPERNAME=@UNIXWRAPPERNAME@
......
......@@ -11839,22 +11839,15 @@ PathFormat "$PERL"
PERL="$formatted_path"
AC_SUBST(PERL)
if test "$build_os" = "cygwin"; then
TEMP_DIRECTORY=`cygpath -m "/tmp"`
if test -n "$TMP"; then
TMP_DIRECTORY="$TMP"
else
TMP_DIRECTORY="$TEMP_DIRECTORY"
fi
if test -n "$TMPDIR"; then
TEMP_DIRECTORY="$TMPDIR"
else
if test -n "$TMPDIR"; then
TEMP_DIRECTORY="$TMPDIR"
else
TEMP_DIRECTORY="/tmp"
fi
TEMP_DIRECTORY="/tmp"
fi
if test "$build_os" = "cygwin"; then
TEMP_DIRECTORY=`cygpath -m "$TEMP_DIRECTORY"`
fi
AC_SUBST(TEMP_DIRECTORY)
AC_SUBST(TMP_DIRECTORY)
# setup the PATH for the environment
if test -n "$LO_PATH_FOR_BUILD"; then
......
......@@ -366,11 +366,9 @@ sub setglobalvariables
# setting and creating the temppath
if (( $ENV{'TMP'} ) || ( $ENV{'TEMP'} ) || ( $ENV{'TMPDIR'} ))
if ( $ENV{'TMPDIR'} )
{
if ( $ENV{'TMP'} ) { $installer::globals::temppath = $ENV{'TMP'}; }
elsif ( $ENV{'TEMP'} ) { $installer::globals::temppath = $ENV{'TEMP'}; }
elsif ( $ENV{'TMPDIR'} ) { $installer::globals::temppath = $ENV{'TMPDIR'}; }
$installer::globals::temppath = $ENV{'TMPDIR'};
$installer::globals::temppath =~ s/\Q$installer::globals::separator\E\s*$//; # removing ending slashes and backslashes
$installer::globals::temppath .= $installer::globals::separator . 'ooopackaging';
installer::systemactions::create_directory_with_privileges($installer::globals::temppath, "777");
......
......@@ -684,7 +684,6 @@ sub create_transforms
$infoline = "ERROR: We cannot create transformations yet (we cannot use cscript.exe when cross-compiling)\n";
push( @installer::globals::logfileinfo, $infoline);
}
my $tmpdir = $ENV{TMPDIR}; # Variable %TEMP% will be set to it for WiLangId.vbs to work
my $wilangid = $ENV{WINDOWS_SDK_HOME} . "/Samples/SysMgmt/Msi/scripts/WiLangId.vbs";
my $from = cwd();
......@@ -837,7 +836,7 @@ sub create_transforms
}
}
$systemcall = "TEMP=" . $tmpdir . " " . $cscript . " " . $wilangid . " " . $basedbname . " Package " . $templatevalue;
$systemcall = "TEMP=$ENV{'TMPDIR'} $cscript $wilangid $basedbname Package $templatevalue";
$returnvalue = system($systemcall);
......@@ -1225,11 +1224,6 @@ sub execute_packaging
$infoline = "chdir: $to \n";
push( @installer::globals::logfileinfo, $infoline);
# changing the tmp directory, because makecab.exe generates temporary cab files
my $origtemppath = "";
if ( $ENV{'TMP'} ) { $origtemppath = $ENV{'TMP'}; }
$ENV{'TMP'} = $installer::globals::temppath; # setting TMP to the new unique directory!
my $maxmakecabcalls = 3;
my $allmakecabcalls = $#{$localpackjobref} + 1;
......@@ -1293,9 +1287,6 @@ sub execute_packaging
installer::logger::include_timestamp_into_logfile("Performance Info: Execute packaging end");
# setting back to the original tmp directory
$ENV{'TMP'} = $origtemppath;
chdir($from);
$infoline = "chdir: $from \n";
push( @installer::globals::logfileinfo, $infoline);
......
......@@ -33,12 +33,8 @@ if ($ENV{OS} eq 'WNT') {
if (defined($ENV{TMPDIR})) {
$tmp_dir = $ENV{TMPDIR};
} elsif (defined($ENV{TMP})) {
$tmp_dir = $ENV{TMP};
} else {
$tmp_dir = '/tmp';
}
if (!-d $tmp_dir) {die "Set TMP or TMPDIR!\n";}
if (!-d $tmp_dir) {die "Set TMPDIR!\n";}
# Workaround for system Mozilla
if ($ENV{'SYSTEM_MOZILLA'} eq 'YES') {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment