summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/ktv-texdata/ktv-buildnum.sty
blob: d97925ffee19b9d73d8efbbb9299d3b1fec14fe1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
\ProvidesPackage{ktv-buildnum}[2003/10/10 v1.5  KTV, Build Number]
\def\bld@ext{.ktvnum}
\def\bld@ext@old{.xka}
\def\builnumfile{\jobname}
\AtBeginDocument{
  \newwrite\bld@ostream
  \newcount\buildnum
  \IfFileExists{\builnumfile\bld@ext}%
    {\@@input\builnumfile\bld@ext\relax}%
    {\buildnum=0}
  \IfFileExists{\builnumfile\bld@ext@old}
    {%\begingroup
      \newcount\tmp@cnt \tmp@cnt=\buildnum
      \@@input\builnumfile\bld@ext@old\relax
      \ifnum\tmp@cnt>\buildnum        
        \global\buildnum=\tmp@cnt
      \fi
    %\endgroup
    }{}  
  \advance\buildnum1 %
  \immediate\openout\bld@ostream\builnumfile\bld@ext %
  \immediate\write\bld@ostream{\string\buildnum=\the\buildnum}%
  \immediate\closeout\bld@ostream{}%
}
\endinput
% END OF FILE