[latex3-commits] [git/LaTeX3-latex3-latex3] master: Move GetIdInfo from l3bootstrap to l3file (517fba8)

Bruno Le Floch bruno at le-floch.fr
Fri Mar 1 20:54:52 CET 2019


Repository : https://github.com/latex3/latex3
On branch  : master
Link       : https://github.com/latex3/latex3/commit/517fba81f0b68179541785a53716b6c83abc39d6

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

commit 517fba81f0b68179541785a53716b6c83abc39d6
Author: Bruno Le Floch <bruno at le-floch.fr>
Date:   Fri Mar 1 20:52:45 2019 +0100

    Move GetIdInfo from l3bootstrap to l3file
    
    Since we don't use \GetIdInfo anymore (since a long time ago) there
    is no good reason to define it before having all the nice l3tl tools


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

517fba81f0b68179541785a53716b6c83abc39d6
 l3kernel/expl3.dtx                      |    4 --
 l3kernel/l3bootstrap.dtx                |   97 -------------------------------
 l3kernel/l3file.dtx                     |   70 ++++++++++++++++++++++
 l3kernel/testfiles/m3expl001.luatex.tlg |    4 ++
 l3kernel/testfiles/m3expl001.ptex.tlg   |    4 ++
 l3kernel/testfiles/m3expl001.tlg        |    4 ++
 l3kernel/testfiles/m3expl001.uptex.tlg  |    4 ++
 l3kernel/testfiles/m3expl001.xetex.tlg  |    4 ++
 l3kernel/testfiles/m3expl003.luatex.tlg |    4 ++
 l3kernel/testfiles/m3expl003.ptex.tlg   |    4 ++
 l3kernel/testfiles/m3expl003.tlg        |    4 ++
 l3kernel/testfiles/m3expl003.uptex.tlg  |    4 ++
 l3kernel/testfiles/m3expl003.xetex.tlg  |    4 ++
 13 files changed, 110 insertions(+), 101 deletions(-)

diff --git a/l3kernel/expl3.dtx b/l3kernel/expl3.dtx
index adfc359..d2dce92 100644
--- a/l3kernel/expl3.dtx
+++ b/l3kernel/expl3.dtx
@@ -1251,10 +1251,6 @@
 % \end{variable}
 % \end{macro}
 %
-% \begin{macro}{\GetIdInfo}
-%   This is implemented right at the start of \texttt{l3bootstrap.dtx}.
-% \end{macro}
-%
 % \begin{macro}{\ProvidesExplPackage, \ProvidesExplClass, \ProvidesExplFile}
 %   For other packages and classes building on this one it is convenient
 %   not to need \cs{ExplSyntaxOn} each time.
diff --git a/l3kernel/l3bootstrap.dtx b/l3kernel/l3bootstrap.dtx
index 053c731..3744f32 100644
--- a/l3kernel/l3bootstrap.dtx
+++ b/l3kernel/l3bootstrap.dtx
@@ -22,103 +22,6 @@
 %
 % for those people who are interested.
 %
-%<*driver|package>
-% \begin{macro}{\GetIdInfo}
-% \begin{macro}{\GetIdInfoAuxI, \GetIdInfoAuxII, \GetIdInfoAuxIII}
-%   The idea here is to extract out the information needed from a standard
-%   \textsc{svn} \texttt{Id} line, but to avoid a line that would get
-%   changed when the file is checked in. Hence the fact that none of the
-%   lines here include both a dollar sign and the \texttt{Id} keyword!
-%
-%   At this stage, no test has taken place for the \eTeX{} extensions, and
-%   so using \tn{protected} could give an error. To avoid that, it is used
-%   by csname: if it's not available, the bootstrap code will bail out at
-%   the point of testing for the necessary primitives, while if it is available
-%   then \cs{GetIdInfo} and so on will be properly protected. All of this is
-%   then done in a group to avoid leaving \tn{protected} about as equivalent
-%   to \tn{relax} if the extensions are unavailable.
-%    \begin{macrocode}
-\begingroup
-  \csname protected\endcsname\gdef\GetIdInfo
-    {%
-      \begingroup
-        \catcode 32 = 10 %
-        \GetIdInfoAuxI
-    }%
-%    \end{macrocode}
-%   A first check for a completely empty \textsc{svn} field. If that is
-%   not the case, there is a second case when a file created using
-%   \texttt{svn cp} but has not been checked in. That leaves a special
-%   marker \texttt{-1} version, which has no further data. Dealing correctly
-%   with that is the reason for the space in the line to use
-%   \cs{GetIdInforAuxII}.
-%    \begin{macrocode}
-  \csname protected\endcsname\gdef\GetIdInfoAuxI$#1$#2%
-    {%
-      \def\tempa{#1}%
-      \def\tempb{Id}%
-      \ifx\tempa\tempb
-        \def\tempa
-          {%
-            \endgroup
-            \def\ExplFileDate{0000/00/00}%
-            \def\ExplFileDescription{#2}%
-            \def\ExplFileName{[unknown]}%
-            \def\ExplFileExtension{[unknown extension]}%
-            \def\ExplFileVersion{-1}%
-          }%
-      \else
-        \def\tempa
-          {%
-            \endgroup
-            \def\ExplFileDescription{#2}%
-            \GetIdInfoAuxII$#1 $%
-          }%
-      \fi
-      \tempa
-    }%
-%    \end{macrocode}
-%   Here, |#1| is |Id|, |#2| is the file name, |#3| is the extension,
-%   |#4| is the version, |#5| is the check in date and |#6| is the check in
-%   time and user, plus some trailing spaces. If |#4| is the marker |-1| value
-%   then |#5| and |#6| are empty.
-%    \begin{macrocode}
-  \csname protected\endcsname\gdef\GetIdInfoAuxII$#1 #2.#3 #4 #5 #6$%
-    {%
-      \def\ExplFileName{#2}%
-      \def\ExplFileExtension{#3}%
-      \def\ExplFileVersion{#4}%
-      \begingroup
-        \def\tempa{#4}%
-        \def\tempb{-1}%
-        \ifx\tempa\tempb
-          \def\tempa
-            {%
-              \endgroup
-              \def\ExplFileDate{0000/00/00}%
-            }%
-        \else
-          \def\tempa
-            {%
-              \endgroup
-              \GetIdInfoAuxIII$#5$%
-            }%
-        \fi
-        \tempa
-    }%
-%    \end{macrocode}
-%   Convert an \textsc{svn}-style date into a \LaTeX{}-style one.
-%    \begin{macrocode}
-  \csname protected\endcsname\gdef\GetIdInfoAuxIII$#1-#2-#3$%
-    {%
-      \def\ExplFileDate{#1/#2/#3}%
-    }%
-\endgroup
-%    \end{macrocode}
-% \end{macro}
-% \end{macro}
-% \end{macro}
-%</driver|package>
 %<*driver>
 \documentclass[full,kernel]{l3doc}
 \begin{document}
diff --git a/l3kernel/l3file.dtx b/l3kernel/l3file.dtx
index b231845..d9f19c4 100644
--- a/l3kernel/l3file.dtx
+++ b/l3kernel/l3file.dtx
@@ -2534,6 +2534,76 @@
 %</package>
 %    \end{macrocode}
 %
+% \subsection{GetIfInfo}
+%
+% \begin{macro}{\GetIdInfo}
+% \begin{macro}{\@@_id_info_auxi:w, \@@_id_info_auxii:w, \@@_id_info_auxiii:w}
+%   As documented in \pkg{expl3.dtx} this function extracts file name
+%   etc from an \textsc{svn} \texttt{Id} line.  This used to be how we
+%   got version number and so on in all modules, so it had to be defined
+%   in \pkg{l3bootstrap}.  Now it's more convenient to define it after
+%   we have set up quite a lot of tools, and \pkg{l3file} seems the
+%   least unreasonable place for it.
+%
+%   The idea here is to extract out the information needed from a standard
+%   \textsc{svn} \texttt{Id} line, but to avoid a line that would get
+%   changed when the file is checked in. Hence the fact that none of the
+%   lines here include both a dollar sign and the \texttt{Id} keyword!
+%    \begin{macrocode}
+\cs_new_protected:Npn \GetIdInfo
+  {
+    \group_begin:
+    \char_set_catcode_space:n { 32 }
+    \exp_after:wN
+    \group_end:
+    \@@_id_info_auxi:w
+  }
+%    \end{macrocode}
+%   A first check for a completely empty \textsc{svn} field. If that is
+%   not the case, there is a second case when a file created using
+%   \texttt{svn cp} but has not been checked in. That leaves a special
+%   marker \texttt{-1} version, which has no further data. Dealing
+%   correctly with that is the reason for the space in the line to use
+%   \cs{@@_id_info_auxii:w}.
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_id_info_auxi:w $ #1 $ #2
+  {
+    \tl_set:Nn \ExplFileDescription {#2}
+    \str_if_eq:nnTF {#1} { Id }
+      {
+        \tl_set:Nn \ExplFileDate { 0000/00/00 }
+        \tl_set:Nn \ExplFileName { [unknown] }
+        \tl_set:Nn \ExplFileExtension { [unknown~extension] }
+        \tl_set:Nn \ExplFileVersion {-1}
+      }
+      { \@@_id_info_auxii:w #1 ~ \q_stop }
+  }
+%    \end{macrocode}
+%   Here, |#1| is |Id|, |#2| is the file name, |#3| is the extension,
+%   |#4| is the version, |#5| is the check in date and |#6| is the check
+%   in time and user, plus some trailing spaces. If |#4| is the marker
+%   |-1| value then |#5| and |#6| are empty.
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_id_info_auxii:w
+    #1 ~ #2.#3 ~ #4 ~ #5 ~ #6 \q_stop
+  {
+    \tl_set:Nn \ExplFileName {#2}
+    \tl_set:Nn \ExplFileExtension {#3}
+    \tl_set:Nn \ExplFileVersion {#4}
+    \str_if_eq:nnTF {#4} {-1}
+      { \tl_set:Nn \ExplFileDate { 0000/00/00 } }
+      { \@@_id_info_auxiii:w #5 - 0 - 0 - \q_stop }
+  }
+%    \end{macrocode}
+%   Convert an \textsc{svn}-style date into a \LaTeX{}-style one.
+%    \begin{macrocode}
+\cs_new_protected:Npn \@@_id_info_auxiii:w #1 - #2 - #3 - #4 \q_stop
+  { \tl_set:Nn \ExplFileDate { #1/#2/#3 } }
+%    \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+%
 % \subsection{Messages}
 %
 %    \begin{macrocode}
diff --git a/l3kernel/testfiles/m3expl001.luatex.tlg b/l3kernel/testfiles/m3expl001.luatex.tlg
index c66e416..1bfbd5e 100644
--- a/l3kernel/testfiles/m3expl001.luatex.tlg
+++ b/l3kernel/testfiles/m3expl001.luatex.tlg
@@ -2907,6 +2907,10 @@ Defining \file_show_list: on line ...
 Defining \file_log_list: on line ...
 Defining \__file_list:N on line ...
 Defining \__file_list_aux:n on line ...
+Defining \GetIdInfo on line ...
+Defining \__file_id_info_auxi:w on line ...
+Defining \__file_id_info_auxii:w on line ...
+Defining \__file_id_info_auxiii:w on line ...
 Defining message LaTeX/kernel/file-not-found on line ...
 Defining message LaTeX/kernel/file-list on line ...
 Defining message LaTeX/kernel/input-streams-exhausted on line ...
diff --git a/l3kernel/testfiles/m3expl001.ptex.tlg b/l3kernel/testfiles/m3expl001.ptex.tlg
index 5e2541b..4ddf8a6 100644
--- a/l3kernel/testfiles/m3expl001.ptex.tlg
+++ b/l3kernel/testfiles/m3expl001.ptex.tlg
@@ -3204,6 +3204,10 @@ Defining \file_show_list: on line ...
 Defining \file_log_list: on line ...
 Defining \__file_list:N on line ...
 Defining \__file_list_aux:n on line ...
+Defining \GetIdInfo on line ...
+Defining \__file_id_info_auxi:w on line ...
+Defining \__file_id_info_auxii:w on line ...
+Defining \__file_id_info_auxiii:w on line ...
 Defining message LaTeX/kernel/file-not-found on line ...
 Defining message LaTeX/kernel/file-list on line ...
 Defining message LaTeX/kernel/input-streams-exhausted on line ...
diff --git a/l3kernel/testfiles/m3expl001.tlg b/l3kernel/testfiles/m3expl001.tlg
index 9b53493..35c5bca 100644
--- a/l3kernel/testfiles/m3expl001.tlg
+++ b/l3kernel/testfiles/m3expl001.tlg
@@ -3204,6 +3204,10 @@ Defining \file_show_list: on line ...
 Defining \file_log_list: on line ...
 Defining \__file_list:N on line ...
 Defining \__file_list_aux:n on line ...
+Defining \GetIdInfo on line ...
+Defining \__file_id_info_auxi:w on line ...
+Defining \__file_id_info_auxii:w on line ...
+Defining \__file_id_info_auxiii:w on line ...
 Defining message LaTeX/kernel/file-not-found on line ...
 Defining message LaTeX/kernel/file-list on line ...
 Defining message LaTeX/kernel/input-streams-exhausted on line ...
diff --git a/l3kernel/testfiles/m3expl001.uptex.tlg b/l3kernel/testfiles/m3expl001.uptex.tlg
index 73500c0..4579bcb 100644
--- a/l3kernel/testfiles/m3expl001.uptex.tlg
+++ b/l3kernel/testfiles/m3expl001.uptex.tlg
@@ -3204,6 +3204,10 @@ Defining \file_show_list: on line ...
 Defining \file_log_list: on line ...
 Defining \__file_list:N on line ...
 Defining \__file_list_aux:n on line ...
+Defining \GetIdInfo on line ...
+Defining \__file_id_info_auxi:w on line ...
+Defining \__file_id_info_auxii:w on line ...
+Defining \__file_id_info_auxiii:w on line ...
 Defining message LaTeX/kernel/file-not-found on line ...
 Defining message LaTeX/kernel/file-list on line ...
 Defining message LaTeX/kernel/input-streams-exhausted on line ...
diff --git a/l3kernel/testfiles/m3expl001.xetex.tlg b/l3kernel/testfiles/m3expl001.xetex.tlg
index cc60a94..89f1722 100644
--- a/l3kernel/testfiles/m3expl001.xetex.tlg
+++ b/l3kernel/testfiles/m3expl001.xetex.tlg
@@ -2949,6 +2949,10 @@ Defining \file_show_list: on line ...
 Defining \file_log_list: on line ...
 Defining \__file_list:N on line ...
 Defining \__file_list_aux:n on line ...
+Defining \GetIdInfo on line ...
+Defining \__file_id_info_auxi:w on line ...
+Defining \__file_id_info_auxii:w on line ...
+Defining \__file_id_info_auxiii:w on line ...
 Defining message LaTeX/kernel/file-not-found on line ...
 Defining message LaTeX/kernel/file-list on line ...
 Defining message LaTeX/kernel/input-streams-exhausted on line ...
diff --git a/l3kernel/testfiles/m3expl003.luatex.tlg b/l3kernel/testfiles/m3expl003.luatex.tlg
index c66e416..1bfbd5e 100644
--- a/l3kernel/testfiles/m3expl003.luatex.tlg
+++ b/l3kernel/testfiles/m3expl003.luatex.tlg
@@ -2907,6 +2907,10 @@ Defining \file_show_list: on line ...
 Defining \file_log_list: on line ...
 Defining \__file_list:N on line ...
 Defining \__file_list_aux:n on line ...
+Defining \GetIdInfo on line ...
+Defining \__file_id_info_auxi:w on line ...
+Defining \__file_id_info_auxii:w on line ...
+Defining \__file_id_info_auxiii:w on line ...
 Defining message LaTeX/kernel/file-not-found on line ...
 Defining message LaTeX/kernel/file-list on line ...
 Defining message LaTeX/kernel/input-streams-exhausted on line ...
diff --git a/l3kernel/testfiles/m3expl003.ptex.tlg b/l3kernel/testfiles/m3expl003.ptex.tlg
index 5e2541b..4ddf8a6 100644
--- a/l3kernel/testfiles/m3expl003.ptex.tlg
+++ b/l3kernel/testfiles/m3expl003.ptex.tlg
@@ -3204,6 +3204,10 @@ Defining \file_show_list: on line ...
 Defining \file_log_list: on line ...
 Defining \__file_list:N on line ...
 Defining \__file_list_aux:n on line ...
+Defining \GetIdInfo on line ...
+Defining \__file_id_info_auxi:w on line ...
+Defining \__file_id_info_auxii:w on line ...
+Defining \__file_id_info_auxiii:w on line ...
 Defining message LaTeX/kernel/file-not-found on line ...
 Defining message LaTeX/kernel/file-list on line ...
 Defining message LaTeX/kernel/input-streams-exhausted on line ...
diff --git a/l3kernel/testfiles/m3expl003.tlg b/l3kernel/testfiles/m3expl003.tlg
index 9b53493..35c5bca 100644
--- a/l3kernel/testfiles/m3expl003.tlg
+++ b/l3kernel/testfiles/m3expl003.tlg
@@ -3204,6 +3204,10 @@ Defining \file_show_list: on line ...
 Defining \file_log_list: on line ...
 Defining \__file_list:N on line ...
 Defining \__file_list_aux:n on line ...
+Defining \GetIdInfo on line ...
+Defining \__file_id_info_auxi:w on line ...
+Defining \__file_id_info_auxii:w on line ...
+Defining \__file_id_info_auxiii:w on line ...
 Defining message LaTeX/kernel/file-not-found on line ...
 Defining message LaTeX/kernel/file-list on line ...
 Defining message LaTeX/kernel/input-streams-exhausted on line ...
diff --git a/l3kernel/testfiles/m3expl003.uptex.tlg b/l3kernel/testfiles/m3expl003.uptex.tlg
index 73500c0..4579bcb 100644
--- a/l3kernel/testfiles/m3expl003.uptex.tlg
+++ b/l3kernel/testfiles/m3expl003.uptex.tlg
@@ -3204,6 +3204,10 @@ Defining \file_show_list: on line ...
 Defining \file_log_list: on line ...
 Defining \__file_list:N on line ...
 Defining \__file_list_aux:n on line ...
+Defining \GetIdInfo on line ...
+Defining \__file_id_info_auxi:w on line ...
+Defining \__file_id_info_auxii:w on line ...
+Defining \__file_id_info_auxiii:w on line ...
 Defining message LaTeX/kernel/file-not-found on line ...
 Defining message LaTeX/kernel/file-list on line ...
 Defining message LaTeX/kernel/input-streams-exhausted on line ...
diff --git a/l3kernel/testfiles/m3expl003.xetex.tlg b/l3kernel/testfiles/m3expl003.xetex.tlg
index cc60a94..89f1722 100644
--- a/l3kernel/testfiles/m3expl003.xetex.tlg
+++ b/l3kernel/testfiles/m3expl003.xetex.tlg
@@ -2949,6 +2949,10 @@ Defining \file_show_list: on line ...
 Defining \file_log_list: on line ...
 Defining \__file_list:N on line ...
 Defining \__file_list_aux:n on line ...
+Defining \GetIdInfo on line ...
+Defining \__file_id_info_auxi:w on line ...
+Defining \__file_id_info_auxii:w on line ...
+Defining \__file_id_info_auxiii:w on line ...
 Defining message LaTeX/kernel/file-not-found on line ...
 Defining message LaTeX/kernel/file-list on line ...
 Defining message LaTeX/kernel/input-streams-exhausted on line ...





More information about the latex3-commits mailing list