texlive[54445] Master/tlpkg/tlpostcode/haranoaji-tlpost.pl:

commits+hironobu at tug.org commits+hironobu at tug.org
Sat Mar 21 02:28:40 CET 2020


Revision: 54445
          http://tug.org/svn/texlive?view=revision&revision=54445
Author:   hironobu
Date:     2020-03-21 02:28:40 +0100 (Sat, 21 Mar 2020)
Log Message:
-----------
haranoaji-tlpost.pl: update from M. Hosoda

Modified Paths:
--------------
    trunk/Master/tlpkg/tlpostcode/haranoaji-tlpost.pl

Modified: trunk/Master/tlpkg/tlpostcode/haranoaji-tlpost.pl
===================================================================
--- trunk/Master/tlpkg/tlpostcode/haranoaji-tlpost.pl	2020-03-21 00:48:34 UTC (rev 54444)
+++ trunk/Master/tlpkg/tlpostcode/haranoaji-tlpost.pl	2020-03-21 01:28:40 UTC (rev 54445)
@@ -38,14 +38,17 @@
 use Encode;
 
 if (win32 ()) {
+    # These packages are not necessarily available on non-Windows, so
+    # read them at runtime instead of compile time.
+    require Encode::Locale;
+    Encode::Locale->import ();
+
+    # ':encoding(console_{in|out})' requires Encode::Locale package.
     binmode (STDIN, ':encoding(console_in)');
     binmode (STDOUT, ':encoding(console_out)');
     binmode (STDERR, ':encoding(console_out)');
     print "haranoaji-tlpost\n";
-    
-    # These packages are not necessarily available on non-Windows, so
-    # read them at runtime instead of compile time.
-    require Encode::Locale;
+
     require Win32::API;
     Win32::API->import ();
 } else {
@@ -323,7 +326,7 @@
     my ($filename, $contents) = @_;
 
     # TODO: Create file by -W API on Windows
-    open (my $fh, ">:raw", encode ('locale', $filename)) or
+    open (my $fh, ">:raw", encode ('locale_fs', $filename)) or
         die ("Open failed: ${filename}\n");
     print $fh $contents;
     close $fh;
@@ -334,7 +337,7 @@
     my ($dirname) = @_;
 
     # TODO: Directory existence check by -W API on Windows
-    if ( -d encode ('locale', $dirname) ) {
+    if ( -d encode ('locale_fs', $dirname) ) {
         return 1;
     }
 
@@ -346,7 +349,7 @@
     my ($filename) = @_;
 
     # TODO: File existence check by -W API on Windows
-    if ( -f encode ('locale', $filename) ) {
+    if ( -f encode ('locale_fs', $filename) ) {
         return 1;
     }
 
@@ -358,7 +361,7 @@
     my ($filename) = @_;
 
     # TODO: Remove file by -W API on Windows
-    return unlink (encode ('locale', $filename));
+    return unlink (encode ('locale_fs', $filename));
 }
 
 # Create symbolic link



More information about the tex-live-commits mailing list.