summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts/texlive/fmtutil.pl
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 /Master/texmf-dist/scripts/texlive/fmtutil.pl
parente90782a615eb546cae7930e198e276837f370e9c (diff)
Rename Windows detection macros.
Diffstat (limited to 'Master/texmf-dist/scripts/texlive/fmtutil.pl')
-rwxr-xr-xMaster/texmf-dist/scripts/texlive/fmtutil.pl34
1 files changed, 12 insertions, 22 deletions
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.