From 277ca449c86a187fe858defdcd6aa1830d3b2d0d Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 19 Jul 2010 23:16:46 +0000 Subject: reinstate stex via new .tds.zip git-svn-id: svn://tug.org/texlive/trunk@19538 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/source/latex/stex/bin/filedate | 42 ++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100755 Master/texmf-dist/source/latex/stex/bin/filedate (limited to 'Master/texmf-dist/source/latex/stex/bin/filedate') 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..8149b5e57bd --- /dev/null +++ b/Master/texmf-dist/source/latex/stex/bin/filedate @@ -0,0 +1,42 @@ +#!/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,$date) = @ARGV; +$file = abs_path($file); +open(IN,"<$file"); +my @lines = (); +while () { + if ($_ =~ /\\Provides(Package|Class)/) { + $_ =~ s/\[(.*?)\s/\[$date /; + } + push @lines, $_; +} +close(IN); +open(OUT,">$file"); +print OUT join("",@lines); +close(OUT); + +__END__ + + +=head1 SYNOPSIS + +filedate + +Purpose: + Update the dates for a \ProvidePackage invocation in a given .dtx source + +Example: + filedate omdoc.dtx "2010/06/24" -- cgit v1.2.3