[latex3-commits] [git/LaTeX3-latex3-latex3] version-check: Add dependency checking for l3backend (25a680db1)

PhelypeOleinik tex.phelype at gmail.com
Mon Aug 3 05:33:36 CEST 2020


Repository : https://github.com/latex3/latex3
On branch  : version-check
Link       : https://github.com/latex3/latex3/commit/25a680db1c1ccced268c716f974e05724dad2501

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

commit 25a680db1c1ccced268c716f974e05724dad2501
Author: PhelypeOleinik <tex.phelype at gmail.com>
Date:   Mon Aug 3 00:33:36 2020 -0300

    Add dependency checking for l3backend


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

25a680db1c1ccced268c716f974e05724dad2501
 l3backend/l3backend-basics.dtx | 38 +++++++++++++++++++++++++++++++++-----
 1 file changed, 33 insertions(+), 5 deletions(-)

diff --git a/l3backend/l3backend-basics.dtx b/l3backend/l3backend-basics.dtx
index 00367dea5..b2102dfd1 100644
--- a/l3backend/l3backend-basics.dtx
+++ b/l3backend/l3backend-basics.dtx
@@ -69,27 +69,55 @@
 % place in the files.
 %    \begin{macrocode}
 %<*package>
+\def\ExplBackendFileDate{2020-06-29}
 \ProvidesExplFile
 %<*dvipdfmx>
-  {l3backend-dvipdfmx.def}{2020-06-29}{}
+  {l3backend-dvipdfmx.def}{\ExplBackendFileDate}{}
   {L3 backend support: dvipdfmx}
 %</dvipdfmx>
 %<*dvips>
-  {l3backend-dvips.def}{2020-06-29}{}
+  {l3backend-dvips.def}{\ExplBackendFileDate}{}
   {L3 backend support: dvips}
 %</dvips>
 %<*dvisvgm>
-  {l3backend-dvisvgm.def}{2020-06-29}{}
+  {l3backend-dvisvgm.def}{\ExplBackendFileDate}{}
   {L3 backend support: dvisvgm}
 %</dvisvgm>
 %<*pdfmode>
-  {l3backend-pdfmode.def}{2020-06-29}{}
+  {l3backend-pdfmode.def}{\ExplBackendFileDate}{}
   {L3 backend support: PDF mode}
 %</pdfmode>
 %<*xdvipdfmx>
-  {l3backend-xdvipdfmx.def}{2020-06-29}{}
+  {l3backend-xdvipdfmx.def}{\ExplBackendFileDate}{}
   {L3 backend support: xdvipdfmx}
 %</xdvipdfmx>
+%    \end{macrocode}
+%
+%   Check if the loaded kernel is at least enough to load this file.
+%   The kernel date has to be at least equal to \cs{ExplBackendFileDate}
+%   or later.  If \cs{__kernel_dependency_version_check:Nn} doesn't
+%   exist we're loading in an older kernel, so it's an error anyway.
+%   With time, this test should vanish and only the dependency check
+%   should remain.
+%    \begin{macrocode}
+\cs_if_exist:NTF \__kernel_dependency_version_check:Nn
+  {
+    \__kernel_dependency_version_check:Nn \ExplBackendFileDate
+%<dvipdfmx>      {l3backend-dvipdfmx.def}
+%<dvips>      {l3backend-dvips.def}
+%<dvisvgm>      {l3backend-dvisvgm.def}
+%<pdfmode>      {l3backend-pdfmode.def}
+%<xdvipdfmx>      {l3backend-xdvipdfmx.def}
+  }
+  {
+    \cs_if_exist_use:cF { @latex at error } { \errmessage }
+      {
+        Mismatched~LaTeX~support~files~detected. \MessageBreak
+        Loading~aborted!
+      }
+      { \use:c { @ehd } }
+    \tex_endinput:D
+  }
 %</package>
 %    \end{macrocode}
 %





More information about the latex3-commits mailing list.