summaryrefslogtreecommitdiff
path: root/Master/texmf-dist
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-10-18 22:38:37 +0000
committerKarl Berry <karl@freefriends.org>2012-10-18 22:38:37 +0000
commit27f8bac5dc1835a33e53fda37a0f7a6204582a12 (patch)
tree4bf569ac57c171c5cffe638d23928b98cbe5a3e5 /Master/texmf-dist
parent34c48d9566089694027f919d621fec0e075d1b84 (diff)
new package filedate (15oct12)
git-svn-id: svn://tug.org/texlive/trunk@28014 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r--Master/texmf-dist/doc/latex/filedate/Announce.txt20
-rw-r--r--Master/texmf-dist/doc/latex/filedate/README48
-rw-r--r--Master/texmf-dist/doc/latex/filedate/SrcFILEs.txt11
-rw-r--r--Master/texmf-dist/doc/latex/filedate/filedate.pdfbin0 -> 330002 bytes
-rw-r--r--Master/texmf-dist/source/latex/filedate/filedate.tex139
-rw-r--r--Master/texmf-dist/source/latex/filedate/srcfiles.tex15
-rw-r--r--Master/texmf-dist/tex/latex/filedate/filedate.sty221
7 files changed, 454 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/filedate/Announce.txt b/Master/texmf-dist/doc/latex/filedate/Announce.txt
new file mode 100644
index 00000000000..2999eae68dd
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/filedate/Announce.txt
@@ -0,0 +1,20 @@
+FIRST UPLOAD 2012-10-17:
+
+`filedate.sty' provides basic access to the date of a LaTeX
+source file according to its \ProvidesFile, \ProvidesPackage,
+or \ProvidesClass entry -- the "info date" --, as well as to
+its modification date according to \pdffilemoddate if the
+latter is available. Moreover commands are provided to compare
+the "info date" with the modification date, with "today"'s
+date, or with another date that a script accessing modifica-
+tion dates such as adhocfilelist.sh may insert, and to choose
+the effect of comparisons (error vs. "notice", reference date
+characterization). Thus updating the "info date" ("date con-
+sistency") of a source file may be ensured by a test during
+typesetting from it or by some (shell/TeX) script.
+
+In fact the test today admonished me to update the
+documentation source and driver `filedate.tex'. Another
+motivating example of "date inconsistency" was `nicefilelist'
+v0.6 as of 2012-10-11 (see version history) with "info date"
+2012/10/03.
diff --git a/Master/texmf-dist/doc/latex/filedate/README b/Master/texmf-dist/doc/latex/filedate/README
new file mode 100644
index 00000000000..be5654431ad
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/filedate/README
@@ -0,0 +1,48 @@
+
+ README for the `filedate' package
+ Access and Compare Info and Modification Dates
+ (C) Uwe Lueck 2012/10/17
+
+`filedate.sty' provides basic access to the date of a LaTeX
+source file according to its \ProvidesFile, \ProvidesPackage,
+or \ProvidesClass entry -- the "info date" --, as well as to
+its modification date according to \pdffilemoddate if the
+latter is available. Moreover commands are provided to compare
+the "info date" with the modification date, with "today"'s
+date, or with another date that a script accessing modifica-
+tion dates such as adhocfilelist.sh may insert, and to choose
+the effect of comparisons (error vs. "notice", reference date characterization). Thus updating the "info date" ("date con-
+sistency") of a source file may be ensured by a test during
+typesetting from it or by some (shell/TeX) script.
+
+REQUIRED PACKAGES: `readprov' for two commands
+
+RELATED PACKAGES: filemod, getfiledate, zwgetfdate, fileinfo
+
+KEYWORDs: package documentation, document versions
+
+LICENSE:
+
+The package file `filedate.sty' and the documentation files
+`filedate.pdf' and `filedate.tex' can be redistributed and/or
+modified under the terms of the LaTeX Project Public License;
+either version 1.3c of the License, or any later version, see
+
+ http://www.latex-project.org/lppl.txt
+
+There is NO WARRANTY, indeed this still is somewhat experimental.
+
+The `filedate' package is author-maintained in the sense of
+the license.
+
+The latest public version of the package is available at
+
+ http://mirror.ctan.org/macros/latex/contrib/filedate/
+
+A TDS version of the package is available as
+
+ http://mirror.ctan.org/install/macros/latex/contrib/filedate.tds.zip
+
+Please report bugs, problems, and suggestions via
+
+ http://www.contact-ednotes.sty.de.vu
diff --git a/Master/texmf-dist/doc/latex/filedate/SrcFILEs.txt b/Master/texmf-dist/doc/latex/filedate/SrcFILEs.txt
new file mode 100644
index 00000000000..9db82980347
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/filedate/SrcFILEs.txt
@@ -0,0 +1,11 @@
+
+ *File List*
+filedate.sty 2012/10/17 v0.2 check file dates (UL)
+filedate.tex 2012/10/17 -- documenting filedate.sty
+ wrong.tex 2012/10/15 -- filedate.sty demo
+srcfiles.tex 2012/10/16 -- file infos -> SrcFILEs.txt
+ ***********
+
+ List made at 2012/10/17, 12:33
+ from script file srcfiles.tex
+
diff --git a/Master/texmf-dist/doc/latex/filedate/filedate.pdf b/Master/texmf-dist/doc/latex/filedate/filedate.pdf
new file mode 100644
index 00000000000..97a575027ca
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/filedate/filedate.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/latex/filedate/filedate.tex b/Master/texmf-dist/source/latex/filedate/filedate.tex
new file mode 100644
index 00000000000..3867f22bb5f
--- /dev/null
+++ b/Master/texmf-dist/source/latex/filedate/filedate.tex
@@ -0,0 +1,139 @@
+\ProvidesFile{filedate.tex}[2012/10/17 documenting filedate.sty]
+%% 2012/06/24
+\title{\pkgtitle{filedate.sty}{Access and Compare Info and Modification Date}}
+% \listfiles
+{ \RequirePackage{makedoc} \ProcessLineMessage{}
+ \MakeJobDoc{18}%% 2012/10/16
+ {\SectionLevelTwoParseInput} }
+\documentclass[fleqn]{article}%% TODO paper dimensions!?
+\input{makedoc.cfg} %% shared formatting settings
+\usepackage{filedate,readprov}
+\MDkeywords{package management, document versions}
+\sloppy
+\newcommand*{\TODO}[1][]{%
+ \textcolor{blue}{TODO\ifx$#1$\else\space#1\fi}}
+\providecommand*{\LuaTeX}{Lua\TeX}
+\providecommand*{\XeLaTeX}{X\lower.5ex\hbox{E}\kern-.125em\LaTeX}
+\begin{document}
+\maketitle
+\begin{MDabstract}
+'filedate.sty' provides basic access to the date of a
+\LaTeX\ source file according to its `\ProvidesFile',
+`\ProvidesPackage', or `\ProvidesClass' entry---the ``info date"---,
+as well as to its modification date according to `\pdffilemoddate'
+if the latter is available. Moreover commands are provided
+to compare the ``info date" with the modification date, with ``today"'s
+date, or with another date---that a script accessing modification dates
+such as \CtanPkgRef{adhocfilelist}{adhocfilelist.sh}
+may insert---, and to choose the effect of comparisons
+(error vs.\ ``notice," reference date characterization).
+Thus updating the ``info date" (``\strong{date consistency}")
+of a source file may be ensured by a test
+during typesetting from it or by some (shell/\TeX) script.
+
+\MDaddtoabstract{Related packages:} \ctanpkgref{filemod},
+\ctanpkgref{getfiledate}, \ctanpkgref{zwgetfdate},
+\ctanpkgref{fileinfo}
+\end{MDabstract}
+\tableofcontents
+
+% \newpage
+\section{Features and Usage}
+
+\subsection{Installing and Calling}
+The file 'filedate.sty' is provided ready, installation only requires
+putting it somewhere where \TeX\ finds it
+(which may need updating the filename data
+ base).\urlfoot{ukfaqref}{inst-wlcf} %% corr. 2011/02/08
+
+%% extended 2011/01/14:
+Below the `\documentclass' line(s) and above `\begin{document}',
+you load 'filedate.sty' (as usually) by
+\[|\usepackage{filedate}|\]
+but in ``\TeX\ scripts" such as \hyperref[sec:wrong]{below},
+\[|\RequirePackage{filedate}|\]
+is better.
+
+\subsection{Demonstration with a ``\TeX\ script" Example}
+\label{sec:wrong}
+The accompanying `wrong.tex' is an example of a ``\pkg{filedate} \TeX\ script"
+demonstrating what may go wrong.
+% \begin{quotation}\tt\small
+% \expandafter\def\expandafter\{\expandafter{\string{}
+% \expandafter\def\expandafter\}\expandafter{\string}}
+% \obeyspaces\obeylines
+% \cs{ProvidesFile}\{wrong.tex\}[2012/10/15 filedate.sty demo]
+% \cs{RequirePackage}\{filedate\}
+% \cs{CheckDateOfPDFmod}\{wrong\}
+% \cs{CheckDateOfPDFmod}\{wrong.tex\}
+% \cs{CheckDateOfToday}\{wrong.tex\}
+% \cs{stop}
+% \end{quotation}
+\vskip \bigskipamount
+\hrule
+\verbatiminput{wrong}
+\hrule
+\vskip \bigskipamount
+\ReadFileInfos{wrong}
+You may run it (by the command line \qtd{\file{latex wrong}}) and experience:
+\begin{enumerate}
+% \AddQuotes
+ \item `wrong.tex''s ``info date" is \qtd{\file{\theinfodateof{wrong.tex}}},
+ but its modification date is at least one day later.
+ \item
+ `\CheckDateOfPDFmod{wrong}' demonstrates that in
+ \[|\CheckDateOfPDFmod{<file>}|\]
+ <file> must be the \Wikiref{filename} \emph{including extension.}
+ Otherwise the ``info date" may be (displayed as) ``unknown."
+ \item
+ |\CheckDateOfPDFmod{wrong.tex}| tests against `wrong.tex''s
+ modification date according to `\pdffilemoddate'---the present
+ package documentation uses \ctanpkgref{pdftex} indeed.
+ \item
+ |\CheckDateOfToday{wrong.tex}| tests against ``today"'s date,
+ which should be different from `2012/10/15'.
+ \item
+ The ``script" terminates on \LaTeX's |\stop| command,
+ without typesetting anything.
+% (or that's what I expect and what has happened when I tried it).
+ \TeX\ is just used as a program, a command interpreter
+ (as with \ctanpkgref{docstrip}).
+\end{enumerate}
+
+% \subsection{The Single Commands}
+% $\dots$ are described below near to their implementation.
+
+% \pagebreak
+
+\section{Implementation and Single Commands}
+\subsection{Package File Header (Legalese)}
+\input{filedate.doc}
+
+\section{Use with Present Package Documentation}
+At this place, the documentation source \qtd{\file{filedate.tex}}
+issues
+\begin{verbatim}
+ \EqualityMessages
+ \CheckDateOfPDFmod{filedate.sty}
+ \CheckDateOfPDFmod{filedate.tex}
+\end{verbatim}
+ \EqualityMessages
+ \CheckDateOfPDFmod{filedate.sty}
+ \CheckDateOfPDFmod{filedate.tex}
+in order to check whether the ``info dates" of the package file
+\qtd{\file{filedate.sty}} and of the documentation source and driver
+\qtd{\file{filedate.tex}} are the same as their modification dates
+according to |\pdffilemoddate| (using \code{pdflatex}).
+When I added this on 2012-10-17, it indeed informed me that I had not updated
+\file{filedate.tex}'s info date
+(\code{2012/10/16},
+ generation of first version of the file from a template, draft).
+
+|\EqualityMessages| confirms that the tests were run indeed.
+
+\end{document}
+
+VERSION HISTORY
+
+2012/10/16 for v0.1 started
+2012/10/17 completed
diff --git a/Master/texmf-dist/source/latex/filedate/srcfiles.tex b/Master/texmf-dist/source/latex/filedate/srcfiles.tex
new file mode 100644
index 00000000000..ce44e72c64e
--- /dev/null
+++ b/Master/texmf-dist/source/latex/filedate/srcfiles.tex
@@ -0,0 +1,15 @@
+\ProvidesFile{srcfiles.tex}[2012/10/16 file infos -> SrcFILEs.txt]
+\RequirePackage{nicefilelist}
+\MFfieldtemplate{f-base}{filedate}
+\RequirePackage{myfilist}
+\EmptyFileList %%% [readprov.sty,myfilist.sty]
+%% packages:
+\ReadPackageInfos{filedate}
+%% documentation:
+\ReadFileInfos{filedate,wrong}
+%% documentation settings and auxiliaries:
+%\ReadPackageInfos{fifinddo,makedoc,niceverb}
+%\ReadFileInfos{makedoc.cfg,mdoccorr.cfg}
+\ReadFileInfos{srcfiles}
+\ListInfos[SrcFILEs.txt]
+
diff --git a/Master/texmf-dist/tex/latex/filedate/filedate.sty b/Master/texmf-dist/tex/latex/filedate/filedate.sty
new file mode 100644
index 00000000000..46568260357
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/filedate/filedate.sty
@@ -0,0 +1,221 @@
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\ProvidesPackage{filedate}[2012/10/17 v0.2 check file dates (UL)]
+
+%% Copyright (C) 2012 Uwe Lueck,
+%% http://www.contact-ednotes.sty.de.vu
+%% -- author-maintained in the sense of LPPL below --
+%%
+%% This file can be redistributed and/or modified under
+%% the terms of the LaTeX Project Public License; either
+%% version 1.3c of the License, or any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% We did our best to help you, but there is NO WARRANTY.
+%%
+%% Please report bugs, problems, and suggestions via
+%%
+%% http://www.contact-ednotes.sty.de.vu
+%%
+%% === The \ctanpkgref{readprov} Package ===
+%% \label{sec:readprov}
+% \RequirePackage{readprov}
+%% ---is required for |\ReadInfoDate{<file>}|
+%% and |\ReadCheckDateOf{<file>}|
+%% % \hyperref[sec:readinfo]{below}
+%% (sections~\ref{sec:readinfo} and \ref{sec:readcheck})
+%% % below
+%% only.
+%% Please care for providing it on your own if you need that.
+%%
+%% \pagebreak
+%% === Accessing ``Info Date" ===
+%% \label{sec:readinfo}
+%% |\theinfodateof{<file>}| will expand to the first ``word" of the
+%% `\Provides'\code{...} entry, provided that has been read before:
+\newcommand*{\theinfodateof}[1]{%
+ \@ifundefined{ver@#1}{unknown}{%
+ \expandafter\expandafter\expandafter
+ \fd@firstword\csname ver@#1\endcsname\@gobble{} \@nil}}
+\def\fd@firstword#1 #2\@nil{#1}
+%% This avoids the `\relax' that `\UseDateOf' from \ctanpkgref{readprov}
+%% currently adds (which doesn't harm in printing but is bad for comparing).
+%%
+%% |\LoadInfoDateOf{<file>}| sets |\theinfodate| to the first word of
+%% what is in the `\Provides' instruction of <file>, provided that info
+%% has been input. So far, you must care for yourself that this works.
+%% % The purpose of this kind of actions is to refer to a ``type'' of
+%% % comparisons (with `\CheckDateGiven') for a multiplicity of files.
+\newcommand*{\LoadInfoDateOf}[1]{%
+ \edef\theinfodate{\theinfodateof{#1}}}
+%% |\ReadInfoDateOf{<file>}| additionally inputs the info before:
+\newcommand*{\ReadInfoDateOf}[1]{%
+ \ReadFileInfos{#1}\LoadInfoDateOf{#1}}
+%% TODO provide automatically.
+%%
+%% === Accessing \cs{pdffilemoddate} ===
+%% |\pdffilemoddate{<file>}| in the first instance is a \ctanpkgref{pdftex}
+%% primitive. With \LuaTeX, \ctanpkgref{pdftexcmds} provides it.
+%% Currently, you must care for this yourself before loading the
+%% present package. I recommend the \ctanpkgref{filemod} documentation for
+%% details about \cs{pdffilemoddate}.
+%%
+%% Otherwise, (with \XeLaTeX) the modification date may be obtained
+%% by a (shell) script---the next definitions do \emph{not} deal with
+%% the latter situation. Testing against ``today"
+%% (|\rawtoday| in Section~\ref{sec:rawtoday})
+%% may be another alternative.
+%%
+%% |\thepdfmoddateof{<file>}| expands to the modification date
+%% (eight digits separated by two slashes) if `\pdffilemoddate'
+%% is available. Otherwise, we are trying to inform about
+%% unavailability:
+\ifx\pdffilemoddate\@undefined
+ \newcommand*{\thepdfmoddateof}{%
+ \string\pdffilemoddate\space unavailable.}
+\else
+ \newcommand*{\thepdfmoddateof}[1]{%
+ \expandafter \fd@pdftexdate \pdffilemoddate{#1}\@nil}
+ \expandafter \def \expandafter
+ \fd@pdftexdate\string D:#1#2#3#4#5#6#7#8#9\@nil{%
+ #1#2#3#4/#5#6/#7#8}
+%% ---cf.~Will \ctanpkgauref{robertson}{Robertson}'s suggestion dating from 2010 on
+%% \httpref{stackoverflow.com/questions/2118972/latex-command-for-last-modified}{%
+%% \urlfmt{stackoverflow.com}} in another discussion of accessing modification dates,
+%% including use of scripts.
+%% `\string D' deals with the fact that `\pdffilemoddate' returns in ``other"
+%% character tokens.
+\fi
+%%
+%% === \cs{rawtoday} ===
+%% \label{sec:rawtoday}
+%% % Enabling `\CheckDateOf{<file>}{\rawtoday}':
+%% |\rawtoday| accesses ``today"'s date as eight digits separated
+%% by two slashes (`yyyy/mm/dd'):
+\newcommand*{\rawtoday}{%
+ \the\year/\two@digits{\the\month}/\two@digits{\the\day}}
+%%
+%% === Comparing ===
+%% \label{sec:readcheck}
+%% |\CheckDateOf{<file>}{<date>}| compares <file>'s info date with
+%% <date>:
+\newcommand*{\CheckDateOf}[2]{%
+%% We provide a check that does not affect the order with \ctanpkgref{myfilist}.
+% \ReadFileInfos{#1}%
+%% The date according to `\Provides' will be accessible as |\theinfodate|:
+ \LoadInfoDateOf{#1}%
+% \show\theinfodate
+ \ReadPDFmodDateOf{#1}%
+ \edef\@tempb{#2}%
+% \show\@tempb
+ \ifx\theinfodate\@tempb
+ \fd@datesequal{#1}%
+ \else
+ \fd@datesdiff{#1}%
+ \fi}
+%% |\ReadCheckDateOf{<file>}{<date>}| prepends |\ReadFileInfos{<file>}|
+%% from the \ctanpkgref{readprov} package (cf. Section~\ref{sec:readprov}):
+\newcommand*{\ReadCheckDateOf}[1]{%
+ \ReadFileInfos{#1}\CheckDateOf{#1}}
+%% TODO provide automatically.
+%%
+%% \pagebreak
+%% === Reporting Styles ===
+%% By default, there is no report about comparisons finding equality.
+\let\fd@datesequal\@gobble
+%% We do not want to disturb `\listfiles' with \ctanpkgref{myfilist}.
+%% |\EqualityMessages| changes this to screen and log messages:
+\newcommand*{\EqualityMessages}{\let\fd@datesequal\fd@equalmess}
+\def\fd@equalmess#1{\message{ + #1 passed date check + }}
+\def\fd@errdatesdiff#1{%
+ \PackageError{filedate}{%
+ \fd@infodate{#1}\fd@datekind\@tempb}{%
+ Fix that!}}
+%% |\fd@infodate{<file>}| might be used to change the current
+%% presentation of the ``info date:"
+\def\fd@infodate#1{%
+ #1 has \string\Provides... date \theinfodate\space}
+%% TODO here |\theinfodate| could be replaced by
+%% |\theinfodateof{#1}|, there is no essential application of
+%% `\theinfodate' currently.
+%%
+%% After |\DatesDiffErrors|, date differences are reportet ``drastically"
+%% by `\PackageError':
+\newcommand*{\DatesDiffErrors}{\let\fd@datesdiff\fd@errdatesdiff}
+%% This is the default:
+\DatesDiffErrors
+%% After |\DatesDiffNotices|, date differences are told by
+%% `\typeout':
+\newcommand*{\DatesDiffNotices}{\let\fd@datesdiff\fd@notedatesdiff}
+\def\fd@notedatesdiff#1{\typeout{\fd@infodate{#1}}}
+%% After |\ModDates|, reference dates are called ``modification'' dates:
+\newcommand*{\ModDates}{\let\fd@datekind\fd@moddate}
+\def\fd@moddate#1{\MessageBreak vs. modification date #1}
+%% After |\SomeDates|, the type of reference dates is not specified.
+%% This is more accurate when the info date is compared with |\rawtoday|.
+\newcommand*{\SomeDates}{\let\fd@datekind\fd@somedate}
+\def\fd@somedate#1{\MessageBreak vs. #1}
+%% That's the default:
+\SomeDates
+%%
+%% === Reference Date ``Types" ===
+%% |\ReadPDFmodDateOf{<file>}| enables
+%% \[|\CheckDateOf{<file>}{\thepdfmoddate}|\]
+%% by setting |\thepdfmoddate|:
+\newcommand*{\ReadPDFmodDateOf}[1]{%
+ \edef\thepdfmoddate{\thepdfmoddateof{#1}}}
+%% % The purpose of this section is to control the reference date
+%% % without changing commands with <file> arguments.
+%% After a single |\UseReferenceDate{<date>}| all ensuing
+%% \[|\CheckDateOfGiven{<file>}|\] compare
+%% % `\theinfodateof{<file>}'
+%% <file>'s ``info date"
+%% with
+%% % |\thedategiven|.
+%% <date>.
+%% % <date>
+%% The latter
+%% may be an explicit
+%% \[<4-digits>/<2-digits>/<2-digits>\quad
+%% (`yyyy/mm/dd')\]--a script might insert it---,
+%% `\rawtoday', or `\thepdfmoddate'.
+%% \ctanpkgref{adhocfilelist} v0.7 (with option \strong{\code{-c}})
+%% is such a script, a shell script generating a ``\TeX\ script",
+%% providing the file modification date according to Unix/Linux.
+\newcommand*{\UseReferenceDate}{\def\thedategiven}
+\newcommand*{\CheckDateOfGiven}[1]{\CheckDateOf{#1}{\thedategiven}}
+%%
+%% %%% *** Clarifying Reference Type in Reports ***
+%% |\CheckDateOfPDFmod{<file>}| compares the ``info date"
+%% with the modification date according to `\pdffilemoddate',
+%% and in reporting a difference the modification
+%% date it is called a ``modification date" indeed:
+\newcommand*{\CheckDateOfPDFmod}[1]{%
+ \begingroup
+ \ModDates
+ \CheckDateOf{#1}{\thepdfmoddate}%
+ \endgroup}
+%% |\CheckDateOfToday{<file>}| checks if the `\Provides' date is today's,
+%% and the report of a difference somewhat emphasizes that this may not
+%% be a \emph{modification} date.
+%% (It may be a \emph{substitute} for a modification date when you
+%% know that the file was modified ``today".)
+\newcommand*{\CheckDateOfToday}[1]{%
+ \begingroup
+ \def\fd@datekind ##1{%
+ \MessageBreak which is not today}%
+ \CheckDateOf{#1}{\rawtoday}%
+ \endgroup}
+%%
+%%
+%% TODO single check commands for comma-separated list of files,
+%% (\ctanpkgref{dowith})
+%% automatic tests by `\ReadFileInfos' etc. (\ctanpkgref{fileinfo}).
+%%
+%% === Leaving the Package File ===
+\endinput
+%%
+%% === VERSION HISTORY ===
+
+v0.1 2012/10/15 core try, bad
+v0.2 2012/10/16 code for first release
+ 2012/10/17 reordering, correcting documentation