From 90eadb0419777532440612630fb299cb38a88118 Mon Sep 17 00:00:00 2001 From: "Achim D. Brucker" Date: Sun, 24 Jul 2016 23:30:10 +0100 Subject: [PATCH] Initial import of svninfo 0.7.4 from old svn repository. --- LICENSE | 416 ++++++++++++++++ Makefile | 86 ++++ README | 73 +++ README.md | 2 - svninfo.dtx | 1373 +++++++++++++++++++++++++++++++++++++++++++++++++++ svninfo.ins | 90 ++++ 6 files changed, 2038 insertions(+), 2 deletions(-) create mode 100644 LICENSE create mode 100644 Makefile create mode 100644 README delete mode 100644 README.md create mode 100644 svninfo.dtx create mode 100644 svninfo.ins diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..2244313 --- /dev/null +++ b/LICENSE @@ -0,0 +1,416 @@ +The LaTeX Project Public License +=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- + +LPPL Version 1.3c 2008-05-04 + +Copyright 1999 2002-2008 LaTeX3 Project + Everyone is allowed to distribute verbatim copies of this + license document, but modification of it is not allowed. + + +PREAMBLE +======== + +The LaTeX Project Public License (LPPL) is the primary license under +which the LaTeX kernel and the base LaTeX packages are distributed. + +You may use this license for any work of which you hold the copyright +and which you wish to distribute. This license may be particularly +suitable if your work is TeX-related (such as a LaTeX package), but +it is written in such a way that you can use it even if your work is +unrelated to TeX. + +The section `WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE', +below, gives instructions, examples, and recommendations for authors +who are considering distributing their works under this license. + +This license gives conditions under which a work may be distributed +and modified, as well as conditions under which modified versions of +that work may be distributed. + +We, the LaTeX3 Project, believe that the conditions below give you +the freedom to make and distribute modified versions of your work +that conform with whatever technical specifications you wish while +maintaining the availability, integrity, and reliability of +that work. If you do not see how to achieve your goal while +meeting these conditions, then read the document `cfgguide.tex' +and `modguide.tex' in the base LaTeX distribution for suggestions. + + +DEFINITIONS +=========== + +In this license document the following terms are used: + + `Work' + Any work being distributed under this License. + + `Derived Work' + Any work that under any applicable law is derived from the Work. + + `Modification' + Any procedure that produces a Derived Work under any applicable + law -- for example, the production of a file containing an + original file associated with the Work or a significant portion of + such a file, either verbatim or with modifications and/or + translated into another language. + + `Modify' + To apply any procedure that produces a Derived Work under any + applicable law. + + `Distribution' + Making copies of the Work available from one person to another, in + whole or in part. Distribution includes (but is not limited to) + making any electronic components of the Work accessible by + file transfer protocols such as FTP or HTTP or by shared file + systems such as Sun's Network File System (NFS). + + `Compiled Work' + A version of the Work that has been processed into a form where it + is directly usable on a computer system. This processing may + include using installation facilities provided by the Work, + transformations of the Work, copying of components of the Work, or + other activities. Note that modification of any installation + facilities provided by the Work constitutes modification of the Work. + + `Current Maintainer' + A person or persons nominated as such within the Work. If there is + no such explicit nomination then it is the `Copyright Holder' under + any applicable law. + + `Base Interpreter' + A program or process that is normally needed for running or + interpreting a part or the whole of the Work. + + A Base Interpreter may depend on external components but these + are not considered part of the Base Interpreter provided that each + external component clearly identifies itself whenever it is used + interactively. Unless explicitly specified when applying the + license to the Work, the only applicable Base Interpreter is a + `LaTeX-Format' or in the case of files belonging to the + `LaTeX-format' a program implementing the `TeX language'. + + + +CONDITIONS ON DISTRIBUTION AND MODIFICATION +=========================================== + +1. Activities other than distribution and/or modification of the Work +are not covered by this license; they are outside its scope. In +particular, the act of running the Work is not restricted and no +requirements are made concerning any offers of support for the Work. + +2. You may distribute a complete, unmodified copy of the Work as you +received it. Distribution of only part of the Work is considered +modification of the Work, and no right to distribute such a Derived +Work may be assumed under the terms of this clause. + +3. You may distribute a Compiled Work that has been generated from a +complete, unmodified copy of the Work as distributed under Clause 2 +above, as long as that Compiled Work is distributed in such a way that +the recipients may install the Compiled Work on their system exactly +as it would have been installed if they generated a Compiled Work +directly from the Work. + +4. If you are the Current Maintainer of the Work, you may, without +restriction, modify the Work, thus creating a Derived Work. You may +also distribute the Derived Work without restriction, including +Compiled Works generated from the Derived Work. Derived Works +distributed in this manner by the Current Maintainer are considered to +be updated versions of the Work. + +5. If you are not the Current Maintainer of the Work, you may modify +your copy of the Work, thus creating a Derived Work based on the Work, +and compile this Derived Work, thus creating a Compiled Work based on +the Derived Work. + +6. If you are not the Current Maintainer of the Work, you may +distribute a Derived Work provided the following conditions are met +for every component of the Work unless that component clearly states +in the copyright notice that it is exempt from that condition. Only +the Current Maintainer is allowed to add such statements of exemption +to a component of the Work. + + a. If a component of this Derived Work can be a direct replacement + for a component of the Work when that component is used with the + Base Interpreter, then, wherever this component of the Work + identifies itself to the user when used interactively with that + Base Interpreter, the replacement component of this Derived Work + clearly and unambiguously identifies itself as a modified version + of this component to the user when used interactively with that + Base Interpreter. + + b. Every component of the Derived Work contains prominent notices + detailing the nature of the changes to that component, or a + prominent reference to another file that is distributed as part + of the Derived Work and that contains a complete and accurate log + of the changes. + + c. No information in the Derived Work implies that any persons, + including (but not limited to) the authors of the original version + of the Work, provide any support, including (but not limited to) + the reporting and handling of errors, to recipients of the + Derived Work unless those persons have stated explicitly that + they do provide such support for the Derived Work. + + d. You distribute at least one of the following with the Derived Work: + + 1. A complete, unmodified copy of the Work; + if your distribution of a modified component is made by + offering access to copy the modified component from a + designated place, then offering equivalent access to copy + the Work from the same or some similar place meets this + condition, even though third parties are not compelled to + copy the Work along with the modified component; + + 2. Information that is sufficient to obtain a complete, + unmodified copy of the Work. + +7. If you are not the Current Maintainer of the Work, you may +distribute a Compiled Work generated from a Derived Work, as long as +the Derived Work is distributed to all recipients of the Compiled +Work, and as long as the conditions of Clause 6, above, are met with +regard to the Derived Work. + +8. The conditions above are not intended to prohibit, and hence do not +apply to, the modification, by any method, of any component so that it +becomes identical to an updated version of that component of the Work as +it is distributed by the Current Maintainer under Clause 4, above. + +9. Distribution of the Work or any Derived Work in an alternative +format, where the Work or that Derived Work (in whole or in part) is +then produced by applying some process to that format, does not relax or +nullify any sections of this license as they pertain to the results of +applying that process. + +10. a. A Derived Work may be distributed under a different license + provided that license itself honors the conditions listed in + Clause 6 above, in regard to the Work, though it does not have + to honor the rest of the conditions in this license. + + b. If a Derived Work is distributed under a different license, that + Derived Work must provide sufficient documentation as part of + itself to allow each recipient of that Derived Work to honor the + restrictions in Clause 6 above, concerning changes from the Work. + +11. This license places no restrictions on works that are unrelated to +the Work, nor does this license place any restrictions on aggregating +such works with the Work by any means. + +12. Nothing in this license is intended to, or may be used to, prevent +complete compliance by all parties with all applicable laws. + + +NO WARRANTY +=========== + +There is no warranty for the Work. Except when otherwise stated in +writing, the Copyright Holder provides the Work `as is', without +warranty of any kind, either expressed or implied, including, but not +limited to, the implied warranties of merchantability and fitness for a +particular purpose. The entire risk as to the quality and performance +of the Work is with you. Should the Work prove defective, you assume +the cost of all necessary servicing, repair, or correction. + +In no event unless required by applicable law or agreed to in writing +will The Copyright Holder, or any author named in the components of the +Work, or any other party who may distribute and/or modify the Work as +permitted above, be liable to you for damages, including any general, +special, incidental or consequential damages arising out of any use of +the Work or out of inability to use the Work (including, but not limited +to, loss of data, data being rendered inaccurate, or losses sustained by +anyone as a result of any failure of the Work to operate with any other +programs), even if the Copyright Holder or said author or said other +party has been advised of the possibility of such damages. + + +MAINTENANCE OF THE WORK +======================= + +The Work has the status `author-maintained' if the Copyright Holder +explicitly and prominently states near the primary copyright notice in +the Work that the Work can only be maintained by the Copyright Holder +or simply that it is `author-maintained'. + +The Work has the status `maintained' if there is a Current Maintainer +who has indicated in the Work that they are willing to receive error +reports for the Work (for example, by supplying a valid e-mail +address). It is not required for the Current Maintainer to acknowledge +or act upon these error reports. + +The Work changes from status `maintained' to `unmaintained' if there +is no Current Maintainer, or the person stated to be Current +Maintainer of the work cannot be reached through the indicated means +of communication for a period of six months, and there are no other +significant signs of active maintenance. + +You can become the Current Maintainer of the Work by agreement with +any existing Current Maintainer to take over this role. + +If the Work is unmaintained, you can become the Current Maintainer of +the Work through the following steps: + + 1. Make a reasonable attempt to trace the Current Maintainer (and + the Copyright Holder, if the two differ) through the means of + an Internet or similar search. + + 2. If this search is successful, then enquire whether the Work + is still maintained. + + a. If it is being maintained, then ask the Current Maintainer + to update their communication data within one month. + + b. If the search is unsuccessful or no action to resume active + maintenance is taken by the Current Maintainer, then announce + within the pertinent community your intention to take over + maintenance. (If the Work is a LaTeX work, this could be + done, for example, by posting to comp.text.tex.) + + 3a. If the Current Maintainer is reachable and agrees to pass + maintenance of the Work to you, then this takes effect + immediately upon announcement. + + b. If the Current Maintainer is not reachable and the Copyright + Holder agrees that maintenance of the Work be passed to you, + then this takes effect immediately upon announcement. + + 4. If you make an `intention announcement' as described in 2b. above + and after three months your intention is challenged neither by + the Current Maintainer nor by the Copyright Holder nor by other + people, then you may arrange for the Work to be changed so as + to name you as the (new) Current Maintainer. + + 5. If the previously unreachable Current Maintainer becomes + reachable once more within three months of a change completed + under the terms of 3b) or 4), then that Current Maintainer must + become or remain the Current Maintainer upon request provided + they then update their communication data within one month. + +A change in the Current Maintainer does not, of itself, alter the fact +that the Work is distributed under the LPPL license. + +If you become the Current Maintainer of the Work, you should +immediately provide, within the Work, a prominent and unambiguous +statement of your status as Current Maintainer. You should also +announce your new status to the same pertinent community as +in 2b) above. + + +WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE +====================================================== + +This section contains important instructions, examples, and +recommendations for authors who are considering distributing their +works under this license. These authors are addressed as `you' in +this section. + +Choosing This License or Another License +---------------------------------------- + +If for any part of your work you want or need to use *distribution* +conditions that differ significantly from those in this license, then +do not refer to this license anywhere in your work but, instead, +distribute your work under a different license. You may use the text +of this license as a model for your own license, but your license +should not refer to the LPPL or otherwise give the impression that +your work is distributed under the LPPL. + +The document `modguide.tex' in the base LaTeX distribution explains +the motivation behind the conditions of this license. It explains, +for example, why distributing LaTeX under the GNU General Public +License (GPL) was considered inappropriate. Even if your work is +unrelated to LaTeX, the discussion in `modguide.tex' may still be +relevant, and authors intending to distribute their works under any +license are encouraged to read it. + +A Recommendation on Modification Without Distribution +----------------------------------------------------- + +It is wise never to modify a component of the Work, even for your own +personal use, without also meeting the above conditions for +distributing the modified component. While you might intend that such +modifications will never be distributed, often this will happen by +accident -- you may forget that you have modified that component; or +it may not occur to you when allowing others to access the modified +version that you are thus distributing it and violating the conditions +of this license in ways that could have legal implications and, worse, +cause problems for the community. It is therefore usually in your +best interest to keep your copy of the Work identical with the public +one. Many works provide ways to control the behavior of that work +without altering any of its licensed components. + +How to Use This License +----------------------- + +To use this license, place in each of the components of your work both +an explicit copyright notice including your name and the year the work +was authored and/or last substantially modified. Include also a +statement that the distribution and/or modification of that +component is constrained by the conditions in this license. + +Here is an example of such a notice and statement: + + %% pig.dtx + %% Copyright 2005 M. Y. Name + % + % This work may be distributed and/or modified under the + % conditions of the LaTeX Project Public License, either version 1.3 + % of this license or (at your option) any later version. + % The latest version of this license is in + % http://www.latex-project.org/lppl.txt + % and version 1.3 or later is part of all distributions of LaTeX + % version 2005/12/01 or later. + % + % This work has the LPPL maintenance status `maintained'. + % + % The Current Maintainer of this work is M. Y. Name. + % + % This work consists of the files pig.dtx and pig.ins + % and the derived file pig.sty. + +Given such a notice and statement in a file, the conditions +given in this license document would apply, with the `Work' referring +to the three files `pig.dtx', `pig.ins', and `pig.sty' (the last being +generated from `pig.dtx' using `pig.ins'), the `Base Interpreter' +referring to any `LaTeX-Format', and both `Copyright Holder' and +`Current Maintainer' referring to the person `M. Y. Name'. + +If you do not want the Maintenance section of LPPL to apply to your +Work, change `maintained' above into `author-maintained'. +However, we recommend that you use `maintained', as the Maintenance +section was added in order to ensure that your Work remains useful to +the community even when you can no longer maintain and support it +yourself. + +Derived Works That Are Not Replacements +--------------------------------------- + +Several clauses of the LPPL specify means to provide reliability and +stability for the user community. They therefore concern themselves +with the case that a Derived Work is intended to be used as a +(compatible or incompatible) replacement of the original Work. If +this is not the case (e.g., if a few lines of code are reused for a +completely different task), then clauses 6b and 6d shall not apply. + + +Important Recommendations +------------------------- + + Defining What Constitutes the Work + + The LPPL requires that distributions of the Work contain all the + files of the Work. It is therefore important that you provide a + way for the licensee to determine which files constitute the Work. + This could, for example, be achieved by explicitly listing all the + files of the Work near the copyright notice of each file or by + using a line such as: + + % This work consists of all files listed in manifest.txt. + + in that place. In the absence of an unequivocal list it might be + impossible for the licensee to determine what is considered by you + to comprise the Work and, in such a case, the licensee would be + entitled to make reasonable conjectures as to which files comprise + the Work. + diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..822d6e3 --- /dev/null +++ b/Makefile @@ -0,0 +1,86 @@ +######################################################################## +## LaTeX2e Makefile +## +## For configuration, update the following defines: +## +## $Id: Makefile 4701 2010-03-21 19:44:08Z brucker $ +## +## This file ist part of the svninfo package. Please see the file +## svninfo.dtx for copyright information. +######################################################################## + +BASE = svninfo + +TEXDIR = +CONTRIB = $(TEXDIR)/lib/texmf/tex/latex2e/contrib/$(BASE) +DOCDIR = $(TEXDIR)/doc/latex2e + +DVIPS = dvips +LATEX = latex +MAKEINDEX = makeindex +PDFLATEX = pdflatex + +TAR = tar + +######################################################################## + +REV = 0.7.4 +TAR_FILE = svninfo-$(REV).tar.gz +TAR_DIR = svninfo-$(REV) +SRC = svninfo.dtx svninfo.ins README Makefile +GEN = svninfo.sty svninfo.cfg svninfo.init + +all: $(BASE).sty dvi ps pdf clean + +sty: svninfo.sty +dtx: svninfo.dtx +dvi: svninfo.dvi +ps: svninfo.ps +pdf: svninfo.pdf +idx: $(BASE).ind $(BASE).gls + $(LATEX) $(BASE).dtx + +%.sty:%.dtx %.ins + $(LATEX) $*.ins + +svninfo.cfg: svninfo.sty +svninfo.init: svninfo.sty + +%.dvi:%.dtx + $(LATEX) $*.dtx + makeindex -s gind.ist -o svninfo.ind svninfo.idx + makeindex -s gglo.ist -o svninfo.gls svninfo.glo + $(LATEX) $*.dtx + +%.dvi:%.tex + $(LATEX) $*.tex + $(LATEX) $*.tex + +%.pdf:%.dtx + rm -f *.toc *.out + $(PDFLATEX) $*.dtx + $(PDFLATEX) $*.dtx + +%.pdf:%.tex + $(PDFLATEX) $*.tex + $(PDFLATEX) $*.tex + +%.ps:%.dvi + $(DVIPS) $*.dvi + +tar: distclean + rm -fr $(TAR_DIR) $(TAR_FILE) $(TAR_FILE).gz + mkdir $(TAR_DIR) + cp -p $(SRC) $(TAR_DIR) + $(TAR) -zcvf $(TAR_FILE) $(TAR_DIR); + rm -rf $(TAR_DIR) + +clean: + rm -f *.log *.aux *.lof *.lot *.toc *.idx *.ind *.glo *.gls *~ *.ilg \ + *.out + +realclean: clean + rm -fr *.dvi *.ps $(GEN) *.pdf + +distclean: realclean + rm -fr README-* diff --git a/README b/README new file mode 100644 index 0000000..8ee1c8a --- /dev/null +++ b/README @@ -0,0 +1,73 @@ + + `svninfo' + + version 0.7.4, March 23, 2010 + +This package is used to extract the revision and file information provided +by the subversion revision control system. + +Copyright (C) 2003-2010 Achim D. Brucker +email: brucker@member.fsf.org + +License: + This program can be redistributed and/or modified under the terms + of the LaTeX Project Public License Distributed from CTAN + archives in directory macros/latex/base/lppl.txt; either + version 1 of the License, or any later version. + +You are allowed to distribute this file under the condition that it is +distributed together with all the following files: + svninfo.ins + svninfo.dtx + Makefile + README + +If you receive only some of these files from someone, complain! + +To install: + unpack and + `make' +or execute the commands manually: + latex svninfo.ins // creates the file of this package + latex svninfo.dtx // create the package documentation + +The following files are created by 'latex svninfo.ins' + - svninfo.cfg + - svninfo.sty + - svninfo.perl + - svninfo.init + +then copy the files + svninfo.sty + svninfo.cfg +to a place where LaTeX can find it + (e.g. under UNIX: $HOME/tex/inputs + and set the environment variable + TEXINPUTS=$HOME/tex/inputs//:$TEXINPUTS + ) + +============================================================================ + +HISTORY +0.7.4 : Fixed localization of date formats, e.g., \svnToday. +0.7.3 : Fixed bug resulting in wrong date for maximal + revision (\svnInfoMaxToday). +0.7.2 : Fixed documentation: the option for using scrpage2 package is called + scrpage. Fixed support for svk. +0.7.1 : Fixed \svnMaxToday and introduced \svnInfoMaxToday as an alternative + name. Improved documentation +0.7 : Added option margin for showing version info in the margins of the + document; added option svk for supporting the keyword expansion of svk; + added new command \svnMaxToday; and fixed the use of fancyhdr for + single-sided documents. +0.6 : Added \svnInfoMinRevision and \svnInfoMaxRevision together with the + option "revrange". Also added support for \ in keywords. +0.5 : Removed support for LaTeX2HTML and added new command \svnKeyword + for defining arbitrary svn keywords (e.g. $Author:$). +0.4 : Added new package options draft, final, eso-foot, and scrpage. Fixed + problem with `\_' in file names. +0.3 : Added support for Id-keywords without owner information + (fixes a bug reported by Uwe Ziegenhagen). +0.2.1 : Added \svnId (suggested by Thomas Weber). +0.2 : Removed latex2html build-dependency +0.1 : Initial Version, based on rcsinfo from Dr. Juergen Vollmer diff --git a/README.md b/README.md deleted file mode 100644 index 9219797..0000000 --- a/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# svninfo -LaTeX package for extracting subversion (svn) revision information. diff --git a/svninfo.dtx b/svninfo.dtx new file mode 100644 index 0000000..e8e70d0 --- /dev/null +++ b/svninfo.dtx @@ -0,0 +1,1373 @@ + +% \iffalse +%<*header> + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% +%% `svninfo' package to use with LaTeX2e. +%% +%% This package is used to extract the revision and file information provided +%% by the Subversion revision control system. +%% +%% Copyright (C) 1995 Dr. Juergen Vollmer +%% Copyright (C) 2003-2010 Achim D. Brucker +%% +%% License: +%% This program can be redistributed and/or modified under the terms +%% of the LaTeX Project Public License Distributed from CTAN +%% archives in directory macros/latex/base/lppl.txt; either +%% version 1 of the License, or any later version. +%% +%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% +%\iffalse +% to test the checksum, uncomment \OnlyDescription +% in the driver +%\fi +% +%% \CheckSum{628} +%% \CharacterTable +%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z +%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +% +%\fi + +% \DoNotIndex{\begin,\CodelineIndex,\CodelineNumbered,\def,\DisableCrossrefs} +% \DoNotIndex{\DocInput,\documentclass,\EnableCrossrefs,\end,\GetFileInfo} +% \DoNotIndex{\NeedsTeXFormat,\OnlyDescription,\RecordChanges,\usepackage} +% \DoNotIndex{\ProvidesClass,\ProvidesPackage,\ProvidesFile,\RequirePackage} +% \DoNotIndex{\LoadClass,\PassOptionsToClass,\PassOptionsToPackage} +% \DoNotIndex{\DeclareOption,\CurrentOption,\ProcessOptions,\ExecuteOptions} +% \DoNotIndex{\AtEndOfClass,\AtEndOfPackage,\AtBeginDocument,\AtEndDocument} +% \DoNotIndex{\InputIfFileExists,\IfFileExists,\ClassError,\PackageError} +% \DoNotIndex{\if,\else,\fi,\emph,\footnotesize,\footrulewidth,\let} +% \DoNotIndex{\newcount,\newif,\number,\or,\parindent,\plainfootrulewidth} +% \DoNotIndex{\PrintChanges,\PrintIndex,\relax,\setlength,\space} +% \DoNotIndex{\the,\textwidth,\thepage,\newcommand,\texttt,\verb,\vfill} +% \DoNotIndex{\input,\newpage,\setcounter,\newcounter,\\,\ ,\typeout,\today} +% +% \MakeShortVerb{\|} +% \newcommand{\LatexToHtml}{\LaTeX 2\texttt{HTML}} +% \def\param#1{\texttt{\##1}} +% \newcommand{\Cmd}[1]{\texttt{$\backslash$#1}} +% \newcommand{\Svn}{\emph{Subversion}} +% \newcommand{\Svk}{\emph{svk}} +% \newcommand{\blank}{{\tiny$_\sqcup$}} +% \newcommand{\Id}{\texttt{\$Id\$}} +% \newcommand{\SvnInfoCmd}[1]{\texttt{$\backslash$svnInfo\blank\$Id#1\$\blank}} +% +% \changes{v0.7.4}{2010/03/23}{Fixed localization of date formats, +% e.g., \texttt{\\svnToday}.} +% \changes{v0.7.3}{2008/08/09}{Fixed bug resulting in wrong date for maximal +% revision} +% \changes{v0.7.2}{2008/04/28}{Fixed documentation: the option for using +% the \texttt{scrpage2} package is called \texttt{scrpage}. Fixed +% support for \texttt{svk}.} +% \changes{v0.7.1}{2007/04/27}{Fixed \texttt{\\svnMaxToday} and +% introduced \texttt{\\svnInfoMaxToday} as an alternative +% name. Improved documentation} +% \changes{v0.7}{2007/03/26}{Added option \texttt{margin} for showing +% version info in the margins of the document; added option +% \texttt{svk} for supporting the keyword expansion of svk; added command +% \texttt{\\svnMaxToday}; and fixed the use of \texttt{fancyhdr} for +% single-sided documents.} +% \changes{v0.6}{2006/05/11}{Added \texttt{\\svnInfoMinRevision} and +% \texttt{\\svnInfoMaxRevision} together with the option +% \texttt{revrange}. Also added support for \texttt{\textbackslash} in keywords.} +% \changes{v0.5}{2006/01/11}{Removed support for \LatexToHtml{} (it is +% non-free software and also seems to be unmaintained) and added new +% command \texttt{\\svnKeyword} for defining arbitrary svn keywords +% (e.g. \texttt{\string$Author:\string$}).} +% \changes{v0.4}{2005/11/07}{Added new package options \texttt{draft}, \texttt{final}, +% \texttt{eso-foot}, and \texttt{scrpage}. Fixed problem +% with `\_' in file names.} +% \changes{v0.3}{2005/09/30}{Added support for \texttt{\$Id:\$} keywords without +% owner information.} +% \changes{v0.2.1}{2005/04/07}{Added \texttt{\\svnId}.} +% \changes{v0.2}{2005/01/17}{Removed \LatexToHtml{} build-dependency.} +% \changes{v0.1}{2003/08/14}{Initial version, mainly a modified version +% of the \texttt{rcsinfo} package.} +% +% \title{The \texttt{svninfo} package} +% \author{Achim D.~Brucker\\ +% {\footnotesize brucker@member.fsf.org}\\ +% {\footnotesize http://www.brucker.ch/}} +% \date{March 23, 2010\\Version 0.7.4} +% +% \maketitle +% +% \begin{abstract} +% \noindent This package is used to extract the revision and file +% information provided by the \Svn\ +% (\texttt{http://subversion.tigris.org}) and the \Svk\ +% (\texttt{http://svk.elixus.org}) revision control system. +% \end{abstract} +% +%\section{Introduction} +% +% To maintain different versions of a document or to keep track on the +% development of one, the document is kept under a revision control +% system like \emph{SCCS}, \emph{CVS}, \Svn, or \Svk. This package +% assumes you are using either the \Svn\ or the \Svk\ system. To +% present the version information of a document, one needs to extract +% it from somewhere. For example, \Svk\ and \Svn\ offer several keywords +% that are expanded by the \Svn\ and \Svk\ \emph{update} +% commands.\footnote{The expansion of keywords has to be enabled +% manually, e.g., \texttt{svn propset svn:keywords "Id" +% svninfo.dtx}.} The most informative keyword is |$Id: svninfo.dtx 4705 2010-03-23 19:57:29Z brucker $| which +% contains a lot of useful information. This information is made +% available through this package. Additionally, the package allows one +% to extract also the information from the more specific keywords, +% e.g., |$Author$| or |$Date$|. +% +% In this documentation we use \Svn\ in the examples; but the results +% should be similar if you are using \Svk. Note that you have to use +% the \texttt{svk} option if you use \Svk. +% +% Moreover, one has to set the \Svn\ property for keywords expansion of +% that file, e.g., by executing: +% \begin{verbatim} +% svn propset svn:keywords "Id" svninfo.dtx +% \end{verbatim} +% Please consult the manual of \Svn\ (e.g., \emph{h}) or \Svk\ for further +% details about keyword expansion. +% +% The information obtained from the expanded \Id\ string are +% \begin{itemize} +% \item the filename, +% \item the revision number, +% \item the date and time of the last \Svn\ \emph{co} command, and +% \item name of the user who has done this action. +% \end{itemize} +% For each of these items a macro is defined. +% When \emph{updating} a file, the \Svn\ keywords should be contained in +% the \emph{updated} source. Further, one has to set the \Svn\ property +% for keyword expansion of that file, e.g.\ +% \begin{verbatim} +% svn propset svn:keywords "Id" svninfo.dtx +% \end{verbatim} +% See the \Svn\ documentation for more details. +% +% If you want to read about the implementation, put a \% before +% |\Only|\-|Description| in the code marked with |<*driver>| in the file +% |svninfo.dtx|. +% +%\section{User Interface} +% +%\subsection{Options} +% +% Options for this package are: +% \begin{description} +% \item[svk] +% Use \texttt{svk} for parsing the Id information generated by +% \Svk. +% \item[today] +% Set the date of |\today| to the date obtained by the \Svn\ information. +% If the \Id\ string is not expanded (see below), the current date is +% used. +% \item[notoday] +% Don't use the \Svn\ date for |\today|. +% \item[revrange] For multi-file documents, display minimum and +% maximum revision. Every file of the document must either +% include a |\svnInfo| or a |\svnKeyword $Revision:$| statement. +% This is information needs two runs of \LaTeX{} to be correct. +% \item[fancyhdr] +% We use the \texttt{fancyhdr} package to fill the footline with +% \Svn\ information: filename, revision-number and date. +% +% If the \texttt{fancyhdr} package is not already loaded, it will be +% loaded +% by this package. To use the footnotes, put something like:\\ +% \hspace*{1em}|\pagestyle{fancyplain}|\\ +% \hspace*{1em}|\fancyhead[RE,LO]{\leftmark}|\\ +% \hspace*{1em}|\fancyhead[LE,RO]{\thepage}|\\ +% in the preamble. +% \item[nofancy] +% We don't define the footline. The +% \texttt{fancyhdr} package is not loaded. +% \item[scrpage] +% Use \texttt{scrpage2} instead of \texttt{fancyhdr}. +% \item[eso-foot] +% Use \texttt{eso-pic} for showing a tiny info line at the bottom +% line of the paper. +% \item[margin] Use \texttt{margin} for showing the version info in +% the margin area. +% \item[long] +% If used together with \texttt{fancy} / \texttt{fancyhdr} the date +% string is printed in the long format +% as |\today| returns it. If \texttt{fancy} / \texttt{fancyhdr} +% is not used, nothing. +% \item[short] +% If used together with \texttt{fancy} / \texttt{fancyhdr} the date +% string is printed in the short +% format \emph{YYYY-MM-DD}. +% If \texttt{fancy} / \texttt{fancyhdr} is not used, nothing. +% \item[final] Don't define the footline. If you want the \Svn\ in the +% final document, please use\\ +% \verb|\usepackage{draft}| +% \item[draft] If \texttt{nofancy} is not used, show a footline with \Svn\ information. +% \end{description} +% If the \texttt{babel} package is used, the |\svnToday| string is language +% dependent. +% +% The default options are: \emph{draft,today,long}. You may also +% configure the default fancy heading packages in the configuration +% file |svninfo.cfg|. +% +%\subsection{Commands} +% +% \subsubsection{Defining the \Svn\ Id information} +% +% There is only one macro to define the information: +% |\svnInfo|\DescribeMacro{\svnInfo}. Since it must collaborate with +% \Svn\ it has an ``unusual'' calling sequence: The arguments are +% prefaced with a `\$' and completed with a `\$\blank' (note the final +% space or carriage return). +% The following arguments are valid:\\ +% \hspace*{0.5em} \SvnInfoCmd{}\\ +% \hspace*{0.5em} \SvnInfoCmd{:}\\ +% \hspace*{0.5em} +% \SvnInfoCmd{:\blank\emph{file}\blank\emph{rev}\blank\emph{YYYY-MM-DD}\blank\emph{hh:mm:ss}\blank\emph{owner}\blank} +% +% In the first two forms, \Svn\ has not expanded the \Id\ string. +% This form will usually be used before the file is \emph{checked in} +% the first time. +% +% \emph{YYYY-MM-DD} is a date, \emph{hh:mm:ss} a time. +% Note: when you perform the \Svn\ \emph{check out} command, the \Id\ string +% is expanded by \Svn\ automatically. +% +% To take effect, |\svnInfo| must follow the |\begin{document}|. +% If you are using multiple files for a document, you could place +% |\svnInfo| at the +% beginning of each file, so the information from the current file is +% obtained. +% +% \subsubsection{Accessing the \Svn\ Id information} +% There are the following macros to access the information provided by \Svn. +% If \Svn\ has not expanded the \Id\ string, or no |\svnInfo| command is given, +% default values are returned. +% +% \begin{itemize} +% \item \DescribeMacro{\svnInfoFile} The name of the source file. +% Default: \texttt{--sourcefile--}. +% \item \DescribeMacro{\svnInfoRevision} The revision number, of the +% \emph{checked out} file. +% Default: \texttt{--revision--}. +% \item \DescribeMacro{\svnInfoMinRevision} The minimum revision +% number of multi-file documents. Every file of the document must either +% include a |\svnInfo| or a |\svnKeyword $Revision:$| statement. +% This is information needs two runs of \LaTeX{} to be correct. +% Default: \texttt{--minrevision--}. +% \item \DescribeMacro{\svnInfoMaxRevision} The maximum revision +% number of multi-file documents. Every file of the document must either +% include a |\svnInfo| or a |\svnKeyword $Revision:$| statement. +% This is information needs two runs of \LaTeX{} to be correct. +% Default: \texttt{--maxrevision--}. +% \item \DescribeMacro{\svnInfoDate} The date in the form \emph{YYYY-MM-DD}, +% when the file was \emph{checked out}. +% Default: the current date. +% \item \DescribeMacro{\svnInfoTime} The time, when the file was +% \emph{checked out}. +% Default: \texttt{--time--}. +% \item \DescribeMacro{\svnInfoOwner} The user name of the file owner. +% Default: \texttt{--owner--}. +% \item \DescribeMacro{\svnInfoYear} The year \emph{YYYY} of |\svnInfoDate|. +% Default: the current year. +% \item \DescribeMacro{\svnInfoMonth} The month \emph{MM} of |\svnInfoDate|. +% Default: the current month. +% \item \DescribeMacro{\svnInfoDay} The day \emph{DD} of |\svnInfoDate|. +% Default: the current day. +% \item \DescribeMacro{\svnInfoLongDate} The date in the form of |\today| +% when the file was \emph{checked out}. This is language depended. +% Default: the current date. +% \item \DescribeMacro{\svnId} Mimics the behavior of the \Id\ strings, i.e.\ it +% prints a string with a summary of the above described +% information. +% \item \DescribeMacro{\svnToday} The date obtained from the \Svn\ information +% in the format |\today| is using. +% \item \DescribeMacro{\svnInfoMaxToday} The date obtained from the latest +% \Svn\ revision in the format |\today| is using. +% \end{itemize} +% \section{Examples} +% +% \newcommand{\svnExample}{ +% \begin{tabular}[t]{rl} +% \Cmd{svnInfoFile} & \svnInfoFile \\ +% \Cmd{svnInfoRevision} & \svnInfoRevision \\ +% \Cmd{svnInfoMinRevision} & \svnInfoMinRevision \\ +% \Cmd{svnInfoMaxRevision} & \svnInfoMaxRevision \\ +% \Cmd{svnInfoDate} & \svnInfoDate \\ +% \Cmd{svnInfoTime} & \svnInfoTime \\ +% \Cmd{svnInfoOwner} & \svnInfoOwner \\ +% \end{tabular} +% \begin{tabular}[t]{rl} +% \Cmd{svnInfoYear} & \svnInfoYear \\ +% \Cmd{svnInfoMonth} & \svnInfoMonth \\ +% \Cmd{svnInfoDay} & \svnInfoDay \\ +% \Cmd{svnInfoLongDate} & \svnInfoLongDate \\ +% \Cmd{svnToday} & \svnToday \\ +% \Cmd{svnInfoMaxYear} & \svnInfoMaxYear \\ +% \Cmd{svnInfoMaxDay} & \svnInfoMaxDay \\ +% \Cmd{svnInfoMaxMonth} & \svnInfoMaxMonth \\ +% \Cmd{svnInfoMaxToday} & \svnInfoMaxToday \\ +% \end{tabular}\\ +% \Cmd{svnId} \svnId +% \bigskip +%} +% +% \svnInfo $Id: svninfo.dtx 4705 2010-03-23 19:57:29Z brucker $ +% |\svnInfo| not expanded, no colon\\ +% \verb+\svnInfo $+\verb+Id$+\\ +% \svnExample +% +% \svnInfo $Id: svninfo.dtx 4705 2010-03-23 19:57:29Z brucker $ +% |\svnInfo| not expanded, having colon\\ +% \verb+\svnInfo $+\verb+Id:$+\\ +% \svnExample +% +% \svnInfo $Id: svninfo.dtx 4705 2010-03-23 19:57:29Z brucker $ +% |\svnInfo| standard version\\ +% {\small\verb+\svnInfo $Id: svninfo.dtx 4705 2010-03-23 19:57:29Z brucker $+}\\ +% \svnExample +% +% \svnInfo $Id: svninfo.dtx 4705 2010-03-23 19:57:29Z brucker $ +% |\svnInfo| standard version without owner\\ +% {\small\verb+\svnInfo $Id: svninfo.dtx 4705 2010-03-23 19:57:29Z brucker $+}\\ +% \svnExample +% +% \svnInfo $Id: svninfo.dtx 4705 2010-03-23 19:57:29Z brucker $ +% |\svnInfo| standard version with \\ in the owner \\ +% {\small\verb+\svnInfo $Id: svninfo.dtx 4705 2010-03-23 19:57:29Z brucker $+}\\ +% \svnExample +% +% \svnInfo Id: svninfo.dtx 12 2002-04-19 12:27:55 brucker $ +% |\svnInfo| no leading \$\\ +% {\footnotesize\verb+\svnInfo Id: svninfo.dtx 12 2002-04-19 12:27:55 brucker $+}\\ +% \svnExample +% +% \section{The generic \Svn\ keyword interface} +% In addition to the already presented |\svnInfo| macro which is +% specially built for analyzing the \Svn\ |$Id: svninfo.dtx 4705 2010-03-23 19:57:29Z brucker $| information we also +% provide a generic interface via +% |\svnKeyword|\DescribeMacro{\svnKeyword}. This interface can +% be used to extract information from the remaining keywords: +% \begin{itemize} +% \item |$Date$|: The date of the last commit with changes. This +% information can also be accessed using the keyword +% |$LastChangedDate$|. +% \item |$Revision$|: The revision of the last commit with +% changes. This information can also be accessed using the keyword +% |$LastChangedRevision$| or |$Rev$|. +% \item |$Author$|: The author of the last commit with changes. This +% information can also be accessed using the keyword +% |$LastChangeBy$|. +% \item |$HeadURL$|: The the full URL to the latest version of the +% file in the repository. This information can also be accessed +% using the keyword |$URL$|. +% \end{itemize} +% These keywords can be accessed using the |\svnKeyword| +% macro. This macro accepts a single argument that should be of the +% form |$|\meta{Keyword}|$| (unexpanded) or +% |$|\meta{Keyword}:\blank\meta{value}\blank|$| (expanded), e.g.: +% \begin{verbatim} +% \svnKeyword $Author: brucker $ +% \end{verbatim} +% The |\svnKeyword| updates the corresponding \Svn\ Id +% information, e.g., our example updates |\svnInfoOwner|. In more +% detail: +% \begin{itemize} +% \item |\svnKeyword $Date:$| updates the date and time +% information, e.g., |\svnInfoDate|\DescribeMacro{\svnInfoDate}, +% |\svnInfoMonth|\DescribeMacro{\svnInfoMonth}, or +% |\svnInfoTime|\DescribeMacro{\svnInfoTime}. +% \item |\svnKeyword $Revision:$| updates +% |\svnInfoRevision|\DescribeMacro{\svnInfoRevision}. +% \item |\svnKeyword $Author:$| updates +% |\svnInfoOwner|\DescribeMacro{\svnInfoOwner}. +% \item |\svnKeyword $HeadURL:$| updates +% |\svnInfoHeadURL|\DescribeMacro{\svnInfoHeadURL}. +% \end{itemize} +% +% Note, the parser used by |\svnKeyword| is not that powerful than +% the one used by |\svnInfo|. Thus it is advisable to use +% |\svnKeywordId| for the |$Id: svninfo.dtx 4705 2010-03-23 19:57:29Z brucker $| keyword and |\svnKeyword| +% only for the keywords described in this section. +% +% Further, the |\svnKeyword| macro does not reset all keyword +% definitions globally, i.e., you can combine the |$Revision$| +% of one file, with the |$Author$| of another file. Please take +% care of that! +% +% \section{Acknowledgments} +% %%%%%%%%%%%%%%%%%%%%%%%%% +% This package is based on \texttt{rcsinfo} from Dr.~J{\"u}rgen +% Vollmer. The \texttt{rcsinfo} package is distributed via the CTAN +% archives ('\texttt{macros/latex/contrib/rcsinfo}'). +% +% The code for parsing generic \Svn{} keywords was taken from the +% \texttt{svn} packages written by Richard Lewis. The \texttt{svn} +% package is distributed via the CTAN archives +% ('\texttt{macros/latex/contrib/svn}'). +% +% Further I want to thank all the people that reported bugs and ideas +% for improvements, often including patches: Andreas Haller, Benjamin +% Hiller, Christophe Jacquet, Dries Kimpe, Jami Lawrence, Henning +% Lenz, Stefan Mann, Nigel Metheringham, Igor Nikolic, Michael +% Niedermair, Heiko Oberdiek, Oliver Pons, Bernd Raichle, Krzysztof +% Retel, J\"org, Sommer, Arnout Standaert, Daniel Tr\"umper, Thomas +% Weber, and Uwe Ziegenhagen. +% +% \section{Copyright and License} +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% \begin{tabular}{ll} +% Copyright (\copyright) 1995 & Dr. J{\"u}rgen Vollmer\\ +% Copyright (\copyright) 2003--2010 & Achim D.~Brucker \texttt{brucker@member.fsf.org}\\ +% \end{tabular} +% +% \noindent This program can be redistributed and/or modified under +% the terms of the \LaTeX{} Project Public License Distributed from +% CTAN archives in directory '\texttt{macros/latex/base/lppl.txt}'; +% either version 1 of the License, or any later version. +% +% \StopEventually{} +% +% \section{The Documentation Driver File} +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% The next bit of code contains the documentation driver file for +% \TeX\, i.e., the file that will produce the documentation you are +% currently reading. It will be extracted from this file by the +% \texttt{docstrip} program. +% +% If you want to read about the implementation, put a \% before +% |\OnlyDescription| in the following code. +% \begin{macrocode} +%<*driver> +\documentclass{article} +\usepackage{doc} +\usepackage[nofancy]{svninfo} +\OnlyDescription +\makeatletter +\if@svnInfoUseFancyhdr@ +\pagestyle{fancyplain} +\if@twoside +\fancyhead[RE,LO]{\leftmark} +\fancyhead[LE,RO]{\thepage} +\else +\fancyhead[R]{\leftmark} +\fancyhead[L]{\thepage} +\fi +\fi +\makeatother +\RecordChanges +\EnableCrossrefs +\CodelineIndex +\begin{document} +\DocInput{svninfo.dtx} +\PrintChanges +\setcounter{IndexColumns}{2} +\PrintIndex +\end{document} +% +% \end{macrocode} +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% \section{The Configuration File} +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% You can set up the default fancy headings package in the file +% |svninfo.cfg|. +% Use the |fancyhdr| package, by setting the default option: |fancyhdr|. +% \begin{macrocode} +%<*config> +\ExecuteOptions{fancyhdr} +% +% \end{macrocode} +% +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% \section{The Implementation} +% %%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% The implementation is based on cracking the \Id\ string. +% +% What do we need, and who we are: +% \begin{macrocode} +%<*package> +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{svninfo}[2010/03/22 v0.7.4] +% \end{macrocode} +% +% Declare some local counters to store the \Svn\ date +% \begin{macrocode} +\newcount\@svnInfoDay +\newcount\@svnInfoMonth +\newcount\@svnInfoYear +% \end{macrocode} +% +% To memorize, that we want to set |\svnToday| to the date obtained by the +% \Svn\ information. +% \begin{macrocode} +\newif\if@svnInfoToday@ +% \end{macrocode} +% +% |\svnToday| should return the date obtained by the \Svn\ information. +% \begin{macrocode} +\DeclareOption{today}{ + \@svnInfoToday@true +} +% \end{macrocode} +% +% Ok we don't want do use it. +% \begin{macrocode} +\DeclareOption{notoday}{ + \@svnInfoToday@false +} +% \end{macrocode} +% To memorize if we should show ranges of revision (for multiple-file +% documents): +% \begin{macrocode} +\newif\if@svnInfoRevRange@ +\@svnInfoRevRange@false +% \end{macrocode} +% \begin{macrocode} +\DeclareOption{revrange}{ + \@svnInfoRevRange@true +} +% \end{macrocode} +% \begin{macrocode} +% To memorize if we are in final or draft mode: +% \begin{macrocode} +\newif\if@svnInfoDraft@ +% \end{macrocode} +% \begin{macrocode} +\DeclareOption{final}{ + \@svnInfoDraft@false +} +\DeclareOption{draft}{ + \@svnInfoDraft@true +} +% \end{macrocode} +% +% To memorize, that we want to have the old \texttt{fancyheadings}, the new +% \texttt{fancyhdr}, \texttt{srcpage2}, \texttt{eso-pic}, or \texttt{margin}. +% footline filled with \Svn\ information. +% \begin{macrocode} +\newif\if@svnInfoNotPreamble@% +\@svnInfoNotPreamble@false% +\newif\if@svnInfoUseFancy@ +\newif\if@svnInfoUseFancyhdr@ +\newif\if@svnInfoUseScrpage@ +\newif\if@svnInfoUseEsofoot@ +\newif\if@svnInfoUseMargin@ +\newif\if@svnInfoSVK@ +% \end{macrocode} +% +% We want to use the \texttt{fancyhdr} +% package, and set the footline with the \Svn\ information. +% Only one option may be in effect. +% \begin{macrocode} +\DeclareOption{fancy}{ + \@svnInfoUseFancy@true + \@svnInfoUseFancyhdr@false + \@svnInfoUseScrpage@false + \@svnInfoUseEsofoot@false +} +\DeclareOption{fancyhdr}{ + \@svnInfoUseFancy@false + \@svnInfoUseFancyhdr@true + \@svnInfoUseScrpage@false + \@svnInfoUseEsofoot@false +} +\DeclareOption{scrpage}{ + \@svnInfoUseFancy@false + \@svnInfoUseFancyhdr@false + \@svnInfoUseScrpage@true + \@svnInfoUseEsofoot@false +} +\DeclareOption{eso-foot}{ + \@svnInfoUseFancy@false + \@svnInfoUseFancyhdr@false + \@svnInfoUseScrpage@false + \@svnInfoUseEsofoot@true +} +\DeclareOption{margin}{ + \@svnInfoUseMargin@true +} +\DeclareOption{svk}{ + \@svnInfoSVK@true +} +% \end{macrocode} +% +% Ok we don't want do use it. +% \begin{macrocode} +\DeclareOption{nofancy}{ + \@svnInfoUseFancy@false + \@svnInfoUseFancyhdr@false + \@svnInfoUseScrpage@false + \@svnInfoUseEsofoot@false +} +% \end{macrocode} +% +% To memorize, that we want to use the long date format. +% \begin{macrocode} +\newif\if@svnInfoLong@ +% \end{macrocode} +% +% We want to use the long date format. +% \begin{macrocode} +\DeclareOption{long}{ + \@svnInfoLong@true +} +% \end{macrocode} +% +% Ok we don't want do use it. +% \begin{macrocode} +\DeclareOption{short}{ + \@svnInfoLong@false +} +% \end{macrocode} +% +% Use these default options, +% \begin{macrocode} +\ExecuteOptions{draft,today,long} +% \end{macrocode} +% +% read the configuration file, to set the default fancy headings package, +% \begin{macrocode} +\IfFileExists{svninfo.cfg}{\input{svninfo.cfg}}{} +% \end{macrocode} +% +% and the process the user options. +% \begin{macrocode} +\ProcessOptions*\relax +% \end{macrocode} +% Load packages for page headers of footers if necessary. +% \begin{macrocode} +\if@svnInfoDraft@ + \if@svnInfoUseFancy@ + \RequirePackage{fancyheadings} + \fi + \if@svnInfoUseFancyhdr@ + \RequirePackage{fancyhdr} + \fi + \if@svnInfoUseScrpage@ + \RequirePackage{scrpage2} + \fi + \if@svnInfoUseEsofoot@ + \RequirePackage{eso-pic} + \fi +\fi +% \end{macrocode} +% +% \begin{macrocode} +\RequirePackage{ifthen} +% \end{macrocode} +% +% If no language for the |babel| package is given in the document, +% we have to redefine |\svnToday| (otherwise the changed |\year|, |\month| and +% |\day| won't work). In this case use the English version of |\svnToday|. +% \begin{macrocode} +\def\svnToday{\@svnInfoToday} +%ifcase\month\or +% January\or February\or March\or April\or May\or June\or +% July\or August\or September\or October\or November\or December\fi +% \space\number\day, \number\year} +% \end{macrocode} +% +% We have a problem, since the number of arguments of |\svnInfo| vary from +% zero to five. +% To deal with that, we use some kind ``continuation passing'' style of +% programming. +% |\@svnInfoNext| contains the action to be done next. +% + +%\begin{macro}{\svnInfo} +% Extract the \Svn\ information, and give commands shown above their values. +% Check the catcode of |:| and set the flag. The restoration is done after the +% |:| has been read. Allow \_ (underscore) in file names, hence change the +% |\catcode| of it. +% \begin{macrocode} + +% +% Whenever reading another portion of the SVN/RCS info, +% expand \@svnBeginRead before calling the reading macro +% and call \@svnEndRead as first thing inside the reading macro. +\def\@svnBeginRead{\begingroup + \catcode`\_=13 % + \catcode`:=12 % + \catcode`\\=12 % +} +\def\@svnEndRead{\endgroup +} + + +\def\svnInfo {\@svnBeginRead + \@svnInfoReadArgs + } +% \end{macrocode} +%\end{macro} + +%\begin{macro}{\@svnInfoReadArgs} +% First check, if the \Id\ string is not-expanded. +% Set the default values, so that for not expanded \Id\ strings, we get them. +% The \$ before |Id| may be omitted (I use this to avoid expansion of +% \$Id-Tags to be expanded by SVN in some cases). +% Restore the catcode of the |:|. +% \begin{macrocode} + +\def\@svnInfoReadArgs #1Id#2 {\@svnEndRead + \@svnInfoDefaults + \if $#2 \expandafter\@svnInfoEat + \else \@svnBeginRead + \expandafter\@svnInfoEatColon + \fi + $Id#2 % +} +% \end{macrocode} +%\end{macro} + +%\begin{macro}{\@svnInfoEat} +% This macro eats up its argument, i.e.\ removes it from the input. +% Reset the |\catcode| of the underscore. +% \begin{macrocode} +\def\@svnInfoEat #1 {} +% \end{macrocode} +%\end{macro} + +%\begin{macro}{\@svnInfoEatColon} +% This macro eats up the colon following \texttt{Id}. +% The colon may be followed by a \$, which means that the \Id\ string is not +% expanded. +% \begin{macrocode} +\def\@svnInfoEatColon $Id:#1 {\@svnEndRead + \if $#1 \expandafter\@svnInfoEat + \else \@svnBeginRead + \expandafter\@svnInfoCrackAndEat + \fi + #1 % +} +% \end{macrocode} +%\end{macro} + +%\begin{macro}{\@svnInfoCrackAndEat} +% Take an expanded \Id\ string pass it to the crack routine +% |\@svnInfoCrack|\-|String|, which specifies what has to be done +% after it. We have already eaten the \$. +% Note: here we don't give an argument to |\@svnInfoNext|, since it is taken +% form the source, in case of |\@svnInfoEat|. +% We have to take the next 7 tokens. +% Note, first argument (\verb|#1|) contains only spaces. +% \begin{macrocode} +\def\@svnInfoCrackAndEat #1 #2 #3 #4 #5 #6 {\@svnEndRead + \@svnInfoCrackString #2 #3 #4 #5 #6 % +} +% \end{macrocode} +%\end{macro} + +%\begin{macro}{\@svnInfoCrackString} +% Take an expanded \Id\ string and crack it:\\ +% \#1: filename, \#2 revision, \#3 date, \#4 time, \#5 owner\\ +% Hence we have to consume the terminating \$ afterwards. Reset +% the |\catcode| of the underscore. +% +% If the document checked into the repository without authentication, +% the owner may be empty. In that case the argument \#5 is \$ and +% we already consumed the terminating \$. +% +% Split the date into year,month and day. +% If the option \texttt{today} is given, |\svnToday| returns from now +% on the \Svn\ date. +% +% \begin{macrocode} +\def\@svnInfoCrackString #1 #2 #3 #4 #5 {% + \def\svnInfoFile{#1}% + \def\svnInfoRevision{#2}% + \def\svnInfoTime{#4}% + % + \@svnInfoSplitDate x#3r#2x% + \@svnInfoMargin% + \def\svnInfoLongDate{\@svnInfoToday}% +% + \if@svnInfoToday@ + \year =\@svnInfoYear + \month =\@svnInfoMonth + \day =\@svnInfoDay + \fi +\ifthenelse{\(\equal{\svnInfoMaxRevision}{--maxrevision--}\) % + \OR \( \svnInfoMaxRevision < #2 \)}{% + \def\svnInfoMaxRevision{#2}% + }{}% + \ifthenelse{\(\equal{\svnInfoMinRevision}{--minrevision--}\) % + \OR \( #2 < \svnInfoMinRevision \)}{\def\svnInfoMinRevision{#2}}{}% + \if $#5 \def\svnInfoOwner{}%$% + \def\svnId{#1\ #2\ #3\ #4}% + \else + \def\svnInfoOwner{#5}% + \def\svnId{#1\ #2\ #3\ #4\ #5}% + \expandafter\@svnInfoEat + \fi +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@svnInfoSplitDate} +% This macro sets |\svnInfoYear|, |\svnInfoMonth|, and |\svnInfoDay|. +% It takes a \texttt{x}\emph{YYYY-MM-DD}\texttt{x} style of argument. +% \begin{macrocode} +\if@svnInfoSVK@ + \def\@svnInfoSplitDate x#1-#2-#3T#4Zr#5x{% + \@svnInfoDay =#3\relax + \@svnInfoMonth=#2\relax + \@svnInfoYear =#1\relax + \ifthenelse{\(\equal{\svnInfoMaxRevision}{--maxrevision--}\) + \OR \( \svnInfoMaxRevision < #5 \)}{% + \def\svnInfoMaxYear{#1}% + \def\svnInfoMaxMonth{#2}% + \def\svnInfoMaxDay{#3}% + }{}% +} +\else% + \def\@svnInfoSplitDate x#1-#2-#3r#4x{% + \@svnInfoDay =#3\relax + \@svnInfoMonth=#2\relax + \@svnInfoYear =#1\relax + \ifthenelse{\(\equal{\svnInfoMaxRevision}{--maxrevision--}\) + \OR \( \svnInfoMaxRevision < #4 \)}{% + \def\svnInfoMaxYear{#1}% + \def\svnInfoMaxMonth{#2}% + \def\svnInfoMaxDay{#3}% + }{}% +} +\fi% +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@svnInfoToday} +% Returns the \Svn\ date in the form as |\today| does it. +% To do this, we set |\year|, |\month| and |\day| commands to the +% corresponding \Svn\ information, let |\svnToday| does its work, i.e.\ +% transforming the date into a language dependent string and reset +% |\year|, |\month| and |\day| to their previous value. +% +% \begin{macrocode} +\def\@svnInfoToday {% + \begingroup + \year =\@svnInfoYear + \month =\@svnInfoMonth + \day =\@svnInfoDay + \today + \endgroup +} +\def\@svnInfoMaxToday {% + \begingroup + \year =\svnInfoMaxYear + \month =\svnInfoMaxMonth + \day =\svnInfoMaxDay + \today + \endgroup +} + +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@svnInfoDefaults} +% This macro sets the default values. +% \begin{macrocode} +\def\@svnInfoDefaults {% + \@svnInfoYear =\year + \@svnInfoMonth =\month + \@svnInfoDay =\day + \ifthenelse{\isundefined{\svnInfoMaxYear}}{\def\svnInfoMaxYear{\the\year}}{} + \ifthenelse{\isundefined{\svnInfoMaxMonth}}{\def\svnInfoMaxMonth{\the\month}}{} + \ifthenelse{\isundefined{\svnInfoMaxDay}}{\def\svnInfoMaxDay{\the\day}}{} + \def\svnInfoFile{--sourcefile--}% + \def\svnInfoHeadURL{--head-url--}% + \def\svnInfoDate{\the\@svnInfoYear-\two@digits\@svnInfoMonth-% + \two@digits\@svnInfoDay}% + \def\svnInfoTime{--time--}% + \def\svnInfoRevision{--revision--}% + \ifthenelse{\isundefined{\svnInfoMinRevision}}{\def\svnInfoMinRevision{--minrevision--}}{}% + \ifthenelse{\isundefined{\svnInfoMaxRevision}}{\def\svnInfoMaxRevision{--maxrevision--}}{}% + \def\svnInfoOwner{--owner--}% + \def\svnInfoYear{\the\@svnInfoYear}% + \def\svnInfoMonth{\the\@svnInfoMonth}% + \def\svnInfoDay{\the\@svnInfoDay}% + \def\svnInfoLongDate{\@svnInfoToday}% + \def\svnInfoMaxToday{\@svnInfoMaxToday}% + \def\svnMaxToday{\@svnInfoMaxToday}% + \def\svnId{\svnInfoFile\ \svnInfoRevision\ \svnInfoTime\ \svnInfoOwner}% +} + +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@svnInfoFancyFoot} +% This defines the contents of the footline +% \begin{macrocode} +\def\@svnInfoFancyFoot {% + \if@svnInfoRevRange@ + \def\@svnInfoRevisionRange{{ (\svnInfoMinRevision : \svnInfoMaxRevision)}}% + \else + \def\@svnInfoRevisionRange{\relax}% + \fi + \if@svnInfoLong@ + \def\@svnInfoFancyInfo{{\footnotesize + \emph{Rev: \svnInfoRevision\@svnInfoRevisionRange, % + \svnInfoLongDate}}}% + \else + \def\@svnInfoFancyInfo{{\footnotesize + \emph{Rev: \svnInfoRevision\@svnInfoRevisionRange, % + \svnInfoDate}}}% + \fi + \def\@svnInfoFancyFile{{\footnotesize\emph{\svnInfoFile}}}% +% \end{macrocode} +% and set it for the \texttt{fancyheadings} package, +% package page style. +% \begin{macrocode} + \if@svnInfoDraft@ + \if@svnInfoUseFancy@ + \rfoot[\fancyplain{\@svnInfoFancyFile}{\@svnInfoFancyFile}]% + {\fancyplain{\@svnInfoFancyInfo}{\@svnInfoFancyInfo}}% + \lfoot[\fancyplain{\@svnInfoFancyInfo}{\@svnInfoFancyInfo}]% + {\fancyplain{\@svnInfoFancyFile}{\@svnInfoFancyFile}}% + \setlength{\footrulewidth}{0.4pt}% + \setlength{\plainfootrulewidth}{0.4pt}% + \fi + \fi +% \end{macrocode} +% for the \texttt{fancyhdr} package, +% \begin{macrocode} + \if@svnInfoDraft@ + \if@svnInfoUseFancyhdr@ + \if@twoside + \fancyfoot[LE,RO]{\@svnInfoFancyInfo}% + \fancyfoot[LO,RE]{\@svnInfoFancyFile}% + \fancyfoot[CO,CE]{\thepage}% + \renewcommand{\footrulewidth}{0.4pt}% + \fancypagestyle{plain}{% + \fancyfoot[LE,RO]{\@svnInfoFancyInfo}% + \fancyfoot[LO,RE]{\@svnInfoFancyFile}% + \fancyfoot[CO,CE]{\thepage}% + \renewcommand{\footrulewidth}{0.4pt}% + } + \else + \fancyfoot[L]{\@svnInfoFancyInfo}% + \fancyfoot[R]{\@svnInfoFancyFile}% + \fancyfoot[C]{\thepage}% + \renewcommand{\footrulewidth}{0.4pt}% + \fancypagestyle{plain}{% + \fancyfoot[L]{\@svnInfoFancyInfo}% + \fancyfoot[R]{\@svnInfoFancyFile}% + \fancyfoot[C]{\thepage}% + \renewcommand{\footrulewidth}{0.4pt}% + } + \fi + \fi + \fi +% \end{macrocode} +% for the \texttt{srcpage2} package, +% \begin{macrocode} + \if@svnInfoDraft@ +\if@svnInfoUseScrpage@ + \clearscrheadfoot% + \ohead{\headmark}% + \cfoot[\emph{\@svnInfoFancyInfo}]{\emph{\@svnInfoFancyInfo}}% + \ifoot[\@svnInfoFancyFile]{\@svnInfoFancyFile}% + \ofoot[\pagemark]{\pagemark}% + \pagestyle{scrheadings}% + \fi +\fi +% \end{macrocode} +% for the \texttt{eso-pic} package, +% \begin{macrocode} + \if@svnInfoDraft@ + \if@svnInfoUseEsofoot@ + \AddToShipoutPicture{% + \setlength{\unitlength}{1mm}% + \put(5,5){\tiny\svnInfoFile\quad\svnInfoRevision\quad\svnInfoDate% + \quad\svnInfoTime\quad\svnInfoOwner}% + } +\fi +\fi +} +% \end{macrocode} +% \end{macro} +% \begin{macro}{\@svnInfoMargin} +% for the \texttt{margin} option. +% \begin{macrocode} +\def\@svnInfoMargin{ + \if@svnInfoDraft@ + \if@svnInfoNotPreamble@ + \if@svnInfoUseMargin@ + \expandafter\marginpar[% + {\raggedleft\tiny\svnInfoFile, \svnInfoRevision, % + \svnInfoDate, \svnInfoTime, \svnInfoOwner}% + ]{% + {\raggedright\tiny\svnInfoFile, \svnInfoRevision, % + \svnInfoDate, \svnInfoTime, \svnInfoOwner}% + }% +\fi +\fi +\fi +} +% \end{macrocode} +% +% \end{macro} +% +% Initialize the defaults +% \begin{macrocode} +\@svnInfoDefaults +% \end{macrocode} + +% At the start of the document, if we use the +% \texttt{fancyhdr} footline, we should set it here. +% \begin{macrocode} +\AtBeginDocument{% + \@svnInfoNotPreamble@true + \if@svnInfoDraft@ + \if@svnInfoUseFancy@ + \@svnInfoFancyFoot + \fi + \if@svnInfoUseFancyhdr@ + \@svnInfoFancyFoot + \fi + \if@svnInfoUseScrpage@ + \@svnInfoFancyFoot + \fi + \if@svnInfoUseEsofoot@ + \@svnInfoFancyFoot + \fi +\fi +} +% \end{macrocode} +% At the end of the document +% \begin{macrocode} +\AtEndDocument{% + \immediate\write\@mainaux{\string\gdef\string\svnInfoMinRevision{\svnInfoMinRevision}}% + \immediate\write\@mainaux{\string\gdef\string\svnInfoMaxRevision{\svnInfoMaxRevision}}% + \immediate\write\@mainaux{\string\gdef\string\svnInfoMaxDay{\svnInfoMaxDay}}% + \immediate\write\@mainaux{\string\gdef\string\svnInfoMaxMonth{\svnInfoMaxMonth}}% + \immediate\write\@mainaux{\string\gdef\string\svnInfoMaxYear{\svnInfoMaxYear}}% +} +% \end{macrocode} +%\subsection{The generic \texttt{\string\svnKeyword} command} +% \begin{macro}{\svnKeyword} +% |\svnKeyword| is the main construct. The single argument +% should be of the form |$|\meta{Keyword}|$| or +% |$|\meta{Keyword}:\meta{space}\meta{value}\meta{space}|$|, where +% \meta{Keyword} and \meta{value} must be non-empty as well as +% brace- and |\if|--|\fi|- balanced. \meta{space} is a single space +% (if more are present they will be subsumed into \meta{value}). If +% `|$empty$|', `|$generic$|', |$Time$| or ever become keywords, or +% if keywords containing |@| ever exist then we may have problems. +% \begin{macrocode} +\def\svnKeyword $#1${\svn@$#1: $} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\svnKeywordempty} +% If \meta{Keyword} is unexpanded then |\svnKeywordKeyword| is +% set to the macro |\svnKeywordempty|, which is initially empty. +% \begin{macrocode} +\let\svnKeywordempty\relax +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\svn@} +% \begin{macro}{\svn@tmp} +% |\svn@| does the work for |\svnKeyword|. It takes two +% arguments, the first is the \meta{Keyword}'s name, the second is +% empty (in which case \meta{Keyword} was unexpanded) or +% \meta{value}, the expansion of \meta{keyword}. +% \begin{macrocode} +\def\svn@$#1: #2${% + \def\svn@tmp{#2}% +% \end{macrocode} +% \begin{macro}{\svn@suffix} +% If \param2 is empty, then the keyword was unexpanded and +% |\svn@suffix| is set to |@unexp|, otherwise we had an +% expanded keyword so |\svn@suffix| is set to |@exp|. +% \begin{macrocode} + \ifx\svn@tmp\@empty + \def\svn@suffix{@unexp}% + \else + \def\svn@suffix{@exp}% + \fi +% \end{macrocode} +% If |\svnKeyword@|\param1\meta{suffix} is defined then run it +% with arguments `\param1\param2', else run +% |\svnKeyword@generic@|\meta{suffix} (again with argument +% \param1\param2---by default this defines `|\svnKeyword|\meta{\param1}' to +% be \param2, or |\svnKeywordempty| in the unexpanded case). +% \begin{macrocode} + \@ifundefined{svnKeyword@#1\svn@suffix}% + {\@nameuse{svnKeyword@generic\svn@suffix}{#1}{#2}}% + {\@nameuse{svnKeyword@#1\svn@suffix}{#1}{#2}}% +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \subsubsection{Dealing with general \texttt{\string$Keyword\string$}s} +% \begin{macro}{\svnKeyword@generic@exp} +% When we see |\svnKeyword $KeyWord: $|, and +% |\svnKeyword@KeyWord@exp| is undefined, then we define the macro +% |\svnKeywordKeyWord| to be || using +% |\svnKeyword@generic@exp{KeyWord}{}|. +% \begin{macrocode} +\def\svnKeyword@generic@exp#1#2{% + \expandafter\svn@set\csname svnKeyword#1\endcsname$#2$% +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\svnKeyword@generic@unexp} +% When we see |\svnKeyword $KeyWord$| and +% |\svnKeyword@KeyWord@unexp| is undefined, we define +% |\svnKeywordKeyWord| to be |\svnKeywordempty| using +% |\svnKeyword@generic@unexp{KeyWord}|. +% \begin{macrocode} +\def\svnKeyword@generic@unexp#1#2{% + \expandafter\global\expandafter\let\csname svnKeyword#1\endcsname\svnKeywordempty +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\svn@set} +% |\svn@set#1$#2$| defines the command in \param{1} to be \param{2} +% without the trailing `\verb*| : |' that the call to |\svn@| added. +% \begin{macrocode} +\def\svn@set#1$#2 : ${\gdef#1{#2}} +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Dealing with the \texttt{\string$Date\string$} keyword} +% \begin{macro}{\svnKeyword@Date@unexp} +% \begin{macro}{\svnKeyword@LastChangedDate@unexp} +% \begin{macrocode} +\def\svnKeyword@Date@unexp#1#2{}% +\let\svnKeyword@LastChangedDate@unexp\svnKeyword@Date@unexp% +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\svnKeyword@Date@exp} +% \begin{macro}{\svnKeyword@LastChangedDate@exp} +% \begin{macrocode} +\def\svnKeyword@Date@exp#1#2{% + \svn@parse@date$#2$% +}% +\let\svnKeyword@LastChangedDate@exp\svnKeyword@Date@exp +% \end{macrocode} +% \end{macro} +% \end{macro} +% \begin{macro}{\svn@parse@date} +% \begin{macrocode} +\if@svnInfoSVK@ + \def\svn@parse@date$#1-#2-#3T#4:#5:#6.#7${% + \@svnInfoDay =#3\relax% + \@svnInfoMonth=#2\relax% + \@svnInfoYear =#1\relax% + \def\svnInfoLongDate{\@svnInfoToday}% + \if@svnInfoToday@ + \year =\@svnInfoYear + \month =\@svnInfoMonth + \day =\@svnInfoDay + \fi +% \end{macrocode} +% We could add `GMT' to |\svnKeywordTime|. Or not bother. +% \begin{macrocode} + \def\svnInfoTime{#4:#5:#6}% + } +\else +\def\svn@parse@date$#1-#2-#3 #4:#5:#6 #7${% + + \@svnInfoDay =#3\relax% + \@svnInfoMonth=#2\relax% + \@svnInfoYear =#1\relax% + \def\svnInfoLongDate{\@svnInfoToday}% + \if@svnInfoToday@ + \year =\@svnInfoYear + \month =\@svnInfoMonth + \day =\@svnInfoDay + \fi + \def\svnInfoTime{#4:#5:#6}% + } +\fi +% \end{macrocode} +% \end{macro} + +% \subsubsection{Dealing with the \texttt{\string$Id\string$} keyword} +% \begin{macro}{\svnKeyword@Id@unexp} +% \begin{macrocode} +\def\svnKeyword@Id@unexp#1#2{}% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\svnKeyword@Id@exp} +% \begin{macrocode} +\def\svnKeyword@Id@exp#1#2{% + \svn@parse@id$#2$ +}% +\def\svn@parse@id$#1 : ${% + \svnInfo $Id: svninfo.dtx 4705 2010-03-23 19:57:29Z brucker $ % +}% +% \end{macrocode} +% \end{macro} + +% \subsubsection{Dealing with the \texttt{\string$Author\string$} keyword} +% \begin{macro}{\svnKeyword@Author@unexp} +% \begin{macro}{\svnKeyword@LastChangedBy@exp} +% \begin{macrocode} +\def\svnKeyword@Author@unexp#1#2{}% +\let\svnKeyword@LastChangedBy@unexp\svnKeyword@Author@unexp% +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\svnKeyword@Author@exp} +% \begin{macro}{\svnKeyword@LastChangedBy@exp} +% \begin{macrocode} +\def\svnKeyword@Author@exp#1#2{% + \svn@parse@Author$#2$ +}% +\def\svn@parse@Author$#1 : ${% + \def\svnInfoOwner{#1}% +}% +\let\svnKeyword@LastChangedBy\svnKeyword@Author@exp% +% \end{macrocode} +% \end{macro} +% \end{macro} + +% \subsubsection{Dealing with the \texttt{\string$Revision\string$} keyword} +% \begin{macro}{\svnKeyword@Revision@unexp} +% \begin{macro}{\svnKeyword@LastChangedRevision@unexp} +% \begin{macro}{\svnKeyword@Rev@unexp} +% \begin{macrocode} +\def\svnKeyword@Revision@unexp#1#2{}% +\let\svnKeyword@LastChangedRevision@unexp\svnKeyword@Revision@unexp% +\let\svnKeyword@Rev@unexp\svnKeyword@Revision@unexp% +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\svnKeyword@Revision@exp} +% \begin{macro}{\svnKeyword@LastChangedRevision@exp} +% \begin{macro}{\svnKeyword@Rev@exp} +% \begin{macrocode} +\def\svnKeyword@Revision@exp#1#2{% + \svn@parse@Revision$#2$% +}% +\def\svn@parse@Revision$#1 : ${% + \def\svnInfoRevision{#1}% + \ifthenelse{\(\equal{\svnInfoMaxRevision}{--maxrevision--}\) % + \OR \(#1 > \svnInfoMaxRevision \)}{\def\svnInfoMaxRevision{#1}}{}% + \ifthenelse{\(\equal{\svnInfoMinRevision}{--minrevision--}\) % + \OR \( #1 < \svnInfoMinRevision \)}{\def\svnInfoMinRevision{#1}}{}% +}% +\let\svnKeyword@LastChangedRevision@exp\svnKeyword@Revision@exp% +\let\svnKeyword@Rev@unexp\svnKeyword@Revision@exp% +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} + +% \subsubsection{Dealing with the \texttt{\string$HeadURL\string$} keyword} +% \begin{macro}{\svnKeyword@HeadURL@unexp} +% \begin{macrocode} +\def\svnKeyword@HeadURL@unexp#1#2{}% +\let\svnKeyword@URL@unexp\svnKeyword@HeadURL@unexp% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\svnKeyword@HeadURL@exp} +% \begin{macrocode} +\def\svnKeyword@HeadURL@exp#1#2{% + \svn@parse@HeadURL$#2$% +}% +\def\svn@parse@HeadURL$#1 : ${% + \def\svnInfoHeadURL{#1}% +}% +\let\svnKeyword@URL@exp\svnKeyword@HeadURL@exp% +% +% \end{macrocode} +% \end{macro} +% +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% \centerline{That's the end} +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% \Finale +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% \iffalse +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% The following stuff does not show up in the documentation of the package: +% svninfo.ins +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%<*ins> +\def\batchfile{svninfo.ins} +\input docstrip.tex + +\Msg{} +\Msg{***********************************************************} +\Msg{** Hello to the installation of the `svninfo' package.} +\Msg{** Version 0.7.4, March 22, 2010} +\Msg{***********************************************************} +\Msg{} + +\generate{ + \askforoverwritefalse +% \file{svninfo.ins}{\from{svninfo.dtx}{header,ins}} + \file{svninfo.sty}{\from{svninfo.dtx}{header,package}} + \usepreamble\empty + \usepostamble\empty + \file{svninfo.perl}{\from{svninfo.dtx}{perl}} + \file{svninfo.init}{\from{svninfo.dtx}{init}} + \file{svninfo.cfg}{\from{svninfo.dtx}{header,config}} +} + +\Msg{} +\Msg{***********************************************************} +\Msg{** Edit the file svninfo.cfg and set the default fancy headings package} +\Msg{** To finish the installation move the file `svninfo.sty' and} +\Msg{** svninfo.cfg to a place where LaTeX will find it.} +\Msg{** To Get the documentation: `latex svninfo.dtx'} +\Msg{** Happy TeXing} +\Msg{***********************************************************} +\Msg{} +% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% E N D of S V N I N F O . D T X +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%\fi diff --git a/svninfo.ins b/svninfo.ins new file mode 100644 index 0000000..7c3404f --- /dev/null +++ b/svninfo.ins @@ -0,0 +1,90 @@ +%% +%% This is file `svninfo.ins', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% svninfo.dtx (with options: `header,ins') +%% +%% IMPORTANT NOTICE: +%% +%% For the copyright see the source file. +%% +%% Any modified versions of this file must be renamed +%% with new filenames distinct from svninfo.ins. +%% +%% For distribution of the original source see the terms +%% for copying and modification in the file svninfo.dtx. +%% +%% This generated file may be distributed as long as the +%% original source files, as listed above, are part of the +%% same distribution. (The sources need not necessarily be +%% in the same archive or directory.) + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% +%% `svninfo' package to use with LaTeX2e. +%% +%% This package is used to extract the revision and file information provided +%% by the Subversion revision control system. +%% +%% Copyright (C) 1995 Dr. Juergen Vollmer +%% Copyright (C) 2003-2010 Achim D. Brucker +%% License: +%% This program can be redistributed and/or modified under the terms +%% of the LaTeX Project Public License Distributed from CTAN +%% archives in directory macros/latex/base/lppl.txt; either +%% version 1 of the License, or any later version. +%% +%% +%% $Id: svninfo.ins 4705 2010-03-23 19:57:29Z brucker $ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% \CheckSum{389} +%% \CharacterTable +%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z +%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} + +\def\batchfile{svninfo.ins} +\input docstrip.tex + +\Msg{} +\Msg{***********************************************************} +\Msg{** Hello to the installation of the `svninfo' package.} +\Msg{** Version 0.7.4, March 23, 2010} +\Msg{***********************************************************} +\Msg{} + +\generate{ + \askforoverwritefalse + \file{svninfo.sty}{\from{svninfo.dtx}{header,package}} + \usepreamble\empty + \usepostamble\empty + \file{svninfo.init}{\from{svninfo.dtx}{init}} + \file{svninfo.cfg}{\from{svninfo.dtx}{header,config}} +} + +\Msg{} +\Msg{***********************************************************} +\Msg{** Edit the file svninfo.cfg and set the default fancy headings package} +\Msg{** To finish the installation move the file `svninfo.sty' and} +\Msg{** svninfo.cfg to a place where LaTeX will find it.} +\Msg{** To Get the documentation: `latex svninfo.dtx'} +\Msg{** Happy TeXing} +\Msg{***********************************************************} +\Msg{} +\endinput +%% +%% End of file `svninfo.ins'.