summaryrefslogtreecommitdiff
path: root/Master/tlpkg/installer/install-menu-text.pl
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2009-07-10 10:48:59 +0000
committerNorbert Preining <preining@logic.at>2009-07-10 10:48:59 +0000
commit146a631f5b1c0dc54d4e5b472123efde5b2c9ebd (patch)
treeba728553f2ebf1e6d831b8f4ba212d287177798c /Master/tlpkg/installer/install-menu-text.pl
parent5de7f6e936f10ab5bac1a835f8263df31511c8a9 (diff)
do not expand ~ when asked for TEXMFHOME
git-svn-id: svn://tug.org/texlive/trunk@14219 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/installer/install-menu-text.pl')
-rwxr-xr-xMaster/tlpkg/installer/install-menu-text.pl23
1 files changed, 14 insertions, 9 deletions
diff --git a/Master/tlpkg/installer/install-menu-text.pl b/Master/tlpkg/installer/install-menu-text.pl
index 7a3823831ba..b43077c3e65 100755
--- a/Master/tlpkg/installer/install-menu-text.pl
+++ b/Master/tlpkg/installer/install-menu-text.pl
@@ -530,7 +530,7 @@ EOF
} elsif ("\u$answer" eq '5') {
print "New value for TEXMFHOME [$vars{'TEXMFHOME'}]: ";
- $answer = &input_dirname ();
+ $answer = &input_dirname (1);
$vars{'TEXMFHOME'} = $answer if $answer ne "";
return $command{'self'};
}
@@ -548,20 +548,25 @@ EOF
#
sub input_dirname
{
+ my $noexpansion = shift;
chomp (my $answer = <STDIN>);
return "" if $answer eq "";
$answer =~ s!\\!/!g if win32(); # switch to forward slashes
- my $home = getenv('HOME');
- $home = getenv('USERPROFILE') if win32();
- $home ||= '~';
- $answer =~ s/^~/$home/; # $home expansion
+ if (!$noexpansion) {
+ my $home = getenv('HOME');
+ $home = getenv('USERPROFILE') if win32();
+ $home ||= '~';
+ $answer =~ s/^~/$home/; # $home expansion
+ }
- # relative paths are unlikely to work in texmf.cnf, et al.,
- # and don't have any apparent practical use. Convert to absolute.
- if (! File::Spec->file_name_is_absolute($answer)) {
- $answer = Cwd::abs_path($answer);
+ if ($answer !~ m/^~/) {
+ # relative paths are unlikely to work in texmf.cnf, et al.,
+ # and don't have any apparent practical use. Convert to absolute.
+ if (! File::Spec->file_name_is_absolute($answer)) {
+ $answer = Cwd::abs_path($answer);
+ }
}
return $answer;
}