diff options
author | Karl Berry <karl@freefriends.org> | 2012-05-13 22:53:17 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-05-13 22:53:17 +0000 |
commit | 99033febb965ae8211c278e37852a490cb829de2 (patch) | |
tree | 79a64b86e569877cff09ad97ad217bce9083c6ac | |
parent | 1945bf45e83fb4483a30a328d2f93b9dec0e4c32 (diff) |
avoid long lines, better file-opening/closing
diagnostics, try to be clearer that fc-cache
really is run on windows.
git-svn-id: svn://tug.org/texlive/trunk@26330 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/tlpkg/tlpostcode/xetex.pl | 47 |
1 files changed, 28 insertions, 19 deletions
diff --git a/Master/tlpkg/tlpostcode/xetex.pl b/Master/tlpkg/tlpostcode/xetex.pl index ad94e9ac506..ac109c5c515 100644 --- a/Master/tlpkg/tlpostcode/xetex.pl +++ b/Master/tlpkg/tlpostcode/xetex.pl @@ -33,29 +33,31 @@ sub do_remove { } sub do_install { - # bin-installs font-config related stuff + # fontconfig-related stuff. chomp( my $fcache = `kpsewhich -var-value=FC_CACHEDIR` ) ; chomp( my $fconf = `kpsewhich -var-value=FONTCONFIG_PATH` ) ; if (-r "$texdir/bin/win32/xetex.exe") { - # we have installed w32, so put it into texmfsysvar + # we have installed w32, so put it into texmfsysvar. mkdirhier($fcache); mkdirhier($fconf); TeXLive::TLUtils::rmtree($fcache); TeXLive::TLUtils::rmtree($fconf); - my @cpycmd; + my @cpycmd = (); if (win32()) { push @cpycmd, "xcopy", "/e", "/i", "/q", "/y"; } else { push @cpycmd, "cp", "-R"; } + + # copy trees from install area. + my $postxetex = "$texdir/tlpkg/tlpostcode/xetex"; system(@cpycmd, - (win32() ? conv_to_w32_path("$texdir/tlpkg/tlpostcode/xetex/conf") : - "$texdir/tlpkg/tlpostcode/xetex/conf"), - (win32() ? conv_to_w32_path($fconf) : $fconf)); + (win32() ? conv_to_w32_path("$postxetex/conf") : "$postxetex/conf"), + (win32() ? conv_to_w32_path($fconf) : $fconf)); system(@cpycmd, - (win32() ? conv_to_w32_path("$texdir/tlpkg/tlpostcode/xetex/cache") : - "$texdir/tlpkg/tlpostcode/xetex/cache"), - (win32() ? conv_to_w32_path($fcache) : $fcache)); + (win32() ? conv_to_w32_path("$postxetex/cache") : "$postxetex/cache"), + (win32() ? conv_to_w32_path($fcache) : $fcache)); + if (open(FONTSCONF, "<$texdir/tlpkg/tlpostcode/xetex/conf/fonts.conf")) { my @lines = <FONTSCONF>; close(FONTSCONF); @@ -72,22 +74,22 @@ sub do_install { } close(FONTSCONF); } else { - warn("Cannot open $fconf/fonts.conf for writing\n"); + warn("open(>$fconf/fonts.conf) failed: $!"); } } else { - warn("Cannot open $texdir/tlpkg/tlpostcode/xetex/conf/fonts.conf\n"); + warn("open($texdir/tlpkg/tlpostcode/xetex/conf/fonts.conf) failed: $!"); } } - # call fc-cache but only when we install on w32! if (win32()) { + # call fc-cache but only when we install on w32! info("Running fc-cache -v -r\n"); - log(`fc-cache -v -r 2>&1`); - #system("fc-cache","-v", "-r"); + log( `fc-cache -v -r 2>&1` ); # run it, log output + } else { - # create a texlive-fontconfig.conf file in $texmfsysvar + # non-Windows: create texlive-fontconfig.conf file in $texmfsysvar. mkdirhier("$fconf/conf"); if (!open(FONTSCONF, ">$fconf/texlive-fontconfig.conf")) { - warn("Cannot open $fconf/texlive-fontconfig.conf for writing\n"); + warn("open(>$fconf/texlive-fontconfig.conf): $!"); } else { print FONTSCONF '<?xml version="1.0"?> <!DOCTYPE fontconfig SYSTEM "fonts.dtd"> @@ -97,14 +99,21 @@ sub do_install { print FONTSCONF " <dir>$texdir/texmf-dist/fonts/$t</dir>\n"; } print FONTSCONF "</fontconfig>\n"; - close(FONTSCONF) || tlwarn("Cannot close filehandle for texmfsysvar/fonts/conf/texlive-fontconfig.conf\n"); + close(FONTSCONF) + || tlwarn("close($fconf/texlive-fontconfig.conf) failed: $!"); } + # cygwin specific warning - # we don't have platform available ... + # we don't have our platform name available ... chomp(my $un = `uname`); if ($un =~ m/cygwin/i) { if (! -r "/usr/bin/cygfontconfig-1.dll") { - printf STDERR "\nXeTeX on Cygwin requires fontconfig.\nPlease run cygwin's setup program and install the fontconfig package.\n"; + printf STDERR <<CYGWIN_XETEX; + +XeTeX on Cygwin requires fontconfig. +Please run cygwin's setup program and install the fontconfig package. + +CYGWIN_XETEX } } } |