draining just to be sure for CTAN distribution

This commit is contained in:
Michael Kohlhase 2015-11-20 12:12:26 +01:00
parent bb0dbeb4b2
commit 6284b783bd
2 changed files with 47 additions and 2 deletions

45
bin/filedate Executable file
View File

@ -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

View File

@ -18,7 +18,7 @@
HERE = $(shell pwd) HERE = $(shell pwd)
TMP = /tmp TMP = /tmp
TDSCOLL = proposal TDSCOLL ?= $(shell basename $$PWD)
EXPORTED = $(TMP)/$(TDSCOLL).exp EXPORTED = $(TMP)/$(TDSCOLL).exp
TDSDIR = $(TMP)/$(TDSCOLL).tds TDSDIR = $(TMP)/$(TDSCOLL).tds
TDSZIP = $(TMP)/$(TDSCOLL).tds.zip TDSZIP = $(TMP)/$(TDSCOLL).tds.zip
@ -31,7 +31,7 @@ MAKE = make
# the filedates and the checksums. To get rid of all the junk we commit and # the filedates and the checksums. To get rid of all the junk we commit and
# export a clean copy EXPORTED, on which we run the target ctanexp below, # export a clean copy EXPORTED, on which we run the target ctanexp below,
# which generates a directory CTANDIR, which we zip and move into place. # which generates a directory CTANDIR, which we zip and move into place.
ctan: all # filedate checksum ctan: all #filedate checksum
git commit -am'draining just to be sure for CTAN distribution' git commit -am'draining just to be sure for CTAN distribution'
rm -Rf $(EXPORTED) rm -Rf $(EXPORTED)
@echo "exporting a clean copy to $(EXPORTED)" @echo "exporting a clean copy to $(EXPORTED)"