[latex3-commits] [git/LaTeX3-latex3-latex2e] gh1015: Add \IfFileAtLeastTF (fixes #1015) (3461dada)

Joseph Wright joseph.wright at morningstar2.co.uk
Wed Mar 29 11:34:13 CEST 2023


Repository : https://github.com/latex3/latex2e
On branch  : gh1015
Link       : https://github.com/latex3/latex2e/commit/3461dada775bf45d6996693b4c0a937a6834586c

>---------------------------------------------------------------

commit 3461dada775bf45d6996693b4c0a937a6834586c
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Wed Mar 29 10:13:12 2023 +0100

    Add \IfFileAtLeastTF (fixes #1015)


>---------------------------------------------------------------

3461dada775bf45d6996693b4c0a937a6834586c
 base/changes.txt                                    |  5 +++++
 base/ltclass.dtx                                    |  8 +++++++-
 base/testfiles/github-1015.lvt                      | 21 +++++++++++++++++++++
 .../github-0675.tlg => testfiles/github-1015.tlg}   |  6 +++---
 4 files changed, 36 insertions(+), 4 deletions(-)

diff --git a/base/changes.txt b/base/changes.txt
index fd6eec48..6eae7a37 100644
--- a/base/changes.txt
+++ b/base/changes.txt
@@ -6,6 +6,11 @@ completeness or accuracy and it contains some references to files that
 are not part of the distribution.
 ================================================================================
 
+2023-03-28  Joseph Wright  <FJoseph.Wright at latex-project.org>
+
+	* ltspltclassace.dtx:
+	Add \IfFileAtLeastTF (gh/1015)
+
 2023-03-28  David Carlisle  <David.Carlisle at latex-project.org>
 
 	* ltfinal.dtx: Restore groups to \MakeUppercase and
diff --git a/base/ltclass.dtx b/base/ltclass.dtx
index f6d5994d..fb4b5065 100644
--- a/base/ltclass.dtx
+++ b/base/ltclass.dtx
@@ -33,7 +33,7 @@
 %<*driver>
 % \fi
 \ProvidesFile{ltclass.dtx}
-             [2022/11/16 v1.5f LaTeX Kernel (Class & Package Interface)]
+             [2023/03/29 v1.5g LaTeX Kernel (Class & Package Interface)]
 % \iffalse
 \documentclass{ltxdoc}
 \GetFileInfo{ltclass.dtx}
@@ -324,6 +324,7 @@
 %
 % \DescribeMacro\IfPackageAtLeastTF
 % \DescribeMacro\IfClassAtLeastTF
+% \DescribeMacro\IfFileAtLeastTF
 % \DescribeMacro\@ifpackagelater
 % \DescribeMacro\@ifclasslater
 % \changes{v1.1i}{2013/07/07}{Correctly describe how the date in
@@ -890,12 +891,14 @@
 %
 %  \begin{macro}{\IfPackageAtLeastTF}
 %  \begin{macro}{\IfClassAtLeastTF}
+%  \begin{macro}{\IfFileAtLeastTF}
 %  \begin{macro}{\IfFormatAtLeastTF}
 % |\IfFormatAtLeastTF{YYYY/MM/DD}{|\meta{true
 %    code}|}{|\meta{false code}|}|
 %    Test if the format is later or equal to the given date.
 % \changes{v1.3k}{2020/04/07}{Macro added; also in rollback (gh/168)}
 % \changes{v1.4e}{2021/07/19}{Drop \cs{@onlypreamble}}
+% \changes{v1.5g}{2023/03/28}{Added \cs{IfFileAtLeastTF} (gh/1015)}
 %    \begin{macrocode}
 %</2ekernel>
 %<*2ekernel|latexrelease>
@@ -904,6 +907,7 @@
 \def\IfFormatAtLeastTF{\@ifl at t@r\fmtversion}
 \let\IfPackageAtLeastTF\@ifpackagelater
 \let\IfClassAtLeastTF\@ifclasslater
+\long\def\IfFileAtLeastTF#1{\expandafter\@ifl at t@r\csname ver@#1\endcsname}
 %    \end{macrocode}
 %    For rollback pretend it was available since the beginning of dawn.
 %    \begin{macrocode}
@@ -914,12 +918,14 @@
 %<latexrelease>\def\IfFormatAtLeastTF{\@ifl at t@r\fmtversion}
 %<latexrelease>\let\IfPackageAtLeastTF\@ifpackagelater
 %<latexrelease>\let\IfClassAtLeastTF\@ifclasslater
+%<latexrelease>\long\def\IfFileAtLeastTF#1{\expandafter\@ifl at t@r\csname ver@#1\endcsname}
 %<latexrelease>\EndIncludeInRelease
 %<*2ekernel>
 %    \end{macrocode}
 %  \end{macro}
 %  \end{macro}
 %  \end{macro}
+%  \end{macro}
 %
 % \begin{macro}{\@ifl at ter}
 % \changes{v1.4e}{2021/07/19}{Drop \cs{@onlypreamble}}
diff --git a/base/testfiles/github-1015.lvt b/base/testfiles/github-1015.lvt
new file mode 100644
index 00000000..b7357cdc
--- /dev/null
+++ b/base/testfiles/github-1015.lvt
@@ -0,0 +1,21 @@
+\documentclass{article}
+
+\input{test2e}
+
+\START
+
+\makeatletter
+
+\ProvidesFile{github-1015.lvt}[2023-03-29 v1.0 bug]
+
+\IfFileAtLeastTF{github-1015.lvt}{2023-03-29}{\typeout{GOOD}}{\typeout{BAD}}
+
+% roll back somewhat ...
+
+\OMIT
+\RequirePackage[2018/12/01]{latexrelease}
+\TIMO
+ 
+\IfFileAtLeastTF{github-1015.lvt}{2023-03-29}{\typeout{GOOD}}{\typeout{BAD}}
+
+\END
diff --git a/base/testfiles-lthooks/github-0675.tlg b/base/testfiles/github-1015.tlg
similarity index 65%
copy from base/testfiles-lthooks/github-0675.tlg
copy to base/testfiles/github-1015.tlg
index cb25ed26..38b24c1d 100644
--- a/base/testfiles-lthooks/github-0675.tlg
+++ b/base/testfiles/github-1015.tlg
@@ -1,5 +1,5 @@
 This is a generated file for the LaTeX2e validation system.
 Don't change this file in any respect.
-bar
-foo
-baz
+File: github-1015.lvt ....-..-.. v... bug
+GOOD
+GOOD





More information about the latex3-commits mailing list.