fix latexpand to work quietly with perl 5.18+ (bz1289520)

This commit is contained in:
Tom Callaway 2015-12-14 14:46:43 -05:00
parent 09eb96e081
commit d0bdd61dbd
2 changed files with 59 additions and 1 deletions

View File

@ -0,0 +1,48 @@
--- latexpand.old 2015-12-14 14:23:11.624505410 -0500
+++ latexpand 2015-12-14 14:37:45.196569657 -0500
@@ -123,7 +123,7 @@ 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;
}
}
@@ -133,7 +133,8 @@ sub process_file
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/) {
@@ -203,7 +204,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 +217,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 +234,7 @@ sub process_line
print STDERR "$full\n";
}
}
- if (/^[ \t]*\\begin{document}/) {
+ if (/^[ \t]*\\begin\{document}/) {
$in_preamble = 0;
if ($makeatletter) {
print '\makeatletter' . $nl;

View File

@ -1,6 +1,6 @@
%global source_date 20150728_r37987
%global tl_version 2015
%global tl_rel 16
%global tl_rel 17
%global tl_release %{tl_rel}.%{source_date}%{?dist}
%global tl_noarch_release %{tl_rel}%{?dist}
%global source_name texlive-%{source_date}-source
@ -58,6 +58,7 @@ Patch3: texlive-20150728-selinux-context.patch
Patch4: texlive-fix-system-teckit.patch
Patch100: texlive-bz979176.patch
Patch101: etex-addlanguage-fix-bz1215257.patch
Patch102: texlive-latexpand-perl518.patch
Source0: %{source_name}.tar.xz
Source1: tl2rpm.c
Source2: texlive.tlpdb
@ -286596,6 +286597,12 @@ rm -rf %{buildroot}%{_texdir}/texmf-dist/doc/info/dir
# bz1241458
sed -i 's|newline{\\Hnewline}|newline{^^J}|g' %{buildroot}%{_texdir}/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-tex4ht.def
# patch latexpand
pushd %{buildroot}%{_texdir}/texmf-dist/scripts/latexpand
patch -p0 < %{_sourcedir}/texlive-latexpand-perl518.patch
# %patch102 -p0
popd
mkdir -p %{buildroot}%{_bindir}
mv %{buildroot}/bin/i386-linux/* %{buildroot}%{_bindir}
for i in `find %{buildroot}%{_bindir} -type f`; do
@ -443379,6 +443386,9 @@ fi
%{_libdir}/pkgconfig/*.pc
%changelog
* Mon Dec 14 2015 Tom Callaway <spot@fedoraproject.org> - 5:2015-17.20150728_r37987
- fix latexpand to work quietly with perl 5.18+ (bz1289520)
* Mon Nov 30 2015 Tom Callaway <spot@fedoraproject.org> - 5:2015-16.20150728_r37987
- add fix (sed -i ...) to bz1241458
- use configure macro (bz1286023)