environment.pm (9780544f) environment.pm (b274bc22)
1#**************************************************************
2#
3# Licensed to the Apache Software Foundation (ASF) under one
4# or more contributor license agreements. See the NOTICE file
5# distributed with this work for additional information
6# regarding copyright ownership. The ASF licenses this file
7# to you under the Apache License, Version 2.0 (the
8# "License"); you may not use this file except in compliance

--- 69 unchanged lines hidden (view full) ---

78
79sub check_tilde_in_directory
80{
81 if ( $ENV{'HOME'} )
82 {
83 my $home = $ENV{'HOME'};
84 $home =~ s/\Q$installer::globals::separator\E\s*$//;
85 $installer::globals::localinstalldir =~ s/~/$home/;
1#**************************************************************
2#
3# Licensed to the Apache Software Foundation (ASF) under one
4# or more contributor license agreements. See the NOTICE file
5# distributed with this work for additional information
6# regarding copyright ownership. The ASF licenses this file
7# to you under the Apache License, Version 2.0 (the
8# "License"); you may not use this file except in compliance

--- 69 unchanged lines hidden (view full) ---

78
79sub check_tilde_in_directory
80{
81 if ( $ENV{'HOME'} )
82 {
83 my $home = $ENV{'HOME'};
84 $home =~ s/\Q$installer::globals::separator\E\s*$//;
85 $installer::globals::localinstalldir =~ s/~/$home/;
86 my $infoline = "Info: Changing LOCALINSTALLDIR to $installer::globals::localinstalldir\n";
87 push(@installer::globals::logfileinfo, $infoline);
86 $installer::logger::Lang->printf("Info: Changing LOCALINSTALLDIR to %s\n", $installer::globals::localinstalldir);
88 }
89 else
90 {
87 }
88 else
89 {
91 # exit, because "~" is not allowed, if HOME is not set
92 my $infoline = "ERROR: If \"~\" is used in \"LOCALINSTALLDIR\", environment variable \"HOME\" needs to be defined!\n";
93 push(@installer::globals::logfileinfo, $infoline);
90 # exit, because "~" is not allowed, if HOME is not set
91 $installer::logger::Lang->printf("ERROR: If \"~\" is used in \"LOCALINSTALLDIR\", environment variable \"HOME\" needs to be defined!\n");
94 installer::exiter::exit_program("ERROR: If \"~\" is used in \"LOCALINSTALLDIR\", environment variable \"HOME\" needs to be defined!", "check_tilde_in_directory");
95 }
96}
97
98##################################################
99# Setting some fundamental global variables.
100# All these variables can be overwritten
101# by parameters.

--- 34 unchanged lines hidden ---
92 installer::exiter::exit_program("ERROR: If \"~\" is used in \"LOCALINSTALLDIR\", environment variable \"HOME\" needs to be defined!", "check_tilde_in_directory");
93 }
94}
95
96##################################################
97# Setting some fundamental global variables.
98# All these variables can be overwritten
99# by parameters.

--- 34 unchanged lines hidden ---