summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2021-05-21 14:11:47 +0900
committerNorbert Preining <norbert@preining.info>2022-06-10 23:11:40 +0900
commit18d19f08528af16cc09f82ccda7f38d57585c3a8 (patch)
tree63e1bf38e02fadc2b7a3b7fee2324f985aca6772
parente90782a615eb546cae7930e198e276837f370e9c (diff)
Rename Windows detection macros.
-rwxr-xr-xMaster/install-tl61
-rwxr-xr-xMaster/texmf-dist/scripts/texlive/fmtutil.pl34
-rwxr-xr-xMaster/texmf-dist/scripts/texlive/tlmgr.pl57
-rwxr-xr-xMaster/texmf-dist/scripts/texlive/tlmgrgui.pl18
-rwxr-xr-xMaster/texmf-dist/scripts/texlive/uninstall-win32.pl3
-rwxr-xr-xMaster/texmf-dist/scripts/texlive/updmap.pl16
-rw-r--r--Master/tlpkg/TeXLive/TLCrypto.pm6
-rw-r--r--Master/tlpkg/TeXLive/TLPDB.pm8
-rw-r--r--Master/tlpkg/TeXLive/TLPOBJ.pm2
-rw-r--r--Master/tlpkg/TeXLive/TLUtils.pm110
-rw-r--r--Master/tlpkg/installer/install-menu-extl.pl2
-rw-r--r--Master/tlpkg/installer/install-menu-text.pl32
12 files changed, 192 insertions, 157 deletions
diff --git a/Master/install-tl b/Master/install-tl
index 862858c75fa..17359c88820 100755
--- a/Master/install-tl
+++ b/Master/install-tl
@@ -145,7 +145,7 @@ use Pod::Usage;
use POSIX ();
use TeXLive::TLUtils qw(platform platform_desc sort_archs
- which getenv win32 unix info log debug tlwarn ddebug tldie
+ which getenv wndws tl_w32 tl_w64 unix info log debug tlwarn ddebug tldie
member process_logging_options rmtree wsystem
mkdirhier make_var_skeleton make_local_skeleton install_package copy
install_packages dirname setup_programs native_slashify forward_slashify);
@@ -163,7 +163,7 @@ eval {
debug("Encode::Locale is loaded.\n");
};
if ($@) {
- if (win32) {
+ if (wndws()) {
die ("For Windows, Encode::Locale is required.\n");
}
@@ -177,7 +177,7 @@ binmode (STDIN, ':encoding(console_in)');
binmode (STDOUT, ':encoding(console_out)');
binmode (STDERR, ':encoding(console_out)');
-if (win32) {
+if (wndws()) {
require TeXLive::TLWinGoo;
TeXLive::TLWinGoo->import( qw(
&admin
@@ -342,7 +342,7 @@ if ((defined $ARGV[0]) && $ARGV[0] eq "-from_ext_gui") {
$| = 1;
# windows: suppress console windows when invoking other programs
- Win32::SetChildShowWindow(0) if win32();
+ Win32::SetChildShowWindow(0) if wndws();
}
# if we find a file installation.profile we ask the user whether we should
@@ -406,7 +406,7 @@ if ($opt_help) {
# theoretically we could make a subroutine with all the same
# painful checks as we do in tlmgr, but let's not bother until people ask.
my @noperldoc = ();
- if (win32() || $ENV{"NOPERLDOC"}) {
+ if (wndws() || $ENV{"NOPERLDOC"}) {
@noperldoc = ("-noperldoc", "1");
}
@@ -446,7 +446,7 @@ if ($opt_version) {
print "\nTLPOBJ: " . TeXLive::TLPOBJ->module_revision();
print "\nTLTREE: " . TeXLive::TLTREE->module_revision();
print "\nTLUtils: " . TeXLive::TLUtils->module_revision();
- print "\nTLWinGoo: " . TeXLive::TLWinGoo->module_revision() if win32();
+ print "\nTLWinGoo: " . TeXLive::TLWinGoo->module_revision() if wndws();
print "\n";
}
exit 0;
@@ -490,7 +490,7 @@ if ($opt_profile) { # not allowed if in_place
}
}
-if ($opt_nonadmin and win32()) {
+if ($opt_nonadmin and wndws()) {
non_admin();
}
@@ -888,7 +888,7 @@ sub final_remote_init {
}
$opt_scheme = "" if $opt_in_place;
$vars{'instopt_portable'} = $opt_portable;
- $vars{'instopt_adjustpath'} = 1 if win32();
+ $vars{'instopt_adjustpath'} = 1 if wndws();
log("Installer revision: $::installerrevision\n");
log("Database revision: " . $tlpdb->config_revision . "\n");
@@ -921,7 +921,7 @@ sub final_remote_init {
sub do_installation {
- if (win32()) {
+ if (wndws()) {
non_admin() if !$vars{'tlpdbopt_w32_multi_user'};
}
if ($vars{'instopt_portable'}) {
@@ -938,7 +938,7 @@ sub do_installation {
# making the root read-only automatically locks everything below it.
# do TEXDIR now, before it loses its final slash
mkdirhier "$vars{'TEXDIR'}";
- if (win32()) {
+ if (wndws()) {
TeXLive::TLWinGoo::maybe_make_ro ($vars{'TEXDIR'});
}
# check for free disk space
@@ -961,7 +961,7 @@ sub do_installation {
my $oldlocal = -d $vars{'TEXMFLOCAL'};
make_local_skeleton "$vars{'TEXMFLOCAL'}";
mkdirhier "$vars{'TEXMFSYSCONFIG'}";
- if (win32()) {
+ if (wndws()) {
TeXLive::TLWinGoo::maybe_make_ro ($vars{'TEXMFSYSVAR'});
TeXLive::TLWinGoo::maybe_make_ro ($vars{'TEXMFLOCAL'}) unless $oldlocal;
TeXLive::TLWinGoo::maybe_make_ro ($vars{'TEXMFSYSCONFIG'});
@@ -1129,16 +1129,16 @@ operations might be disturbed.\n\n";
# Step 2: Setup the PATH, switch to the new Perl
- my $pathsep = (win32)? ';' : ':';
+ my $pathsep = (wndws())? ';' : ':';
my $plat_bindir = "$TEXDIR/bin/$vars{'this_platform'}";
my $perl_bindir = "$TEXDIR/tlpkg/tlperl/bin";
my $perl_libdir = "$TEXDIR/tlpkg/tlperl/lib";
- my $progext = (win32)? '.exe' : '';
+ my $progext = (wndws())? '.exe' : '';
debug("Prepending $plat_bindir to PATH\n");
$ENV{'PATH'} = $plat_bindir . $pathsep . $ENV{'PATH'};
- if (win32) {
+ if (wndws()) {
debug("Prepending $perl_bindir to PATH\n");
$ENV{'PATH'} = "$perl_bindir" . "$pathsep" . "$ENV{'PATH'}";
$ENV{'PATH'} =~ s!/!\\!g;
@@ -1149,7 +1149,7 @@ operations might be disturbed.\n\n";
debug(" $dir\n");
}
debug("\n");
- if (win32) {
+ if (wndws()) {
$ENV{'PERL5LIB'} = $perl_libdir;
}
@@ -1159,7 +1159,7 @@ operations might be disturbed.\n\n";
my $usedtlpdb = $opt_in_place ? $tlpdb : $localtlpdb;
- if (win32()) {
+ if (wndws()) {
debug("Actual environment:\n" . `set` ."\n\n");
debug("Effective TEXMFCNF: " . `kpsewhich -expand-path=\$TEXMFCNF` ."\n");
}
@@ -1237,7 +1237,7 @@ operations might be disturbed.\n\n";
}
# option settings in launcher.ini
- if (win32() && !$vars{'instopt_portable'}) {
+ if (wndws() && !$vars{'instopt_portable'}) {
if ($vars{'tlpdbopt_file_assocs'} != 1 || !$vars{'instopt_adjustpath'}) {
# create higher priority tlaunch.ini with adjusted settings
# whether or not launcher mode (desktop integration 2)
@@ -1249,7 +1249,7 @@ operations might be disturbed.\n\n";
# now rerun mktexlsr for updmap-sys and tlmgr paper letter updates.
wsystem("re-running", "mktexlsr", $TEXMFSYSVAR, $TEXMFSYSCONFIG) && exit(1);
- if (win32() and !$vars{'instopt_portable'} and !$opt_in_place) {
+ if (wndws() and !$vars{'instopt_portable'} and !$opt_in_place) {
if ($vars{'tlpdbopt_desktop_integration'} != 2) {
create_uninstaller($vars{'TEXDIR'});
} else {
@@ -1327,7 +1327,7 @@ sub do_tlpdb_postactions {
}
}
# windows: alert the system about changed file associations
- if (win32) { TeXLive::TLWinGoo::update_assocs(); }
+ if (wndws()) { TeXLive::TLWinGoo::update_assocs(); }
info ("finished with package-specific postactions\n");
return $ret;
} # do_tlpdb_postactions
@@ -1372,8 +1372,9 @@ sub rewrite_tlaunch_ini {
sub do_path_adjustments {
my $ret = 0;
info ("running path adjustment actions\n");
- if (win32()) {
- TeXLive::TLUtils::w32_add_to_path($vars{'TEXDIR'}.'/bin/win32',
+ if (wndws()) {
+ my $subpath = tl_w32() ? "win32" : "win64";
+ TeXLive::TLUtils::w32_add_to_path($vars{'TEXDIR'} . $subpath,
$vars{'tlpdbopt_w32_multi_user'});
broadcast_env();
} else {
@@ -1432,7 +1433,7 @@ sub do_texmf_cnf {
push @changedtmf, "TEXMFHOME = $vars{'TEXMFHOME'}\n";
}
} elsif ($line =~ m/^OSFONTDIR/) {
- if (win32()) {
+ if (wndws()) {
push @changedtmf, "OSFONTDIR = \$SystemRoot/fonts//;\$LOCALAPPDATA/Microsoft/Windows/Fonts//\n";
}
}
@@ -1485,7 +1486,7 @@ EOF
# external perl for third-party scripts?
# the wrapper batchfile has set the environment variable extperl
# to its version if available and 0 otherwise.
- if (win32) {
+ if (wndws()) {
my $use_ext = 0;
if (!$vars{'instopt_portable'} &&
defined $ENV{'extperl'} && $ENV{'extperl'} =~ /^(\d+\.\d+)/) {
@@ -1633,7 +1634,7 @@ sub set_texlive_default_dirs {
set_var_from_alternatives( \$tex_prefix,
($opt_in_place ? abs_path($::installerdir) : undef),
$tlprefixenv,
- (win32() ? getenv('SystemDrive') . '/texlive' : '/usr/local/texlive'));
+ (wndws() ? getenv('SystemDrive') . '/texlive' : '/usr/local/texlive'));
set_var_from_alternatives( \$vars{'TEXDIR'},
$vars{'TEXDIR'},
($vars{'instopt_portable'} || $opt_in_place)
@@ -1847,7 +1848,7 @@ END_EXPLICIT_MIRROR
$vars{"tlpdbopt_$o"} = $tlpdb->option($o)
if (!defined($profiledata{"tlpdbopt_$o"}));
}
- if (win32()) {
+ if (wndws()) {
# below, we really mean (start) menu integration.
# 2016: always menu shortcuts, never desktop shortcuts, whatever the setting
# 2017: new option value 2: launcher instead of menu.
@@ -2202,7 +2203,7 @@ sub do_install_packages {
tlwarn("Or you can restart by running the installer with:\n");
my $repostr = ($opt_location ? " --repository $location" : "");
my $args = "--profile $profile_name [YOUR-EXTRA-ARGS]";
- if (win32()) {
+ if (wndws()) {
tlwarn(" install-tl-windows.bat$repostr $args\n");
} else {
tlwarn(" install-tl$repostr $args\n");
@@ -2372,11 +2373,11 @@ sub import_settings_from_old_tlpdb {
= $previoustlpdb->option_pkg("00texlive.installation", "install_srcfiles");
$vars{'tlpdbopt_create_formats'}
= $previoustlpdb->option_pkg("00texlive.installation", "create_formats");
- $vars{'tlpdbopt_desktop_integration'} = 1 if win32();
+ $vars{'tlpdbopt_desktop_integration'} = 1 if wndws();
$vars{'instopt_adjustpath'}
= $previoustlpdb->option_pkg("00texlive.installation", "path");
$vars{'instopt_adjustpath'} = 0 if !defined($vars{'instopt_adjustpath'});
- $vars{'instopt_adjustpath'} = 1 if win32();
+ $vars{'instopt_adjustpath'} = 1 if wndws();
$vars{'tlpdbopt_sys_bin'}
= $previoustlpdb->option_pkg("00texlive.installation", "sys_bin");
$vars{'tlpdbopt_sys_man'}
@@ -2399,7 +2400,7 @@ sub import_settings_from_old_tlpdb {
#
# try to import paper settings
my $xdvi_paper;
- if (!win32()) {
+ if (!wndws()) {
$xdvi_paper = TeXLive::TLPaper::get_paper("xdvi");
}
my $pdftex_paper = TeXLive::TLPaper::get_paper("pdftex");
@@ -2634,7 +2635,7 @@ sub create_welcome {
push @::welcome_arr, __(
"See %s/index.html for links to documentation.\nThe TeX Live web site (https://tug.org/texlive/) contains any updates and corrections. TeX Live is a joint project of the TeX user groups around the world; please consider supporting it by joining the group best for you. The list of groups is available on the web at https://tug.org/usergroups.html.",
$::vars{'TEXDIR'});
- if (win32()
+ if (wndws()
|| ($vars{'instopt_adjustpath'}
&& $vars{'tlpdbopt_desktop_integration'} != 2)) {
; # don't tell them to make path adjustments on Windows,
diff --git a/Master/texmf-dist/scripts/texlive/fmtutil.pl b/Master/texmf-dist/scripts/texlive/fmtutil.pl
index a32ada7fc2b..9679795414a 100755
--- a/Master/texmf-dist/scripts/texlive/fmtutil.pl
+++ b/Master/texmf-dist/scripts/texlive/fmtutil.pl
@@ -42,9 +42,9 @@ use Cwd;
# don't import anything automatically, this requires us to explicitly
# call functions with TeXLive::TLUtils prefix, and makes it easier to
# find and if necessary remove references to TLUtils
-use TeXLive::TLUtils qw();
+use TeXLive::TLUtils qw(wndws);
-require TeXLive::TLWinGoo if TeXLive::TLUtils::win32;
+require TeXLive::TLWinGoo if wndws();
# numerical constants
my $FMT_NOTSELECTED = 0;
@@ -53,8 +53,8 @@ my $FMT_FAILURE = 2;
my $FMT_SUCCESS = 3;
my $FMT_NOTAVAIL = 4;
-my $nul = (win32() ? 'nul' : '/dev/null');
-my $sep = (win32() ? ';' : ':');
+my $nul = (wndws() ? 'nul' : '/dev/null');
+my $sep = (wndws() ? ';' : ':');
my @deferred_stderr;
my @deferred_stdout;
@@ -84,7 +84,7 @@ chomp(our $TEXMFSYSCONFIG = `kpsewhich -var-value=TEXMFSYSCONFIG`);
chomp(our $TEXMFHOME = `kpsewhich -var-value=TEXMFHOME`);
# make sure that on windows *everything* is in lower case for comparison
-if (win32()) {
+if (wndws()) {
$TEXMFDIST = lc($TEXMFDIST);
$TEXMFVAR = lc($TEXMFVAR);
$TEXMFSYSVAR = lc($TEXMFSYSVAR);
@@ -280,7 +280,7 @@ sub main {
# but for compatibility we'll silently keep the option.
$cmd = 'edit';
my $editor = $ENV{'VISUAL'} || $ENV{'EDITOR'};
- $editor ||= (&win32 ? "notepad" : "vi");
+ $editor ||= (&wndws ? "notepad" : "vi");
if (-r $changes_config_file) {
&copyFile($changes_config_file, $bakFile);
} else {
@@ -389,7 +389,7 @@ sub callback_build_formats {
# So make our own temp dir.
my $tmpdir = "";
if (! $opts{"dry-run"}) {
- if (win32()) {
+ if (wndws()) {
my $foo;
my $tmp_deflt = File::Spec->tmpdir;
for my $i (1..5) {
@@ -519,7 +519,7 @@ sub callback_build_formats {
print_info("failed to build: $err (@err)\n") if ($err);
print_info("total formats: $total\n");
chdir($thisdir) || warn "chdir($thisdir) failed: $!";
- if (win32()) {
+ if (wndws()) {
# try to remove the tmpdir with all files
TeXLive::TLUtils::rmtree($tmpdir);
}
@@ -1185,7 +1185,7 @@ sub determine_config_files {
die "$prg: Config file \"$f\" not found";
}
}
- push @tmp, (win32() ? lc($f) : $f);
+ push @tmp, (wndws() ? lc($f) : $f);
}
@{$opts{'cnffile'}} = @tmp;
# in case that config files are given on the command line, the first
@@ -1196,12 +1196,12 @@ sub determine_config_files {
chomp(@all_files);
my @used_files;
for my $f (@all_files) {
- push @used_files, (win32() ? lc($f) : $f);
+ push @used_files, (wndws() ? lc($f) : $f);
}
#
my $TEXMFLOCALVAR;
my @TEXMFLOCAL;
- if (win32()) {
+ if (wndws()) {
chomp($TEXMFLOCALVAR =`kpsewhich --expand-path=\$TEXMFLOCAL`);
@TEXMFLOCAL = map { lc } split(/;/ , $TEXMFLOCALVAR);
} else {
@@ -1337,7 +1337,7 @@ sub save_fmtutil {
# and reset it to the real home dir of root.
sub reset_root_home {
- if (!win32() && ($> == 0)) { # $> is effective uid
+ if (!wndws() && ($> == 0)) { # $> is effective uid
my $envhome = $ENV{'HOME'};
# if $HOME isn't an existing directory, we don't care.
if (defined($envhome) && (-d $envhome)) {
@@ -1406,16 +1406,6 @@ sub print_deferred_error {
}
-# copied from TeXLive::TLUtils to reduce dependencies
-sub win32 {
- if ($^O =~ /^MSWin/i) {
- return 1;
- } else {
- return 0;
- }
-}
-
-
# version, help.
diff --git a/Master/texmf-dist/scripts/texlive/tlmgr.pl b/Master/texmf-dist/scripts/texlive/tlmgr.pl
index e7117c23c62..b26cf4733bb 100755
--- a/Master/texmf-dist/scripts/texlive/tlmgr.pl
+++ b/Master/texmf-dist/scripts/texlive/tlmgr.pl
@@ -51,7 +51,11 @@ BEGIN {
$Master =~ s!\\!/!g;
$Master =~ s![^/]*$!../../..!
unless ($Master =~ s!/texmf-dist/scripts/texlive/tlmgr\.pl$!!i);
- $bindir = "$Master/bin/win32";
+ if (tl_w32()) {
+ $bindir = "$Master/bin/win32";
+ } else {
+ $bindir = "$Master/bin/win64";
+ }
$kpsewhichname = "kpsewhich.exe";
# path already set by wrapper batchfile
} else {
@@ -96,7 +100,7 @@ use TeXLive::TLWinGoo;
use TeXLive::TLDownload;
use TeXLive::TLConfFile;
use TeXLive::TLCrypto;
-TeXLive::TLUtils->import(qw(member info give_ctan_mirror win32 dirname
+TeXLive::TLUtils->import(qw(member info give_ctan_mirror wndws tl_win32 tl_win64 dirname
mkdirhier copy debug tlcmp repository_to_array));
use TeXLive::TLPaper;
@@ -520,7 +524,7 @@ sub main {
# and on Windows our Config.pm can apparently interfere, so always
# skip it there. Or if users have NOPERLDOC set in the environment.
my @noperldoc = ();
- if (win32() || $ENV{"NOPERLDOC"}) {
+ if (wndws() || $ENV{"NOPERLDOC"}) {
@noperldoc = ("-noperldoc", "1");
} else {
if (!TeXLive::TLUtils::which("perldoc")) {
@@ -843,7 +847,8 @@ sub do_cmd_and_check {
if ($opts{"dry-run"}) {
$ret = $F_OK;
$out = "";
- } elsif (win32() && (! -r "$Master/bin/win32/luatex.dll")) {
+ } elsif ((tl_w32() && (! -r "$Master/bin/win32/luatex.dll")) ||
+ (tl_w64() && (! -r "$Master/bin/win64/luatex.dll"))) {
# deal with the case where only scheme-infrastructure is installed
# on Windows, thus no luatex.dll is available and the wrapper cannot be started
tlwarn("Cannot run wrapper due to missing luatex.dll\n");
@@ -1013,7 +1018,7 @@ sub handle_execute_actions {
if ($regenerate_language) {
for my $ext ("dat", "def", "dat.lua") {
my $lang = "language.$ext";
- if (! TeXLive::TLUtils::win32()) {
+ if (! TeXLive::TLUtils::wndws()) {
# Use full path for external command, except on Windows.
$lang = "$TEXMFSYSVAR/tex/generic/config/$lang";
}
@@ -1502,7 +1507,7 @@ sub action_path {
}
init_local_db();
my $winadminmode = 0;
- if (win32()) {
+ if (wndws()) {
#
# for w32 we do system wide vs user setting detection as follows:
# - if --w32mode is NOT given,
@@ -1561,9 +1566,9 @@ sub action_path {
}
my $ret = $F_OK;
if ($what =~ m/^add$/i) {
- if (win32()) {
+ if (wndws()) {
$ret |= TeXLive::TLUtils::w32_add_to_path(
- $localtlpdb->root . "/bin/win32",
+ $localtlpdb->root . tl_w32() ? "/bin/win32" : "/bin/win64",
$winadminmode);
# ignore this return value, since broadcase_env might return
# nothing in case of errors, and there is no way around it.
@@ -1576,9 +1581,9 @@ sub action_path {
$localtlpdb->option("sys_info"));
}
} elsif ($what =~ m/^remove$/i) {
- if (win32()) {
+ if (wndws()) {
$ret |= TeXLive::TLUtils::w32_remove_from_path(
- $localtlpdb->root . "/bin/win32",
+ $localtlpdb->root . tl_w32() ? "/bin/win32" : "/bin/win64",
$winadminmode);
# ignore this return value, since broadcase_env might return
# nothing in case of errors, and there is no way around it.
@@ -3291,7 +3296,7 @@ sub action_update {
}
$updated{$pkg} = 1;
next;
- } elsif (win32() && ($pkg =~ m/$CriticalPackagesRegexp/)) {
+ } elsif (wndws() && ($pkg =~ m/$CriticalPackagesRegexp/)) {
# we pretend that the update happened
# in order to calculate file changes properly
$updated{$pkg} = 1;
@@ -3410,7 +3415,7 @@ sub action_update {
# TODO
logpackage("failed update: $pkg ($rev -> $mediarevstr)");
tlwarn("$prg: Installation of new version of $pkg failed, trying to unwind.\n");
- if (win32()) {
+ if (wndws()) {
# w32 is notorious for not releasing a file immediately
# we experienced permission denied errors
my $newname = $unwind_package;
@@ -3557,7 +3562,7 @@ sub action_update {
my @found_pkgs = $localtlpdb->find_file($k);
if ($#found_pkgs >= 0) {
my $bad_file = 1;
- if (win32()) {
+ if (wndws()) {
# on w32 the packages have not been removed already,
# so we check that the only package listed in @found_pkgs
# is the one we are working on ($pkg)
@@ -3583,7 +3588,7 @@ sub action_update {
}
}
- if (!win32()) {
+ if (!wndws()) {
for my $f (@infra_files_to_be_removed) {
# TODO actually unlink the stuff
#unlink("$Master/$f");
@@ -3614,7 +3619,7 @@ sub action_update {
}
# infra update and tlmgr restart on w32 is done by the updater batch script
- if (win32() && $opts{'self'} && !$opts{"list"} && @critical) {
+ if (wndws() && $opts{'self'} && !$opts{"list"} && @critical) {
info("$prg: Preparing TeX Live infrastructure update...\n");
for my $f (@infra_files_to_be_removed) {
debug("file scheduled for removal $f\n");
@@ -3629,7 +3634,7 @@ sub action_update {
}
# only when we are not dry-running we restart the program
- if (!win32() && $restart_tlmgr && !$opts{"dry-run"} && !$opts{"list"}) {
+ if (!wndws() && $restart_tlmgr && !$opts{"dry-run"} && !$opts{"list"}) {
info("$prg: Restarting to complete update ...\n");
debug("restarting tlmgr @::SAVEDARGV\n");
# cleanup temp files before re-exec-ing tlmgr
@@ -4760,11 +4765,11 @@ sub action_option {
# ignore generate_update which is no longer used or needed.
next if ($o eq "generate_updmap");
# ignore some things which are w32 specific
- next if ($o eq "desktop_integration" && !win32());
- next if ($o eq "file_assocs" && !win32());
- next if ($o eq "w32_multi_user" && !win32());
+ next if ($o eq "desktop_integration" && !wndws());
+ next if ($o eq "file_assocs" && !wndws());
+ next if ($o eq "w32_multi_user" && !wndws());
#
- if (win32()) {
+ if (wndws()) {
next if ($o =~ m/^sys_/);
}
if (defined $TLPDBOptions{$o}) {
@@ -4828,7 +4833,7 @@ sub action_option {
# when running w32 do not allow that a non-admin users sets
# this from false to true
my $do_it = 0;
- if (win32()) {
+ if (wndws()) {
if (admin()) {
$do_it = 1;
} else {
@@ -5315,7 +5320,7 @@ Error message from creating MainWindow:
# Return zero if successful, nonzero if failure.
#
sub uninstall_texlive {
- if (win32()) {
+ if (wndws()) {
printf STDERR "Please use \"Add/Remove Programs\" from the Control Panel "
. "to uninstall TeX Live!\n";
return ($F_ERROR);
@@ -6156,7 +6161,7 @@ sub action_postaction {
tlwarn("$prg: action postaction needs as second argument one from 'shortcut', 'fileassoc', 'script'\n");
return;
}
- if (win32()) {
+ if (wndws()) {
if ($opts{"w32mode"}) {
if ($opts{"w32mode"} eq "user") {
if (TeXLive::TLWinGoo::admin()) {
@@ -6191,7 +6196,7 @@ sub action_postaction {
@todo = $localtlpdb->expand_dependencies("-only-arch", $localtlpdb, @todo);
}
if ($type =~ m/^shortcut$/i) {
- if (!win32()) {
+ if (!wndws()) {
tlwarn("$prg: action postaction shortcut only works on windows.\n");
return;
}
@@ -6205,7 +6210,7 @@ sub action_postaction {
}
}
} elsif ($type =~ m/^fileassoc$/i) {
- if (!win32()) {
+ if (!wndws()) {
tlwarn("$prg: action postaction fileassoc only works on windows.\n");
return;
}
@@ -6919,7 +6924,7 @@ sub init_local_db {
# - if we are on Windows, it does not start with Drive:[\/]
if (! ( $location =~ m!^(https?|ftp)://!i ||
$location =~ m!$TeXLive::TLUtils::SshURIRegex!i ||
- (win32() && (!(-e $location) || ($location =~ m!^.:[\\/]!) ) ) ) ) {
+ (wndws() && (!(-e $location) || ($location =~ m!^.:[\\/]!) ) ) ) ) {
# seems to be a local path, try to normalize it
my $testloc = abs_path($location);
# however, if we were given a url, that will get "normalized" to the
diff --git a/Master/texmf-dist/scripts/texlive/tlmgrgui.pl b/Master/texmf-dist/scripts/texlive/tlmgrgui.pl
index 562ee8d1562..b6fee7e32fb 100755
--- a/Master/texmf-dist/scripts/texlive/tlmgrgui.pl
+++ b/Master/texmf-dist/scripts/texlive/tlmgrgui.pl
@@ -38,7 +38,7 @@ use Pod::Text;
#use Devel::Leak;
-use TeXLive::TLUtils qw(setup_programs platform_desc win32 debug);
+use TeXLive::TLUtils qw(setup_programs platform_desc wndws debug);
use TeXLive::TLConfig;
#
@@ -509,7 +509,7 @@ sub setup_menu_system {
$menu->add('cascade', -label => __("Actions"), -menu => $menu_actions);
}
# on win32 people expect to have the Help button on the right side
- if (win32()) { $menu->add('separator'); }
+ if (wndws()) { $menu->add('separator'); }
$menu->add('cascade', -label => __("Help"), -menu => $menu_help);
#
@@ -545,7 +545,7 @@ sub setup_menu_system {
-command => sub { do_general_settings(); });
$menu_options->add('command', -label => __("Paper ..."),
-command => sub { do_paper_settings(); });
- if (!win32() && $mode_expert) {
+ if (!wndws() && $mode_expert) {
$menu_options->add('command', -label => __("Platforms ..."),
-command => sub { do_arch_settings(); });
}
@@ -608,13 +608,13 @@ sub setup_menu_system {
-state => $::action_button_state,
-command => \&cb_handle_restore);
- if (!win32()) {
+ if (!wndws()) {
$menu_actions->add('command',
-label => __("Handle symlinks in system dirs") . " ...",
-state => $::action_button_state,
-command => \&cb_handle_symlinks);
}
- if (!win32()) {
+ if (!wndws()) {
$menu_actions->add('separator');
$menu_actions->add('command', -label => __("Remove TeX Live %s ...", $TeXLive::TLConfig::ReleaseYear),
-state => $::action_button_state,
@@ -1190,7 +1190,7 @@ sub do_general_settings {
$back_config_set->Button(-text => __("Change"),
-command => sub { select_autobackup($sw); });
- if (!win32()) {
+ if (!wndws()) {
push @config_set_l,
$back_config_set->Label(-text => __("Link destination for programs"), -anchor => "w");
$settings_label{'sys_bin'} = $back_config_set->Label(-textvariable => \$changeddefaults{"sys_bin"}{'display'});
@@ -1216,7 +1216,7 @@ sub do_general_settings {
-command => sub { edit_dir_option ($sw, "sys_man"); });
}
- if (win32()) {
+ if (wndws()) {
push @config_set_l,
$back_config_set->Label(-text => __("Create shortcuts on the desktop"), -anchor => "w");
$settings_label{'desktop_integration'} = $back_config_set->Label(-textvariable => \$changeddefaults{"desktop_integration"}{'display'});
@@ -1289,7 +1289,7 @@ sub apply_settings_changes {
########## PAPER HANDLING #################
sub init_paper_xdvi {
- if (!win32()) {
+ if (!wndws()) {
$papers{"xdvi"} = TeXLive::TLPaper::get_paper_list("xdvi");
$currentpaper{"xdvi"} = $papers{"xdvi"}->[0];
}
@@ -2274,7 +2274,7 @@ You can then restart it to proceed with further updates.");
$t .= "\n\n"
. __("(Further updates will be available after tlmgr has been updated.)");
}
- $t .= "\n\n" . __("Please wait a bit after the program has terminated so that the update can be completed.") if win32();
+ $t .= "\n\n" . __("Please wait a bit after the program has terminated so that the update can be completed.") if wndws();
$sw->add("Label", -text => $t)->pack(-padx => "3m", -pady => "3m");
$sw->Show;
}
diff --git a/Master/texmf-dist/scripts/texlive/uninstall-win32.pl b/Master/texmf-dist/scripts/texlive/uninstall-win32.pl
index 71aa86652a4..17dbaff1c9e 100755
--- a/Master/texmf-dist/scripts/texlive/uninstall-win32.pl
+++ b/Master/texmf-dist/scripts/texlive/uninstall-win32.pl
@@ -61,7 +61,8 @@ sub doit {
`rmdir /s /q "$menupath\\$TeXLive::TLConfig::WindowsMainMenuName" 2>nul`;
# remove bindir from PATH settings
- TeXLive::TLUtils::w32_remove_from_path("$Master/bin/win32",
+ TeXLive::TLUtils::w32_remove_from_path(
+ TeXLive::TLUtils::tl_w32 ? "$Master/bin/win32" : "$Master/bin/win64",
$localtlpdb->option("w32_multi_user"));
# unsetenv_reg("TEXBINDIR");
diff --git a/Master/texmf-dist/scripts/texlive/updmap.pl b/Master/texmf-dist/scripts/texlive/updmap.pl
index bda82741eea..e9b53fb76aa 100755
--- a/Master/texmf-dist/scripts/texlive/updmap.pl
+++ b/Master/texmf-dist/scripts/texlive/updmap.pl
@@ -37,7 +37,7 @@ my $version = "r$svnrev ($lastchdate)";
use Getopt::Long qw(:config no_autoabbrev ignore_case_always);
use strict;
-use TeXLive::TLUtils qw(mkdirhier mktexupd win32 basename dirname
+use TeXLive::TLUtils qw(mkdirhier mktexupd wndws basename dirname
sort_uniq member touch);
(my $prg = basename($0)) =~ s/\.pl$//;
@@ -54,7 +54,7 @@ chomp(my $TEXMFSYSCONFIG = `kpsewhich -var-value=TEXMFSYSCONFIG`);
chomp(my $TEXMFHOME = `kpsewhich -var-value=TEXMFHOME`);
# make sure that on windows *everything* is in lower case for comparison
-if (win32()) {
+if (wndws()) {
$TEXMFDIST = lc($TEXMFDIST);
$TEXMFVAR = lc($TEXMFVAR);
$TEXMFSYSVAR = lc($TEXMFSYSVAR);
@@ -232,7 +232,7 @@ sub main {
if (! -f $f) {
die "$prg: Config file \"$f\" not found.";
}
- push @tmp, (win32() ? lc($f) : $f);
+ push @tmp, (wndws() ? lc($f) : $f);
}
@{$opts{'cnffile'}} = @tmp;
# in case that config files are given on the command line, the first
@@ -243,12 +243,12 @@ sub main {
chomp(@all_files);
my @used_files;
for my $f (@all_files) {
- push @used_files, (win32() ? lc($f) : $f);
+ push @used_files, (wndws() ? lc($f) : $f);
}
#
my $TEXMFLOCALVAR;
my @TEXMFLOCAL;
- if (win32()) {
+ if (wndws()) {
chomp($TEXMFLOCALVAR =`kpsewhich --expand-path=\$TEXMFLOCAL`);
@TEXMFLOCAL = map { lc } split(/;/ , $TEXMFLOCALVAR);
} else {
@@ -422,7 +422,7 @@ sub main {
# but for compatibility we'll silently keep the option.
$cmd = 'edit';
my $editor = $ENV{'VISUAL'} || $ENV{'EDITOR'};
- $editor ||= (&win32 ? "notepad" : "vi");
+ $editor ||= (wndws() ? "notepad" : "vi");
if (-r $changes_config_file) {
&copyFile($changes_config_file, $bakFile);
} else {
@@ -593,7 +593,7 @@ sub setupSymlinks {
sub SymlinkOrCopy {
my ($dir, $src, $dest) = @_;
return ($src, $dest) if $opts{"dry-run"};
- if (&win32 || $opts{'copy'}) { # always copy
+ if (wndws() || $opts{'copy'}) { # always copy
&copyFile("$dir/$src", "$dir/$dest");
} else { # symlink if supported by fs, copy otherwise
system("cd \"$dir\" && ln -s $src $dest 2>/dev/null || "
@@ -2216,7 +2216,7 @@ sub merge_data {
# and reset it to the real home dir of root.
sub reset_root_home {
- if (!win32() && ($> == 0)) { # $> is effective uid
+ if (!wndws() && ($> == 0)) { # $> is effective uid
my $envhome = $ENV{'HOME'};
# if $HOME isn't an existing directory, we don't care.
if (defined($envhome) && (-d $envhome)) {
diff --git a/Master/tlpkg/TeXLive/TLCrypto.pm b/Master/tlpkg/TeXLive/TLCrypto.pm
index a75c8507b8a..cb31e1efc5f 100644
--- a/Master/tlpkg/TeXLive/TLCrypto.pm
+++ b/Master/tlpkg/TeXLive/TLCrypto.pm
@@ -9,7 +9,7 @@ package TeXLive::TLCrypto;
use Digest::MD5;
use TeXLive::TLConfig;
-use TeXLive::TLUtils qw(debug ddebug win32 which platform
+use TeXLive::TLUtils qw(debug ddebug wndws which platform
conv_to_w32_path tlwarn tldie);
my $svnrev = '$Revision$';
@@ -421,7 +421,7 @@ sub setup_gpg {
# Set up the gpg invocation:
my $gpghome = ($ENV{'TL_GNUPGHOME'} ? $ENV{'TL_GNUPGHOME'} :
"$master/tlpkg/gpg" );
- $gpghome =~ s!/!\\!g if win32();
+ $gpghome =~ s!/!\\!g if wndws();
my $gpghome_quote = "\"$gpghome\"";
# mind the final space for following args
$::gpg = "$prg --homedir $gpghome_quote ";
@@ -568,7 +568,7 @@ Internal routine running gpg to verify signature C<$sig> of C<$file>.
sub gpg_verify_signature {
my ($file, $sig) = @_;
my ($file_quote, $sig_quote);
- if (win32()) {
+ if (wndws()) {
$file =~ s!/!\\!g;
$sig =~ s!/!\\!g;
}
diff --git a/Master/tlpkg/TeXLive/TLPDB.pm b/Master/tlpkg/TeXLive/TLPDB.pm
index be818fccaed..110d5f2f6b4 100644
--- a/Master/tlpkg/TeXLive/TLPDB.pm
+++ b/Master/tlpkg/TeXLive/TLPDB.pm
@@ -98,7 +98,7 @@ use TeXLive::TLConfig qw($CategoriesRegexp $DefaultCategory $InfraLocation
$RelocPrefix $RelocTree);
use TeXLive::TLCrypto;
use TeXLive::TLPOBJ;
-use TeXLive::TLUtils qw(dirname mkdirhier member win32 info log debug ddebug
+use TeXLive::TLUtils qw(dirname mkdirhier member wndws info log debug ddebug
tlwarn basename download_file merge_into tldie
system_pipe);
use TeXLive::TLWinGoo;
@@ -1682,7 +1682,7 @@ sub install_package_files {
# Run the post installation code in the postaction tlpsrc entries
# in case we are on w32 and the admin did install for himself only
# we switch off admin mode
- if (win32() && admin() && !$self->option("w32_multi_user")) {
+ if (wndws() && admin() && !$self->option("w32_multi_user")) {
non_admin();
}
# for now desktop_integration maps to both installation
@@ -1914,7 +1914,7 @@ sub not_virtual_install_package {
# Run the post installation code in the postaction tlpsrc entries
# in case we are on w32 and the admin did install for himself only
# we switch off admin mode
- if (win32() && admin() && !$totlpdb->option("w32_multi_user")) {
+ if (wndws() && admin() && !$totlpdb->option("w32_multi_user")) {
non_admin();
}
# for now desktop_integration maps to both installation
@@ -2125,7 +2125,7 @@ sub remove_package {
# Run the post installation code in the postaction tlpsrc entries
# in case we are on w32 and the admin did install for himself only
# we switch off admin mode
- if (win32() && admin() && !$localtlpdb->option("w32_multi_user")) {
+ if (wndws() && admin() && !$localtlpdb->option("w32_multi_user")) {
non_admin();
}
#
diff --git a/Master/tlpkg/TeXLive/TLPOBJ.pm b/Master/tlpkg/TeXLive/TLPOBJ.pm
index f90c0b94d50..9f6ff093adb 100644
--- a/Master/tlpkg/TeXLive/TLPOBJ.pm
+++ b/Master/tlpkg/TeXLive/TLPOBJ.pm
@@ -684,7 +684,7 @@ sub make_container {
}
my $tartempfile = "";
- if (win32()) {
+ if (wndws()) {
# Since we provide our own (GNU) tar on Windows, we know it has -T.
my $tmpdir = TeXLive::TLUtils::tl_tmpdir();
$tartempfile = "$tmpdir/mc$$";
diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm
index 4751574b681..a3d9572995d 100644
--- a/Master/tlpkg/TeXLive/TLUtils.pm
+++ b/Master/tlpkg/TeXLive/TLUtils.pm
@@ -27,7 +27,9 @@ C<TeXLive::TLUtils> - TeX Live infrastructure miscellany
TeXLive::TLUtils::platform();
TeXLive::TLUtils::platform_name($canonical_host);
TeXLive::TLUtils::platform_desc($platform);
- TeXLive::TLUtils::win32();
+ TeXLive::TLUtils::tl_w32();
+ TeXLive::TLUtils::tl_w64();
+ TeXLive::TLUtils::wndws();
TeXLive::TLUtils::unix();
=head2 System tools
@@ -260,7 +262,7 @@ BEGIN {
@EXPORT = qw(setup_programs download_file process_logging_options
tldie tlwarn info log debug ddebug dddebug debug
debug_hash_str debug_hash
- win32 xchdir xsystem run_cmd system_pipe sort_archs);
+ wndws tl_w32 tl_w64 xchdir xsystem run_cmd system_pipe sort_archs);
}
use Cwd;
@@ -545,14 +547,50 @@ sub platform_desc {
}
-=item C<win32>
+=item C<tl_w32>
+
+Return C<1> if platform is Windows32 and C<0> otherwise. The test is
+currently based on the value of Perl's C<$^O> variable.
+
+=cut
+
+sub tl_w32 {
+ if ($^O =~ /^MSWin/i) {
+ # TODO check 32bit
+ return 1;
+ } else {
+ return 0;
+ }
+ # the following needs config.guess, which is quite bad ...
+ # return (&platform eq "win32")? 1:0;
+}
+
+=item C<tl_w64>
+
+Return C<1> if platform is Windows64 and C<0> otherwise. The test is
+currently based on the value of Perl's C<$^O> variable.
+
+=cut
+
+sub tl_w64 {
+ if ($^O =~ /^MSWin/i) {
+ # TODO check 64bit
+ return 1;
+ } else {
+ return 0;
+ }
+ # the following needs config.guess, which is quite bad ...
+ # return (&platform eq "win32")? 1:0;
+}
+
+=item C<wndws>
Return C<1> if platform is Windows and C<0> otherwise. The test is
currently based on the value of Perl's C<$^O> variable.
=cut
-sub win32 {
+sub wndws {
if ($^O =~ /^MSWin/i) {
return 1;
} else {
@@ -594,7 +632,7 @@ sub getenv {
my $envvar=shift;
my $var=$ENV{"$envvar"};
return 0 unless (defined $var);
- if (&win32) {
+ if (wndws()) {
$var=~s!\\!/!g; # change \ -> / (required by Perl)
}
return "$var";
@@ -616,7 +654,7 @@ sub which {
my @PATH;
my $PATH = getenv('PATH');
- if (&win32) {
+ if (wndws()) {
my @PATHEXT = split (';', getenv('PATHEXT'));
push (@PATHEXT, ''); # in case argument contains an extension
@PATH = split (';', $PATH);
@@ -783,7 +821,7 @@ sub system_pipe {
my ($prog, $infile, $outfile, $removeIn, @extraargs) = @_;
my $progQuote = quotify_path_with_spaces($prog);
- if (win32()) {
+ if (wndws()) {
$infile =~ s!/!\\!g;
$outfile =~ s!/!\\!g;
}
@@ -903,7 +941,7 @@ Return both C<dirname> and C<basename>. Example:
sub dirname_and_basename {
my $path=shift;
my ($share, $base) = ("", "");
- if (win32) {
+ if (wndws()) {
$path=~s!\\!/!g;
}
# do not try to make sense of paths ending with /..
@@ -912,7 +950,7 @@ sub dirname_and_basename {
# eliminate `/.' path components
while ($path =~ s!/\./!/!) {};
# UNC path? => first split in $share = //xxx/yy and $path = /zzzz
- if (win32() and $path =~ m!^(//[^/]+/[^/]+)(.*)$!) {
+ if (wndws() and $path =~ m!^(//[^/]+/[^/]+)(.*)$!) {
($share, $path) = ($1, $2);
if ($path =~ m!^/?$!) {
$path = $share;
@@ -970,7 +1008,7 @@ sub basename {
sub tl_abs_path {
my $path = shift;
- if (win32) {
+ if (wndws()) {
$path=~s!\\!/!g;
}
if (-e $path) {
@@ -984,9 +1022,9 @@ sub tl_abs_path {
# (//?/ path prefix)
die "Unsupported path syntax" if $path =~ m!/\.\./! || $path =~ m!/\.\.$!
|| $path =~ m!^\.\.!;
- die "Unsupported path syntax" if win32() && $path =~ m!^//\?/!;
+ die "Unsupported path syntax" if wndws() && $path =~ m!^//\?/!;
if ($path !~ m!^(.:)?/!) { # relative path
- if (win32() && $path =~ /^.:/) { # drive letter
+ if (wndws() && $path =~ /^.:/) { # drive letter
my $dcwd;
# starts with drive letter: current dir on drive
$dcwd = Cwd::getdcwd ($1);
@@ -1020,7 +1058,7 @@ sub dir_slash {
sub dir_creatable {
my $path=shift;
#print STDERR "testing $path\n";
- $path =~ s!\\!/!g if win32;
+ $path =~ s!\\!/!g if wndws();
return 0 unless -d $path;
$path .= '/' unless $path =~ m!/$!;
#print STDERR "testing $path\n";
@@ -1062,7 +1100,7 @@ a fileserver.
sub dir_writable {
my ($path) = @_;
return 0 unless -d $path;
- $path =~ s!\\!/!g if win32;
+ $path =~ s!\\!/!g if wndws();
$path .= '/' unless $path =~ m!/$!;
my $i = 0;
my $f;
@@ -1108,7 +1146,7 @@ sub mkdirhier {
my $subdir = "";
# win32 is special as usual: we need to separate //servername/ part
# from the UNC path, since (! -d //servername/) tests true
- $subdir = $& if ( win32() && ($tree =~ s!^//[^/]+/!!) );
+ $subdir = $& if ( wndws() && ($tree =~ s!^//[^/]+/!!) );
my @dirs = split (/[\/\\]/, $tree);
for my $dir (@dirs) {
@@ -1587,7 +1625,7 @@ sub removed_dirs {
# c:\tl test\...
# and not forward slashes, while, if there is already a forward /
# in the path, also the rest is done with forward slashes.
- $abs_f =~ s!\\!/!g if win32();
+ $abs_f =~ s!\\!/!g if wndws();
if (!$abs_f) {
warn ("oops, no abs_path($f) from " . `pwd`);
next;
@@ -1847,7 +1885,7 @@ sub do_postaction {
sub _do_postaction_fileassoc {
my ($how, $mode, $tlpobj, $pa) = @_;
- return 1 unless win32();
+ return 1 unless wndws();
my ($errors, %keyval) =
parse_into_keywords($pa, qw/extension filetype/);
@@ -1885,7 +1923,7 @@ sub _do_postaction_fileassoc {
sub _do_postaction_filetype {
my ($how, $tlpobj, $pa) = @_;
- return 1 unless win32();
+ return 1 unless wndws();
my ($errors, %keyval) =
parse_into_keywords($pa, qw/name cmd/);
@@ -1930,7 +1968,7 @@ sub _do_postaction_filetype {
# associated program shows up in `open with' menu
sub _do_postaction_progid {
my ($how, $tlpobj, $pa) = @_;
- return 1 unless win32();
+ return 1 unless wndws();
my ($errors, %keyval) =
parse_into_keywords($pa, qw/extension filetype/);
@@ -1980,7 +2018,7 @@ sub _do_postaction_script {
return 0;
}
my $file = $keyval{'file'};
- if (win32() && defined($keyval{'filew32'})) {
+ if (wndws() && defined($keyval{'filew32'})) {
$file = $keyval{'filew32'};
}
my $texdir = `kpsewhich -var-value=TEXMFROOT`;
@@ -2010,7 +2048,7 @@ sub _do_postaction_script {
sub _do_postaction_shortcut {
my ($how, $tlpobj, $do_menu, $do_desktop, $pa) = @_;
- return 1 unless win32();
+ return 1 unless wndws();
my ($errors, %keyval) =
parse_into_keywords($pa, qw/type name icon cmd args hide/);
@@ -2281,7 +2319,7 @@ sub add_remove_symlinks {
my $plat_bindir = "$Master/bin/$arch";
# nothing to do with symlinks on Windows, of course.
- return if win32();
+ return if wndws();
my $info_dir = "$Master/texmf-dist/doc/info";
if ($mode eq "add") {
@@ -2367,7 +2405,7 @@ be called to make the changes immediately visible.
sub w32_add_to_path {
my ($bindir, $multiuser) = @_;
- return if (!win32());
+ return if (!wndws());
my $path = TeXLive::TLWinGoo::get_system_env() -> {'/Path'};
$path =~ s/[\s\x00]+$//;
@@ -2612,7 +2650,7 @@ sub untar {
# on w32 don't extract file modified time, because AV soft can open
# files in the mean time causing time stamp modification to fail
- my $taropt = win32() ? "xmf" : "xf";
+ my $taropt = wndws() ? "xmf" : "xf";
if (system($tar, $taropt, $tarfile) != 0) {
tlwarn("TLUtils::untar: $tar $taropt $tarfile failed (in $targetdir)\n");
$ret = 0;
@@ -3110,7 +3148,7 @@ sub _download_file_lwp {
sub _download_file_program {
my ($url, $dest, $type) = @_;
- if (win32()) {
+ if (wndws()) {
$dest =~ s!/!\\!g;
}
@@ -3159,7 +3197,7 @@ Return C</dev/null> on Unix and C<nul> on Windows.
=cut
sub nulldev {
- return (&win32()) ? 'nul' : '/dev/null';
+ return (&wndws()) ? 'nul' : '/dev/null';
}
=item C<get_full_line ($fh)>
@@ -4022,7 +4060,7 @@ sub texdir_check {
# Unfortunately we have lots of special characters.
# On Windows, backslashes are normal but will already have been changed
# to slashes by tl_abs_path. And we should only check for : on Unix.
- my $colon = win32() ? "" : ":";
+ my $colon = wndws() ? "" : ":";
if ($texdir =~ /[,$colon;\\{}\$]/) {
if ($warn) {
print " !! TEXDIR value has problematic characters: $orig_texdir\n";
@@ -4035,7 +4073,7 @@ sub texdir_check {
return 0;
}
# w32: for now, reject the root of a samba share
- return 0 if win32() && $texdir =~ m!^//[^/]+/[^/]+$!;
+ return 0 if wndws() && $texdir =~ m!^//[^/]+/[^/]+$!;
# if texdir already exists, make sure we can write into it.
return dir_writable($texdir) if (-d $texdir);
@@ -4066,7 +4104,7 @@ are (erroneously) eradicated.
sub quotify_path_with_spaces {
my $p = shift;
- my $m = win32() ? '[+=^&();,!%\s]' : '.';
+ my $m = wndws() ? '[+=^&();,!%\s]' : '.';
if ( $p =~ m/$m/ ) {
$p =~ s/"//g; # remove any existing double quotes
$p = "\"$p\"";
@@ -4114,13 +4152,13 @@ slashes after reading a path. They both are no-ops on Unix.
sub native_slashify {
my ($r) = @_;
- $r =~ s!/!\\!g if win32();
+ $r =~ s!/!\\!g if wndws();
return $r;
}
sub forward_slashify {
my ($r) = @_;
- $r =~ s!\\!/!g if win32();
+ $r =~ s!\\!/!g if wndws();
return $r;
}
@@ -4202,7 +4240,7 @@ END_NO_SSL
#
sub query_ctan_mirror_curl {
my $max_trial = 3;
- my $warg = (win32() ? '-w "%{url_effective}" ' : "-w '%{url_effective}' ");
+ my $warg = (wndws() ? '-w "%{url_effective}" ' : "-w '%{url_effective}' ");
for (my $i = 1; $i <= $max_trial; $i++) {
# -L -> follow redirects
# -s -> silent
@@ -4809,7 +4847,7 @@ sub mktexupd {
die "mktexupd: exec file does not exist: $file" if (! -f $file);
}
}
- my $delim= (&win32)? ';' : ':';
+ my $delim= (&wndws)? ';' : ':';
my $TEXMFDBS;
chomp($TEXMFDBS=`kpsewhich --show-path="ls-R"`);
@@ -4819,8 +4857,8 @@ sub mktexupd {
foreach my $path (keys %files) {
foreach my $db (@texmfdbs) {
$db=substr($db, -1) if ($db=~m|/$|); # strip leading /
- $db = lc($db) if win32();
- my $up = (win32() ? lc($path) : $path);
+ $db = lc($db) if wndws();
+ my $up = (wndws() ? lc($path) : $path);
if (substr($up, 0, length("$db/")) eq "$db/") {
# we appended a / because otherwise "texmf" is recognized as a
# substring of "texmf-dist".
@@ -4952,7 +4990,7 @@ directory for PATH.
sub prepend_own_path {
my $bindir = dirname(Cwd::abs_path(which('kpsewhich')));
- if (win32()) {
+ if (wndws()) {
$bindir =~ s!\\!/!g;
$ENV{'PATH'} = "$bindir;$ENV{PATH}";
} else {
diff --git a/Master/tlpkg/installer/install-menu-extl.pl b/Master/tlpkg/installer/install-menu-extl.pl
index 4dd16ade9c7..5417d59ae6d 100644
--- a/Master/tlpkg/installer/install-menu-extl.pl
+++ b/Master/tlpkg/installer/install-menu-extl.pl
@@ -123,7 +123,7 @@ sub run_menu_extl {
print "year: $texlive_release\n";
print "svn: $::installerrevision\n";
# for windows, add a key indicating elevated permissions
- if (win32()) {
+ if (wndws()) {
print "admin: ". TeXLive::TLWinGoo::admin() . "\n";
}
print_descs();
diff --git a/Master/tlpkg/installer/install-menu-text.pl b/Master/tlpkg/installer/install-menu-text.pl
index a47eb11e467..b5ea98f1b9c 100644
--- a/Master/tlpkg/installer/install-menu-text.pl
+++ b/Master/tlpkg/installer/install-menu-text.pl
@@ -40,7 +40,7 @@ $::fileassocdesc[2] = __("All");
$::deskintdesc[0] = __("None");
$::deskintdesc[1] = __("Menu shortcuts");
-if (win32()) { $::deskintdesc[2] = __("Launcher"); }
+if (wndws()) { $::deskintdesc[2] = __("Launcher"); }
sub clear_screen {
return 0 if ($::opt_no_cls);
@@ -532,7 +532,7 @@ EOF
EOF
- if (win32) {
+ if (wndws()) {
print " Note: ~ will expand to %USERPROFILE%\n";
} else {
print " Note: ~ will expand to \$HOME (or to %USERPROFILE% on Windows)\n";
@@ -620,11 +620,11 @@ sub input_dirname
chomp (my $answer = <STDIN>);
return "" if $answer eq "";
- $answer =~ s!\\!/!g if win32(); # switch to forward slashes
+ $answer =~ s!\\!/!g if wndws(); # switch to forward slashes
if (!$noexpansion) {
my $home = getenv('HOME');
- $home = getenv('USERPROFILE') if win32();
+ $home = getenv('USERPROFILE') if wndws();
$home ||= '~';
$answer =~ s/^~/$home/; # $home expansion
}
@@ -820,7 +820,7 @@ EOF
EOF
;
}
- if ((win32() && !$vars{'instopt_portable'}) || $::opt_all_options) {
+ if ((wndws() && !$vars{'instopt_portable'}) || $::opt_all_options) {
print " <M> Start menu shortcuts / launcher: ".obutton(
$vars{'tlpdbopt_desktop_integration'}, \@::deskintdesc)."\n";
print " <N> update file associations: ".obutton(
@@ -831,7 +831,7 @@ EOF
}
}
}
- if (win32() || $::opt_all_options) {
+ if (wndws() || $::opt_all_options) {
print " <W> install TeXworks front end: $b_addoneditor\n";
}
if ($media ne "NET") {
@@ -845,14 +845,14 @@ EOF
if (unix()) {
if (("\u$answer" eq 'L') and !$vars{'instopt_portable'}) {
my $home = getenv('HOME');
- $home = getenv('USERPROFILE') if (win32());
+ $home = getenv('USERPROFILE') if (wndws());
$home ||= '~';
toggle 'instopt_adjustpath';
if ($vars{'instopt_adjustpath'}) {
print "New value for binary directory [$sys_bin]: ";
chomp($answer=<STDIN>);
$vars{'tlpdbopt_sys_bin'} = "$answer" if (length $answer);
- $vars{'tlpdbopt_sys_bin'} =~ s@\\@/@g if (win32());
+ $vars{'tlpdbopt_sys_bin'} =~ s@\\@/@g if (wndws());
$vars{'tlpdbopt_sys_bin'} =~ s/^~/$home/;
if ($vars{'tlpdbopt_sys_bin'}=~/^(.*)\/bin$/) {
$vars{'tlpdbopt_sys_man'}="$1/man";
@@ -861,13 +861,13 @@ EOF
print "New value for man directory [$vars{'tlpdbopt_sys_man'}]: ";
chomp($answer=<STDIN>);
$vars{'tlpdbopt_sys_man'}="$answer" if (length $answer);
- $vars{'tlpdbopt_sys_man'} =~ s@\\@/@g if (win32());
+ $vars{'tlpdbopt_sys_man'} =~ s@\\@/@g if (wndws());
$vars{'tlpdbopt_sys_man'} =~ s/^~/$home/;
print "New value for info directory [$vars{'tlpdbopt_sys_info'}]: ";
chomp($answer=<STDIN>);
$vars{'tlpdbopt_sys_info'}="$answer" if (length $answer);
- $vars{'tlpdbopt_sys_info'} =~ s@\\@/@g if (win32());
+ $vars{'tlpdbopt_sys_info'} =~ s@\\@/@g if (wndws());
$vars{'tlpdbopt_sys_info'} =~ s/^~/$home/;
}
return $command{'self'};
@@ -875,7 +875,7 @@ EOF
} else {
if (("\u$answer" eq 'L') and !$vars{'instopt_portable'}) {
my $home = getenv('HOME');
- $home = getenv('USERPROFILE') if (win32());
+ $home = getenv('USERPROFILE') if (wndws());
$home ||= '~';
toggle 'instopt_adjustpath';
return $command{'self'};
@@ -884,7 +884,7 @@ EOF
# # tlpdbopt_desktop_integration, tlpdbopt_file_assocs
#
-# if (win32() || $::opt_all_options) {
+# if (wndws() || $::opt_all_options) {
# if ("\u$answer" eq 'M' and !$vars{'instopt_portable'}) {
# toggle 'tlpdbopt_desktop_integration';
# return $command{'self'};
@@ -940,7 +940,7 @@ EOF
} elsif (defined $command{"\u$answer"}) {
return $command{"\u$answer"};
- } elsif (("\u$answer" eq 'W') && ($::opt_all_options || win32()) &&
+ } elsif (("\u$answer" eq 'W') && ($::opt_all_options || wndws()) &&
!$opt_in_place ) {
toggle 'collection-texworks';
return $command{'self'};
@@ -1028,7 +1028,7 @@ sub main_menu {
my $b_fmt=button($vars{'tlpdbopt_create_formats'});
my $b_letter=button($vars{'instopt_letter'});
my $b_deskint=button($vars{'tlpdbopt_desktop_integration'}, \@::deskintdesc);
- if (win32()) {
+ if (wndws()) {
my $b_fileassoc=button($vars{'tlpdbopt_file_assocs'}, \@::fileassocdesc);
}
my $b_admin=button($vars{'tlpdbopt_w32_multi_user'});
@@ -1138,7 +1138,7 @@ EOF
print " $b_src install macro/font source tree\n";
}
}
- if (win32()) {
+ if (wndws()) {
if (!$vars{'instopt_portable'}) {
print " $b_path adjust search path\n";
print " $b_deskint add menu items, shortcuts, etc.\n";
@@ -1151,7 +1151,7 @@ EOF
}
print " $b_path create symlinks to standard directories\n"
- unless ($vars{'instopt_portable'} || win32());
+ unless ($vars{'instopt_portable'} || wndws());
print " $b_adjustrepo after install, set CTAN as source "
. "for package updates\n"