diff options
author | Karl Berry <karl@freefriends.org> | 2006-06-01 15:53:46 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-06-01 15:53:46 +0000 |
commit | df41ca308be95dbd0f1d0447874bbd1c58cd24d2 (patch) | |
tree | 642aa9f3ce7c9df365ee12cdab7f76947c098435 /Master/texmf-dist/tex/latex/svninfo | |
parent | 955c1d812fa0c5234eb84e068132571b9188c1ca (diff) |
svninfo update
git-svn-id: svn://tug.org/texlive/trunk@1638 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/svninfo')
-rw-r--r-- | Master/texmf-dist/tex/latex/svninfo/svninfo.cfg | 6 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/svninfo/svninfo.sty | 408 |
2 files changed, 286 insertions, 128 deletions
diff --git a/Master/texmf-dist/tex/latex/svninfo/svninfo.cfg b/Master/texmf-dist/tex/latex/svninfo/svninfo.cfg index b4bf63c937c..42004c84c44 100644 --- a/Master/texmf-dist/tex/latex/svninfo/svninfo.cfg +++ b/Master/texmf-dist/tex/latex/svninfo/svninfo.cfg @@ -5,10 +5,9 @@ %% %% This package is used to extract the revision and file information provided %% by the Subversion revision control system. -%% A PERL-package supporting svninfo and LaTeX2HTML is provieded too. %% %% Copyright (C) 1995 Dr. Juergen Vollmer -%% Copyright (C) 2003-2005 Achim D. Brucker +%% Copyright (C) 2003-2006 Achim D. Brucker %% %% License: %% This program can be redistributed and/or modified under the terms @@ -19,7 +18,7 @@ %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% \CheckSum{345} +%% \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 @@ -37,3 +36,4 @@ %% Right brace \} Tilde \~} \ExecuteOptions{fancyhdr} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/Master/texmf-dist/tex/latex/svninfo/svninfo.sty b/Master/texmf-dist/tex/latex/svninfo/svninfo.sty index b2b568a9c92..6a9661c099a 100644 --- a/Master/texmf-dist/tex/latex/svninfo/svninfo.sty +++ b/Master/texmf-dist/tex/latex/svninfo/svninfo.sty @@ -27,10 +27,9 @@ %% %% This package is used to extract the revision and file information provided %% by the Subversion revision control system. -%% A PERL-package supporting svninfo and LaTeX2HTML is provieded too. %% %% Copyright (C) 1995 Dr. Juergen Vollmer -%% Copyright (C) 2003-2005 Achim D. Brucker +%% Copyright (C) 2003-2006 Achim D. Brucker %% %% License: %% This program can be redistributed and/or modified under the terms @@ -41,7 +40,7 @@ %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% \CheckSum{345} +%% \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 @@ -59,13 +58,10 @@ %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{svninfo}[2005/09/29 v0.3] +\ProvidesPackage{svninfo}[2006/05/11 v0.6] \newcount\@svnInfoDay \newcount\@svnInfoMonth \newcount\@svnInfoYear -\newcount\@svnInfoYearTmp -\newcount\@svnInfoMonthTmp -\newcount\@svnInfoDayTmp \newif\if@svnInfoToday@ \DeclareOption{today}{ \@svnInfoToday@true @@ -73,15 +69,51 @@ \DeclareOption{notoday}{ \@svnInfoToday@false } +\newif\if@svnInfoRevRange@ +\@svnInfoRevRange@false +\DeclareOption{revrange}{ + \@svnInfoRevRange@true +} +\newif\if@svnInfoDraft@ +\DeclareOption{final}{ + \@svnInfoDraft@false +} +\DeclareOption{draft}{ + \@svnInfoDraft@true +} +\newif\if@svnInfoUseFancy@ \newif\if@svnInfoUseFancyhdr@ +\newif\if@svnInfoUseScrpage@ +\newif\if@svnInfoUseEsofoot@ \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{nofancy}{ + \@svnInfoUseFancy@false \@svnInfoUseFancyhdr@false + \@svnInfoUseScrpage@false + \@svnInfoUseEsofoot@false } \newif\if@svnInfoLong@ \DeclareOption{long}{ @@ -90,162 +122,288 @@ \DeclareOption{short}{ \@svnInfoLong@false } -\ExecuteOptions{today,long} +\ExecuteOptions{draft,today,long} \IfFileExists{svninfo.cfg}{\input{svninfo.cfg}}{} -\ProcessOptions -\if@svnInfoUseFancyhdr@ - \RequirePackage{fancyhdr} +\ProcessOptions*\relax +\if@svnInfoDraft@ + \if@svnInfoUseFancy@ + \RequirePackage{fancyheadings} + \fi + \if@svnInfoUseFancyhdr@ + \RequirePackage{fancyhdr} + \fi + \if@svnInfoUseScrpage@ + \RequirePackage{scrpage2} + \fi + \if@svnInfoUseEsofoot@ + \RequirePackage{eso-pic} + \fi \fi -\def\today{\ifcase\month\or +\RequirePackage{ifthen} +\def\svnToday{\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} -\newif\if@svnInfoColonIsActive@ - -\def\svnInfo { - \catcode`\_=13 - \ifnum\catcode`\:=13 - \@svnInfoColonIsActive@true - \catcode`:=12 - \else - \@svnInfoColonIsActive@false - \fi + + +\def\@svnBeginRead{\begingroup + \catcode`\_=13 % + \catcode`:=12 % + \catcode`\\=12 % +} +\def\@svnEndRead{\endgroup +} + +\def\svnInfo {\@svnBeginRead \@svnInfoReadArgs } -\def\@svnInfoReadArgs #1Id#2 { + +\def\@svnInfoReadArgs #1Id#2 {\@svnEndRead \@svnInfoDefaults - \if $#2 \let \@svnInfoNext = \@svnInfoEat - \else \let \@svnInfoNext = \@svnInfoEatColon + \if $#2 \expandafter\@svnInfoEat + \else \@svnBeginRead + \expandafter\@svnInfoEatColon \fi - \if@svnInfoColonIsActive@ - \catcode`:=13 - \fi - \@svnInfoNext $Id#2 + $Id#2 % } -\def\@svnInfoEat #1 {\catcode`\_=8} +\def\@svnInfoEat #1 {} -\def\@svnInfoEatColon $Id:#1 { - \if $#1 \let \@svnInfoNext = \@svnInfoEat - \else \let \@svnInfoNext = \@svnInfoCrackAndEat +\def\@svnInfoEatColon $Id:#1 {\@svnEndRead + \if $#1 \expandafter\@svnInfoEat + \else \@svnBeginRead + \expandafter\@svnInfoCrackAndEat \fi - \@svnInfoNext #1 + #1 % } -\def\@svnInfoCrackAndEat #1 #2 #3 #4 #5 #6 { - \@svnInfoCrackString #2 #3 #4 #5 #6 - \@svnInfoNext +\def\@svnInfoCrackAndEat #1 #2 #3 #4 #5 #6 {\@svnEndRead + \@svnInfoCrackString #2 #3 #4 #5 #6 % } -\def\@svnInfoCrackString #1 #2 #3 #4 #5 { - \def\svnInfoFile{#1} - \def\svnInfoRevision{#2} - \def\svnInfoTime{#4} - \if $#5 \let \@svnInfoNext = \relax - \def\svnInfoOwner{} - \def\svnId{#1\ #2\ #3\ #4} - \else \let \@svnInfoNext = \@svnInfoEat - \def\svnInfoOwner{#5} - \def\svnId{#1\ #2\ #3\ #4\ #5} - \fi - \write\@mainaux{\string\def\string\svnInfoFILE{#1}} - \write\@mainaux{\string\def\string\svnInfoREVISION{#2}} - \write\@mainaux{\string\def\string\svnInfoTIME{#4}} - \write\@mainaux{\string\def\string\svnInfoOWNER{#5}} - - \catcode`\_=8 - \@svnInfoSplitDate x#3x - \def\svnInfoLongDate{\@svnInfoToday} +\def\@svnInfoCrackString #1 #2 #3 #4 #5 {% + \def\svnInfoFile{#1}% + \def\svnInfoRevision{#2}% + \ifthenelse{\(\equal{\svnInfoMaxRevision}{--maxrevision--}\) % + \OR \( #2 > \svnInfoMaxRevision \)}{\def\svnInfoMaxRevision{#2}}{}% + \ifthenelse{\(\equal{\svnInfoMinRevision}{--minrevision--}\) % + \OR \( #2 < \svnInfoMinRevision \)}{\def\svnInfoMinRevision{#2}}{}% + \def\svnInfoTime{#4}% + \@svnInfoSplitDate x#3x% + \def\svnInfoLongDate{\@svnInfoToday}% \if@svnInfoToday@ - \year = \@svnInfoYear - \month = \@svnInfoMonth - \day = \@svnInfoDay + \year =\@svnInfoYear + \month =\@svnInfoMonth + \day =\@svnInfoDay + \fi + \if $#5 \def\svnInfoOwner{}%$% + \def\svnId{#1\ #2\ #3\ #4}% + \else + \def\svnInfoOwner{#5}% + \def\svnId{#1\ #2\ #3\ #4\ #5}% + \expandafter\@svnInfoEat \fi } -\def\@svnInfoSplitDate x#1-#2-#3x{ - \@svnInfoDay = #3 - \@svnInfoMonth= #2 - \@svnInfoYear = #1 - \write\@mainaux{\string\def\string\svnInfoDAY{#3}} - \write\@mainaux{\string\def\string\svnInfoMONTH{#2}} - \write\@mainaux{\string\def\string\svnInfoYEAR{#1}} +\def\@svnInfoSplitDate x#1-#2-#3x{% + \@svnInfoDay =#3\relax + \@svnInfoMonth=#2\relax + \@svnInfoYear =#1\relax } \def\@svnInfoToday {% - \@svnInfoYearTmp = \year - \@svnInfoMonthTmp = \month - \@svnInfoDayTmp = \day - \year = \@svnInfoYear - \month = \@svnInfoMonth - \day = \@svnInfoDay - \today% - \year = \@svnInfoYearTmp - \month = \@svnInfoMonthTmp - \day = \@svnInfoDayTmp -} -\def\@svnInfoDefaults { - \@svnInfoYear = \year - \@svnInfoMonth = \month - \@svnInfoDay = \day - \def\svnInfoFile{--sourcefile--} + \begingroup + \year =\@svnInfoYear + \month =\@svnInfoMonth + \day =\@svnInfoDay + \svnToday + \endgroup +} + +\def\@svnInfoDefaults {% + \@svnInfoYear =\year + \@svnInfoMonth =\month + \@svnInfoDay =\day + \def\svnInfoFile{--sourcefile--}% + \def\svnInfoHeadURL{--head-url--}% \def\svnInfoDate{\the\@svnInfoYear-\two@digits\@svnInfoMonth-% - \two@digits\@svnInfoDay} - \def\svnInfoTime{--time--} - \def\svnInfoRevision{--revision--} - \def\svnInfoOwner{--owner--} - \def\svnInfoYear{\the\@svnInfoYear} - \def\svnInfoMonth{\the\@svnInfoMonth} - \def\svnInfoDay{\the\@svnInfoDay} - \def\svnInfoLongDate{\@svnInfoToday} - \def\svnId{\svnInfoFile\ \svnInfoRevision\ \svnInfoTime\ \svnInfoOwner} -} -\def\@svnInfoFancyFoot { + \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\svnId{\svnInfoFile\ \svnInfoRevision\ \svnInfoTime\ \svnInfoOwner}% +} + +\def\@svnInfoFancyFoot {% + \if@svnInfoRevRange@ + \def\@svnInfoRevisionRange{{ (\svnInfoMinRevision : \svnInfoMaxRevision)}}% + \else + \def\@svnInfoRevisionRange{\relax}% + \fi \if@svnInfoLong@ - \def\@svnInfoFancyInfo{{\footnotesize% - \emph{Rev: \svnInfoRevision, - \svnInfoLongDate}}} + \def\@svnInfoFancyInfo{{\footnotesize + \emph{Rev: \svnInfoRevision\@svnInfoRevisionRange, % + \svnInfoLongDate}}}% \else - \def\@svnInfoFancyInfo{{\footnotesize% - \emph{Rev: \svnInfoRevision, - \svnInfoDate}}} + \def\@svnInfoFancyInfo{{\footnotesize + \emph{Rev: \svnInfoRevision\@svnInfoRevisionRange, % + \svnInfoDate}}}% + \fi + \def\@svnInfoFancyFile{{\footnotesize\emph{\svnInfoFile}}}% + \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 - \def\@svnInfoFancyFile{{\footnotesize\emph{\svnInfoFile}}} + \if@svnInfoDraft@ \if@svnInfoUseFancyhdr@ - \if@twoside - \fancyfoot[LE,RO]{\@svnInfoFancyInfo} - \fancyfoot[LO,RE]{\@svnInfoFancyFile} - \fancyfoot[CO,CE]{\thepage} - \else - \fancyfoot[L,RO]{\@svnInfoFancyInfo} - \fancyfoot[LO,R]{\@svnInfoFancyFile} - \fancyfoot[C]{\thepage} - \fi - \renewcommand{\footrulewidth}{0.4pt} - \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} + \fancyfoot[LE,RO]{\@svnInfoFancyInfo}% + \fancyfoot[LO,RE]{\@svnInfoFancyFile}% + \fancyfoot[CO,CE]{\thepage}% + \renewcommand{\footrulewidth}{0.4pt}% } - \else - \fancypagestyle{plain}{% - \fancyfoot[L,RO]{\@svnInfoFancyInfo} - \fancyfoot[LO,R]{\@svnInfoFancyFile} - \fancyfoot[C]{\thepage} - \renewcommand{\footrulewidth}{0.4pt} - } - \fi \fi + \fi + \if@svnInfoDraft@ +\if@svnInfoUseScrpage@ + \clearscrheadfoot% + \ohead{\headmark}% + \cfoot[\emph{\@svnInfoFancyInfo}]{\emph{\@svnInfoFancyInfo}}% + \ifoot[\@svnInfoFancyFile]{\@svnInfoFancyFile}% + \ofoot[\pagemark]{\pagemark}% + \pagestyle{scrheadings}% + \fi +\fi + \if@svnInfoDraft@ + \if@svnInfoUseEsofoot@ + \AddToShipoutPicture{% + \setlength{\unitlength}{1mm}% + \put(5,5){\tiny\svnInfoFile\quad\svnInfoRevision\quad\svnInfoDate% + \quad\svnInfoTime\quad\svnInfoOwner}% + } +\fi +\fi } - \@svnInfoDefaults -\AtBeginDocument{ +\AtBeginDocument{% + \if@svnInfoDraft@ + \if@svnInfoUseFancy@ + \@svnInfoFancyFoot + \fi \if@svnInfoUseFancyhdr@ \@svnInfoFancyFoot \fi + \if@svnInfoUseScrpage@ + \@svnInfoFancyFoot + \fi + \if@svnInfoUseEsofoot@ + \@svnInfoFancyFoot + \fi +\fi +} +\AtEndDocument{% + \immediate\write\@mainaux{\string\gdef\string\svnInfoMinRevision{\svnInfoMinRevision}}% + \immediate\write\@mainaux{\string\gdef\string\svnInfoMaxRevision{\svnInfoMaxRevision}}% +} +\def\svnKeyword $#1${\svn@$#1: $} +\let\svnKeywordempty\relax +\def\svn@$#1: #2${% + \def\svn@tmp{#2}% + \ifx\svn@tmp\@empty + \def\svn@suffix{@unexp}% + \else + \def\svn@suffix{@exp}% + \fi + \@ifundefined{svnKeyword@#1\svn@suffix}% + {\@nameuse{svnKeyword@generic\svn@suffix}{#1}{#2}}% + {\@nameuse{svnKeyword@#1\svn@suffix}{#1}{#2}}% +} +\def\svnKeyword@generic@exp#1#2{% + \expandafter\svn@set\csname svnKeyword#1\endcsname$#2$% +} +\def\svnKeyword@generic@unexp#1#2{% + \expandafter\global\expandafter\let\csname svnKeyword#1\endcsname\svnKeywordempty } +\def\svn@set#1$#2 : ${\gdef#1{#2}} +\def\svnKeyword@Date@unexp#1#2{}% +\let\svnKeyword@LastChangedDate@unexp\svnKeyword@Date@unexp% +\def\svnKeyword@Date@exp#1#2{% + \svn@parse@date$#2$% +}% +\let\svnKeyword@LastChangedDate@exp\svnKeyword@Date@exp +\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}% +} + +\def\svnKeyword@Id@unexp#1#2{}% +\def\svnKeyword@Id@exp#1#2{% + \svn@parse@id$#2$ +}% +\def\svn@parse@id$#1 : ${% + \svnInfo $Id: #1 $ % +}% + +\def\svnKeyword@Author@unexp#1#2{}% +\let\svnKeyword@LastChangedBy@unexp\svnKeyword@Author@unexp% +\def\svnKeyword@Author@exp#1#2{% + \svn@parse@Author$#2$ +}% +\def\svn@parse@Author$#1 : ${% + \def\svnInfoOwner{#1}% +}% +\let\svnKeyword@LastChangedBy\svnKeyword@Author@exp% + +\def\svnKeyword@Revision@unexp#1#2{}% +\let\svnKeyword@LastChangedRevision@unexp\svnKeyword@Revision@unexp% +\let\svnKeyword@Rev@unexp\svnKeyword@Revision@unexp% +\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% + +\def\svnKeyword@HeadURL@unexp#1#2{}% +\let\svnKeyword@URL@unexp\svnKeyword@HeadURL@unexp% +\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% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \endinput %% %% End of file `svninfo.sty'. |