diff options
author | Karl Berry <karl@freefriends.org> | 2023-04-11 22:26:39 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2023-04-11 22:26:39 +0000 |
commit | 4ef8929c4347eab8287f8d1a50247c0bc8e8ae5d (patch) | |
tree | a5867e3535bf61acde48fac2d81aff1479cda904 /Master/texmf-dist/scripts/latexindent | |
parent | 1b1ffb2c7d12640bed14bcd0a53a3bd22f0ae29f (diff) |
latexindent (12apr23)
git-svn-id: svn://tug.org/texlive/trunk@66828 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts/latexindent')
6 files changed, 18 insertions, 20 deletions
diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/Document.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/Document.pm index 4a99721a344..16a01bf2092 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/Document.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/Document.pm @@ -240,15 +240,7 @@ sub output_indented_text { } elsif ( $switches{outputToFile} ) { - # diacritics in file names (highlighted in https://github.com/cmhughes/latexindent.pl/pull/439) - # - # note, related: - # - # git config --add core.quotePath false - ${$self}{outputToFile} = decode( "utf-8", ${$self}{outputToFile} ); - $logger->info("Outputting to file ${$self}{outputToFile}"); - open( OUTPUTFILE, ">", ${$self}{outputToFile} ); print OUTPUTFILE ${$self}{body}; close(OUTPUTFILE); diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/FileExtension.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/FileExtension.pm index b0f49f246db..b61ffc1bb47 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/FileExtension.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/FileExtension.pm @@ -21,6 +21,7 @@ use PerlIO::encoding; use open ':std', ':encoding(UTF-8)'; use File::Basename; # to get the filename and directory path use Exporter qw/import/; +use Encode qw/decode/; use LatexIndent::GetYamlSettings qw/%mainSettings/; use LatexIndent::Switches qw/%switches $is_check_switch_active/; use LatexIndent::LogFile qw/$logger/; @@ -114,7 +115,12 @@ sub file_extension_check { $logger->info("*-o switch active: output file check"); - ${$self}{outputToFile} = $switches{outputToFile}; + # diacritics in file names (highlighted in https://github.com/cmhughes/latexindent.pl/pull/439) + # + # note, related: + # + # git config --add core.quotePath false + ${$self}{outputToFile} = decode( "utf-8", $switches{outputToFile} ); if ( $fileName eq "-" and $switches{outputToFile} =~ m/^\+/ ) { $logger->info("STDIN input mode active, -o switch is removing all + symbols"); @@ -124,7 +130,7 @@ sub file_extension_check { # the -o file name might begin with a + symbol if ( $switches{outputToFile} =~ m/^\+(.*)/ and $1 ne "+" ) { $logger->info("-o switch called with + symbol at the beginning: ${$self}{outputToFile}"); - ${$self}{outputToFile} = ${$self}{baseName} . $1; + ${$self}{outputToFile} = decode( "utf-8", ${$self}{baseName} . $1 ); $logger->info("output file is now: ${$self}{outputToFile}"); } @@ -137,7 +143,8 @@ sub file_extension_check { # if there is no extension, then add the extension from the file to be operated upon if ( !$ext ) { - $logger->info("-o switch called with file name without extension: $switches{outputToFile}"); + $logger->info( + "-o switch called with file name without extension: " . decode( "utf-8", $switches{outputToFile} ) ); ${$self}{outputToFile} = $name . ( $name =~ m/\.\z/ ? q() : "." ) . $strippedFileExtension; $logger->info( "Updated to ${$self}{outputToFile} as the file extension of the input file is $strippedFileExtension"); diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/LogFile.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/LogFile.pm index 93b6ad0930a..5847ca42f42 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/LogFile.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/LogFile.pm @@ -129,12 +129,9 @@ ENDQUOTE # cruft directory ${$self}{cruftDirectory} = $switches{cruftDirectory} || ( dirname ${$self}{fileName} ); - # diacritics in cruft directory (highlighted in https://github.com/cmhughes/latexindent.pl/pull/439) - ${$self}{cruftDirectory} = decode( "utf-8", ${$self}{cruftDirectory} ); - # if cruft directory does not exist if ( !( -d ${$self}{cruftDirectory} ) ) { - $logger->fatal("*Could not find directory ${$self}{cruftDirectory}"); + $logger->fatal( "*Could not find directory " . decode( "utf-8", ${$self}{cruftDirectory} ) ); $logger->fatal("Exiting, no indentation done."); $self->output_logfile(); exit(6); @@ -143,6 +140,8 @@ ENDQUOTE my $logfileName = ( $switches{cruftDirectory} ? ${$self}{cruftDirectory} . "/" : '' ) . ( $switches{logFileName} || "indent.log" ); + $logfileName = decode( "utf-8", $logfileName ); + # details of the script to log file $logger->info("*$FindBin::Script version $versionNumber, $versionDate, a script to indent .tex files"); $logger->info("$FindBin::Script lives here: $FindBin::RealBin/"); @@ -247,7 +246,7 @@ ENDQUOTE } $logger->info("*Directory for backup files and $logfileName:"); - $logger->info("${$self}{cruftDirectory}"); + $logger->info( $switches{cruftDirectory} ? decode( "utf-8", ${$self}{cruftDirectory} ) : ${$self}{cruftDirectory} ); # output location of modules if ( $FindBin::Script eq 'latexindent.pl' or ( $FindBin::Script eq 'latexindent.exe' and $switches{trace} ) ) { diff --git a/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm b/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm index 457e9c83bf9..998d3dbfe3f 100644 --- a/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm +++ b/Master/texmf-dist/scripts/latexindent/LatexIndent/Version.pm @@ -20,6 +20,6 @@ use warnings; use Exporter qw/import/; our @EXPORT_OK = qw/$versionNumber $versionDate/; -our $versionNumber = '3.20.5'; -our $versionDate = '2023-04-07'; +our $versionNumber = '3.20.6'; +our $versionDate = '2023-04-11'; 1 diff --git a/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml b/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml index 51a8b222298..309ba003af5 100755 --- a/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml +++ b/Master/texmf-dist/scripts/latexindent/defaultSettings.yaml @@ -1,5 +1,5 @@ # -# latexindent.pl, version 3.20.5, 2023-04-07 +# latexindent.pl, version 3.20.6, 2023-04-11 # # defaultSettings.yaml, the default settings for latexindent.pl # diff --git a/Master/texmf-dist/scripts/latexindent/latexindent.pl b/Master/texmf-dist/scripts/latexindent/latexindent.pl index 90e9408b0aa..8a041b5435c 100755 --- a/Master/texmf-dist/scripts/latexindent/latexindent.pl +++ b/Master/texmf-dist/scripts/latexindent/latexindent.pl @@ -1,5 +1,5 @@ #!/usr/bin/env perl -# latexindent.pl, version 3.20.5, 2023-04-07 +# latexindent.pl, version 3.20.6, 2023-04-11 # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by |