diff options
author | Karl Berry <karl@freefriends.org> | 2012-03-30 23:23:02 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-03-30 23:23:02 +0000 |
commit | 849996eca72af498b48b10fbea7f14c4b9d21b8f (patch) | |
tree | 2d40d42dfc9fc0b0622212cc220868f98345305f /Master/texmf-dist/source/latex/stex/bin/filedate | |
parent | d82e1c23973fd0271f93686f487bd1cee8dcd947 (diff) |
restore stex (ca. 28jan12)
git-svn-id: svn://tug.org/texlive/trunk@25792 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/stex/bin/filedate')
-rwxr-xr-x | Master/texmf-dist/source/latex/stex/bin/filedate | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/Master/texmf-dist/source/latex/stex/bin/filedate b/Master/texmf-dist/source/latex/stex/bin/filedate new file mode 100755 index 00000000000..6ea1a5d6870 --- /dev/null +++ b/Master/texmf-dist/source/latex/stex/bin/filedate @@ -0,0 +1,45 @@ +#!/usr/bin/perl -w +####################################################################################### +# A tool for updating .dtx files with a given package date. # +# Copyright (c) 2010, Deyan Ginev, released under the Gnu General Public License (GPL)# +# see http://www.gnu.org/copyleft/gpl.html # +# $URL: https://svn.kwarc.info/repos/stex/trunk/bin/filedate$ # +####################################################################################### + +use strict; + +use Getopt::Long; +use Modparse; +use Pod::Usage; +use Cwd qw(abs_path); + +my ($file) = @ARGV; +my $date = `svn info $file`; +$date =~ /Last Changed Date: (\d+)-(\d+)-(\d+)/; +$date = $1.'/'.$2.'/'.$3; +$file = abs_path($file); +open(IN,"<$file"); +my @lines = (); +while (<IN>) { + if ($_ =~ /\\Provides(Package|Class)/) { + $_ =~ s/\[(.*?)\s/\[$date /; + } + push @lines, $_; +} +close(IN); +open(OUT,">$file"); +print OUT join("",@lines); +close(OUT); + +__END__ + + +=head1 SYNOPSIS + +filedate <input filename> <newdate> + +Purpose: + Update the dates for a \ProvidePackage invocation in a given .dtx source + +Example: + filedate omdoc.dtx |