summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-08-16 21:47:57 +0000
committerKarl Berry <karl@freefriends.org>2016-08-16 21:47:57 +0000
commit43e6ff9a9d16337d8fbd9be2d4b4de9868c5ec13 (patch)
treeec1aa2366db4471a4c56e01a74a3cbe46b7a00e9 /Build
parent54563336da5800024cf4ec710295814020413f5b (diff)
latexpand (16aug16)
git-svn-id: svn://tug.org/texlive/trunk@41873 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rwxr-xr-xBuild/source/texk/texlive/linked_scripts/latexpand/latexpand64
-rwxr-xr-xBuild/source/texk/texlive/linked_scripts/texlive/tlmgr.pl8
2 files changed, 45 insertions, 27 deletions
diff --git a/Build/source/texk/texlive/linked_scripts/latexpand/latexpand b/Build/source/texk/texlive/linked_scripts/latexpand/latexpand
index e8694e7fe25..f98c0ee9598 100755
--- a/Build/source/texk/texlive/linked_scripts/latexpand/latexpand
+++ b/Build/source/texk/texlive/linked_scripts/latexpand/latexpand
@@ -1,6 +1,6 @@
#!/usr/bin/perl
# Inspired by latexpand by D. Musliner, University of Michigan
-# 2012, 2013, 2014, 2015: Matthieu Moy <Matthieu.Moy@imag.fr>
+# 2012, 2013, 2014, 2015, 2016: Matthieu Moy <Matthieu.Moy@imag.fr>
# BSD License
use strict;
@@ -53,7 +53,7 @@ sub get_version
{
# $VERSION's value will be substituted by 'make dist', but the
# next line won't (the string has to be broken to avoid it).
- my $VERSION = 'v1.2-1-g47e2cee';
+ my $VERSION = 'v1.3';
if ($VERSION eq '@LATEXPAND' . '_VERSION@') {
my($vol,$dir,$file) = File::Spec->splitpath($0);
chdir($dir);
@@ -78,8 +78,8 @@ if ($empty_comments) {
}
if ($output && $output ne "-") {
- open OUTPUT, '>', "$output" or die $!;
- STDOUT->fdopen(\*OUTPUT, 'w') or die $!;
+ open (my $OUTPUT, '>', "$output") or die $!;
+ STDOUT->fdopen(\*$OUTPUT, 'w') or die $!;
}
sub say
@@ -105,9 +105,8 @@ sub process_file
my $file = shift;
my $prefix = (shift || "");
my $in_comment = 0;
- local(*FILE);
- open(FILE, $file) or die "could not open input file '$file'\n";
- while (my $line = <FILE>) {
+ open(my $FILE, "<", $file) or die "could not open input file '$file'\n";
+ while (my $line = <$FILE>) {
if ($line =~ /^[ \t]*\\endinput/) {
$line =~ s/(\\endinput.*)\n/% $1/;
$in_comment = 1;
@@ -123,17 +122,18 @@ sub process_file
# ignored by LaTeX, but we don't allow anything before
# to avoid e.g. \verb|\end{document}| from terminating
# the file.
- if (!$keep_comments && $line =~ /^[ \t]*\\end{document}/) {
+ if (!$keep_comments && $line =~ /^[ \t]*\\end\{document\}/) {
last;
}
}
- close(FILE);
+ close($FILE);
return $in_comment;
}
sub process_line
{
- my ($_, $prefix, $file) = @_;
+ my ($line, $prefix, $file) = @_;
+ $_ = $line;
# Consider \makeatletter only in preamble, because we do want
# to warn on \someCommand{\makeatletter\command@with@arobase}.
if ($in_preamble && /^[^%]*\\makeatletter/) {
@@ -149,13 +149,23 @@ sub process_line
print STDERR "Warning: consider using --makeatletter if the result is not compilable.\n";
}
unless ($keep_comments) {
- if ($empty_comments) {
- s/^%.*$/%/;
- s/([^\\])%.*$/$1%/;
- } else {
- s/^%.*\n//;
- s/([^\\])%.*\n/$1/;
+ if (!$empty_comments) {
+ # Include \n in pattern to avoid matching
+ # comments at end of files
+
+ # remove comments + whitespace-only lines completely
+ s/^\s*%.*\n//;
+
+ # remove only the comment if the line has actual content
+ s/([^\\])%.*\n/$1\n/;
}
+ # Apply the "empty comments" treatment unconditionally
+ # for end-of-files comments not matched above (it
+ # doesn't harm to keep an empty comment sometimes, but
+ # it may harm to leave a real comment if the goal was
+ # to strip them).
+ s/^%.*$/%/;
+ s/([^\\])%.*$/$1%/;
}
unless ($keep_includes) {
@@ -203,7 +213,7 @@ sub process_line
if ($expand_usepackage) {
# Don't bother with before and after text, we just require the
# usepackage to be alone on its line.
- if (my ($package_name) = /^\s*\\usepackage{([^}]*)}\s*(%.*)?$/) {
+ if (my ($package_name) = /^\s*\\usepackage\{([^\}]*)\}\s*(%.*)?$/) {
my $full = find_file($package_name . ".sty", $TEXINPUTS);
if ($full) {
say $prefix . "Found package file: $full\n";
@@ -216,7 +226,7 @@ sub process_line
}
if ($expand_bbl) {
if (my ($before, $bib_name, $after)
- = /^(.*)\\bibliography{([^}]*)}(.*)$/) {
+ = /^(.*)\\bibliography\{([^\}]*)\}(.*)$/) {
# The BBL file is not necessarily $bib_name.
# Take it from the command-line.
print $before . $nl;
@@ -233,7 +243,7 @@ sub process_line
print STDERR "$full\n";
}
}
- if (/^[ \t]*\\begin{document}/) {
+ if (/^[ \t]*\\begin\{document\}/) {
$in_preamble = 0;
if ($makeatletter) {
print '\makeatletter' . $nl;
@@ -257,7 +267,7 @@ sub find_tex_file
die "ERROR: Could not find file [$file]\n";
} else {
print STDERR "Warning: Could not find file [$file]\n";
- return undef;
+ return;
}
}
@@ -334,7 +344,7 @@ problems by outputing a single LaTeX file that contain no comment.
The latest version of latexpand is available here:
- https://gitorious.org/latexpand
+ https://gitlab.com/latexpand/latexpand
Versions are uploaded to ctan.org from time to time:
@@ -342,7 +352,12 @@ Versions are uploaded to ctan.org from time to time:
=head1 BUGS
-Please, report bugs to Matthieu Moy <Matthieu.Moy@imag.fr>.
+Please, report bugs on the issue tracker on the project site:
+
+ https://gitlab.com/latexpand/latexpand/issues
+
+Alternatively, you may email directly the author: Matthieu Moy
+<Matthieu.Moy@imag.fr>.
=head2 Known bugs
@@ -352,6 +367,9 @@ latexpand currently ignores \begin{verbatim} ... \end{verbatim}, and
will therefore process any \include, \input, ... directives that
appear within verbatim environments (while it shouldn't).
+LaTeX comments inside verbatim environments are also incorrectly
+stripped. You can use --keep-comments as a workaround to avoid this.
+
=head3 Comment environment
It would be nice to remove code between \begin{comment} and
@@ -401,4 +419,4 @@ https://lacl.fr/~caubert/notes/portabilite-du-tex.html#dependances
=head1 VERSION
-This is latexpand version v1.2-1-g47e2cee.
+This is latexpand version v1.3.
diff --git a/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl b/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl
index ddefd2433d4..623749755b0 100755
--- a/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl
+++ b/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl
@@ -1,13 +1,13 @@
#!/usr/bin/env perl
-# $Id: tlmgr.pl 41476 2016-06-18 00:45:25Z preining $
+# $Id: tlmgr.pl 41794 2016-08-03 23:11:36Z karl $
#
# Copyright 2008-2016 Norbert Preining
# This file is licensed under the GNU General Public License version 2
# or any later version.
#
-my $svnrev = '$Revision: 41476 $';
-my $datrev = '$Date: 2016-06-18 02:45:25 +0200 (Sat, 18 Jun 2016) $';
+my $svnrev = '$Revision: 41794 $';
+my $datrev = '$Date: 2016-08-04 01:11:36 +0200 (Thu, 04 Aug 2016) $';
my $tlmgrrevision;
my $prg;
if ($svnrev =~ m/: ([0-9]+) /) {
@@ -7843,7 +7843,7 @@ search method). Then, unless cryptographic verification has been
disabled, a signature file (C<texlive.tlpdb.*.asc>) of the checksum file
is downloaded and the signature verified. The signature is created by
the TeX Live Distribution GPG key 0x06BAB6BC, which in turn is signed by
-Karl Berry's key 0x9DEB46C0 and Norbert Preining's key 0x6CACA448. All
+Karl Berry's key 0x30D155AD and Norbert Preining's key 0x6CACA448. All
of these keys are obtainable from the standard key servers.
Additional trusted keys can be added using the C<key> action.