summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/stex/bin/checksum
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/stex/bin/checksum')
-rwxr-xr-xMaster/texmf-dist/source/latex/stex/bin/checksum9
1 files changed, 6 insertions, 3 deletions
diff --git a/Master/texmf-dist/source/latex/stex/bin/checksum b/Master/texmf-dist/source/latex/stex/bin/checksum
index 7e521deaa7c..9f0e533a8d4 100755
--- a/Master/texmf-dist/source/latex/stex/bin/checksum
+++ b/Master/texmf-dist/source/latex/stex/bin/checksum
@@ -26,7 +26,10 @@ $path = abs_path($path);
my ($volume,$dir,$file) = File::Spec->splitpath( $path );
my @lines = `cd $dir; pdflatex "\\nonstopmode\\input{$file}"` if ($mode eq "update");
my ($checksum) = map {$_=~/^\* The checksum should be (\d+)!/; $1;} grep ($_ =~ /^\* The checksum should be (\d+)!/,@lines) if @lines;
-
+if (!$checksum) {
+#One more possible error message:
+ ($checksum) = map {$_=~/^! Package doc Error: Checksum not passed \((\d+)<>(\d+)\)\./; $2;} grep ($_ =~ /^! Package doc Error: Checksum not passed \((\d+)<>(\d+)\)\./,@lines) if @lines;
+}
open(IN,"<$path") or die "Cannot open DTX source: $path\n";
@lines = ();
while (<IN>) {
@@ -38,8 +41,8 @@ print OUT join("",@lines);
close(OUT);
######### Subroutines ############
sub update {
- my $checksum=$_[1]||"1";
- $_[0]=~s/\\CheckSum\{\d*\}/\\CheckSum{$checksum}/;
+ my $checksum=$_[1];
+ $_[0]=~s/\\CheckSum\{\d*\}/\\CheckSum{$checksum}/ if $checksum;
$_[0];
}