From d0bdd61dbdc0d721799a45209b863efa561e4a1a Mon Sep 17 00:00:00 2001 From: Tom Callaway Date: Mon, 14 Dec 2015 14:46:43 -0500 Subject: [PATCH] fix latexpand to work quietly with perl 5.18+ (bz1289520) --- texlive-latexpand-perl518.patch | 48 +++++++++++++++++++++++++++++++++ texlive.spec | 12 ++++++++- 2 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 texlive-latexpand-perl518.patch diff --git a/texlive-latexpand-perl518.patch b/texlive-latexpand-perl518.patch new file mode 100644 index 0000000..5c6cda7 --- /dev/null +++ b/texlive-latexpand-perl518.patch @@ -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; diff --git a/texlive.spec b/texlive.spec index a07791d..6936a66 100644 --- a/texlive.spec +++ b/texlive.spec @@ -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 - 5:2015-17.20150728_r37987 +- fix latexpand to work quietly with perl 5.18+ (bz1289520) + * Mon Nov 30 2015 Tom Callaway - 5:2015-16.20150728_r37987 - add fix (sed -i ...) to bz1241458 - use configure macro (bz1286023)