From f1bc7a1e098bc69167aeded28c140f4f34ebeb1c Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Mon, 12 Apr 2010 00:52:57 +0000
Subject: svn-prov update (11apr10)

git-svn-id: svn://tug.org/texlive/trunk@17807 c570f23f-e606-0410-a88d-b1316a301751
---
 Master/texmf-dist/tex/latex/svn-prov/svn-prov.sty | 151 ++++++++++++++++------
 1 file changed, 108 insertions(+), 43 deletions(-)

(limited to 'Master/texmf-dist/tex/latex/svn-prov/svn-prov.sty')

diff --git a/Master/texmf-dist/tex/latex/svn-prov/svn-prov.sty b/Master/texmf-dist/tex/latex/svn-prov/svn-prov.sty
index 96ad3ff3403..e2ccf9d4c31 100644
--- a/Master/texmf-dist/tex/latex/svn-prov/svn-prov.sty
+++ b/Master/texmf-dist/tex/latex/svn-prov/svn-prov.sty
@@ -25,16 +25,16 @@
 %% This work consists of the files svn-prov.dtx, svn-prov.ins
 %% and the derived file svn-prov.sty.
 %% 
-\def\svnprov@version{v2.\rev}
+\def\svnprov@version{v3.\rev}
 \NeedsTeXFormat{LaTeX2e}[1999/12/01]
 \def\ProvidesClassSVN{%
-  \svnprov@generic\ProvidesClass{\svnprov@filebase}%
+  \svnprov@generic\ProvidesClass{\svnprov@filebase@}%
 }
 \def\ProvidesFileSVN{%
-  \svnprov@generic\ProvidesFile{\svnprov@filebase.\svnprov@fileext}%
+  \svnprov@generic\ProvidesFile{\svnprov@filebase@.\svnprov@fileext@}%
 }
 \def\ProvidesPackageSVN{%
-  \svnprov@generic\ProvidesPackage{\svnprov@filebase}%
+  \svnprov@generic\ProvidesPackage{\svnprov@filebase@}%
 }
 \def\svnprov@generic#1#2{%
   \def\svnprov@ltxprov{#1}%
@@ -63,9 +63,8 @@
   Id: #2 #3 #4-#5-#6 #7 $#8{%
   \def\next{%
     \begingroup
-    \def\@tempa####1>####2 {####2}%
     \PackageWarning{svn-prov}{Invalid SVN Id line found! File name might be
-    '#2' or '\expandafter\@tempa\meaning\@filef@und'. This occured}{}{}{}%
+    '#2' or '\expandafter\strip@prefix\meaning\@filef@und'. This occured}{}{}{}%
     \endgroup
     \svnprov@gobbleopt
   }%
@@ -73,8 +72,8 @@
     \ifx\relax#8\empty
       \def\svnprov@svnfilename{#2}%
       \svnprov@splitfilename{#2}%
-      \def\svnprov@filerev{#3}%
-      \def\svnprov@filedate{#4/#5/#6}%
+      \def\svnprov@filerev@{#3}%
+      \def\svnprov@filedate@{#4/#5/#6}%
       \def\next{\begingroup\svnprov@catcodes\svnprov@buildstring}%
     \fi
   \fi
@@ -83,21 +82,21 @@
 \endgroup
 \def\svnprov@splitfilename#1{%
   \edef\g@tempa{#1}%
-  \let\svnprov@filebase\@gobble
+  \let\svnprov@filebase@\@gobble
   \expandafter
   \svnprov@splitfilename@\g@tempa.\relax
 }
 \def\svnprov@splitfilename@#1.#2\relax{%
   \if&#2&
-    \ifx\svnprov@filebase\@gobble
-      \gdef\svnprov@filebase{#1}%
-      \gdef\svnprov@fileext{}%
+    \ifx\svnprov@filebase@\@gobble
+      \gdef\svnprov@filebase@{#1}%
+      \gdef\svnprov@fileext@{}%
     \else
-      \gdef\svnprov@fileext{#1}%
+      \gdef\svnprov@fileext@{#1}%
     \fi
     \let\next\relax
   \else
-    \xdef\svnprov@filebase{\svnprov@filebase.#1}%
+    \xdef\svnprov@filebase@{\svnprov@filebase@.#1}%
     \def\next{\svnprov@splitfilename@#2\relax}%
   \fi
   \next
@@ -106,17 +105,22 @@
 \def\svnprov@endmarker{\@gobble{svn-prov endmarker}}
 \newcommand*\svnprov@gobbleopt[1][]{}
 \def\svnprov@defaultdesc{%
-  (SVN Rev:\space\svnprov@filerev)%
+  (SVN Rev:\space\svnprov@filerev@)%
 }
 \newcommand*\svnprov@buildstring[1][\svnprov@defaultdesc]{%
+  \@ifnextchar{[}%
+    {\svnprov@buildstring@{#1}}%
+    {\svnprov@buildstring@{#1}[\relax]}%
+}
+\def\svnprov@buildstring@#1[#2]{%
   \endgroup
   \begingroup
-    \let\rev\svnprov@filerev
-    \let\filerev\svnprov@filerev
+    \let\rev\svnprov@filerev@
+    \let\filerev\svnprov@filerev@
     \def\Rev{\rev\space}%
     \let\revinfo\svnprov@defaultdesc
-    \let\filebase\svnprov@filebase
-    \let\fileext\svnprov@fileext
+    \let\filebase\svnprov@filebase@
+    \let\fileext\svnprov@fileext@
     \ifx\fileversion\@undefined
       \def\fileversion{v0.0}%
     \fi
@@ -126,48 +130,109 @@
       \svnprov@splitfilename{\svnprov@filename}%
     \fi
     \let\filename\svnprov@filename
-    \xdef\svnprov@fileinfo{#1}%
+    \ifx\relax#2\empty
+      \xdef\svnprov@fileinfo@{#1}%
+      \svnprov@getversion{#1}%
+      \global\let\svnprov@filedesc@\svnprov@filedesc@
+      \global\let\svnprov@fileinfo@\svnprov@fileinfo@
+    \else
+      \xdef\svnprov@fileversion@{#1}%
+      \xdef\svnprov@filedesc@{#2}%
+      \xdef\svnprov@fileinfo@{#1 #2}%
+    \fi
   \endgroup
-  \svnprov@ltxprov{\svnprov@filemask}[\svnprov@filedate\space\svnprov@fileinfo]%
+  \svnprov@ltxprov{\svnprov@filemask}%
+    [\svnprov@filedate@
+     \ifx\svnprov@fileinfo@\empty\else
+      \space
+      \svnprov@fileinfo@
+     \fi
+   ]%
 }
 \def\GetFileInfoSVN#1{%
   \ifx*#1\relax
-    \let\filebase\svnprov@filebase
-    \let\fileext\svnprov@fileext
+    \let\filebase\svnprov@filebase@
+    \let\fileext\svnprov@fileext@
     \let\filename\svnprov@filename
-    \let\filedate\svnprov@filedate
-    \let\filerev\svnprov@filerev
-    \expandafter\svnprov@getversion
-    \svnprov@fileinfo\relax{} \relax\svnprov@endmarker
-    \let\fileversion\svnprov@fileversion
-    \let\fileinfo\svnprov@fileinfoonly
+    \let\filedate\svnprov@filedate@
+    \let\filerev\svnprov@filerev@
+    \let\fileversion\svnprov@fileversion@
+    \let\fileinfo\svnprov@filedesc@
+    \expandafter\svnprov@settoday@\svnprov@filedate@\relax
+  \else
+    \expandafter\let\expandafter\@gtempa\csname#1@short\endcsname%
+    \ifx\@gtempa\relax
+      \def\@gtempa{#1}%
+      \expandafter\let\expandafter\filename\csname#1@long\endcsname
+    \else
+      \edef\filename{#1}%
+    \fi
+    \expandafter\let\expandafter\filebase\csname\@gtempa @base\endcsname
+    \expandafter\let\expandafter\fileext \csname\@gtempa @ext\endcsname
+    \expandafter\let\expandafter\filedate\csname\@gtempa @date\endcsname
+    \expandafter\let\expandafter\filerev \csname\@gtempa @rev\endcsname
+    \expandafter\let\expandafter\fileversion\csname\@gtempa @version\endcsname
+    \expandafter\let\expandafter\fileinfo\csname\@gtempa @info\endcsname
+    \@ifundefined{\@gtempa @date}%
+      {\def\filetoday{?}}%
+      {\expandafter\expandafter\expandafter\svnprov@settoday@\csname\@gtempa @date\endcsname\relax}%
+  \fi
+}
+\def\svnprov@settoday@#1/#2/#3\relax{%
+  \ifx\today\@undefined
+    \def\filetoday{?}%
   \else
-    \PackageError{svn-prov}{Macro \textbackslash GetFileInfoSVN without '*' is
-    not implemented yet.}{}{}{}%
+  \begingroup
+    \year#1\relax
+    \month#2\relax
+    \day#3\relax
+    \xdef\filetoday{\today}%
+  \endgroup
   \fi
 }
 \newcommand*\DefineFileInfoSVN[1][\svnprov@filemask]{%
-  \expandafter\svnprov@getversion
-  \svnprov@fileinfo\relax{} \relax\svnprov@endmarker
   \expandafter
-  \let\csname#1@date\endcsname\svnprov@filedate
+  \edef\csname\svnprov@filemask @short\endcsname{#1}%
+  \expandafter
+  \edef\csname#1@long\endcsname{\svnprov@filemask}%
+  \expandafter
+  \let\csname#1@base\endcsname\svnprov@filebase@
+  \expandafter
+  \let\csname#1@ext\endcsname\svnprov@fileext@
   \expandafter
-  \let\csname#1@version\endcsname\svnprov@fileversion
+  \let\csname#1@date\endcsname\svnprov@filedate@
   \expandafter
-  \let\csname#1@rev\endcsname\svnprov@filerev
+  \let\csname#1@version\endcsname\svnprov@fileversion@
   \expandafter
-  \let\csname#1@info\endcsname\svnprov@fileinfoonly
+  \let\csname#1@rev\endcsname\svnprov@filerev@
+  \expandafter
+  \let\csname#1@info\endcsname\svnprov@filedesc@
+}
+\def\svnprov@getversion#1{%
+  \edef\@tempa{#1\space}%
+  \expandafter\svnprov@@getversion\@tempa\svnprov@endmarker
 }
-\def\svnprov@getversion#1 #2\relax#3\svnprov@endmarker{%
-  \if&#3&%
-    \def\svnprov@fileversion{??}%
+\def\svnprov@@getversion{%
+  \@ifnextchar{v}%
+    {\svnprov@getversion@}%
+    {\svnprov@getversion@@}%
+}
+\def\svnprov@getversion@#1 #2\svnprov@endmarker{%
+  \gdef\svnprov@fileversion@{#1}%
+  \ifx&#2&%
+    \gdef\svnprov@filedesc@{}%
   \else
-    \def\svnprov@fileversion{#1}%
-    \def\svnprov@fileinfoonly{#2}%
+    \xdef\svnprov@filedesc@{\svnprov@zapspace#2\svnprov@endmarker}%
   \fi
 }
-\ProvidesPackageSVN{$Id: svn-prov.dtx 1747 2010-03-25 20:25:48Z martin $}%
+\def\svnprov@getversion@@#1 \svnprov@endmarker{%
+  \gdef\svnprov@fileversion@{}%
+  \gdef\svnprov@filedesc@{#1}%
+}
+\def\svnprov@zapspace#1 \svnprov@endmarker{#1}
+\ProvidesPackageSVN{$Id: svn-prov.dtx 1853 2010-04-11 10:29:10Z martin $}%
   [\svnprov@version\space Package Date/Version from SVN Keywords]
+\DefineFileInfoSVN[svnprov]
 
 \endinput
 %%
-- 
cgit v1.2.3

