make fixupind.pl part of helper.pl

This commit is contained in:
Karel Miko 2017-05-05 10:36:23 +02:00 committed by Steffen Jaeckel
parent 3176103c15
commit 1300c5ade5
3 changed files with 11 additions and 18 deletions

View File

@ -1,16 +0,0 @@
#!/usr/bin/perl
use strict;
use warnings;
open(my $in, '<', 'crypt.ind');
open(my $out, '>', 'crypt.ind.tmp');
my $a = <$in>;
print {$out} "$a\n\\addcontentsline{toc}{chapter}{Index}\n";
while (<$in>) {
print {$out} $_;
}
close $out;
close $in;
system("mv -f crypt.ind.tmp crypt.ind");

View File

@ -287,6 +287,7 @@ sub die_usage {
$0 --check-makefiles
$0 --check-all
$0 --update-makefiles
$0 --fixupind crypt.ind
MARKER
}
@ -296,9 +297,17 @@ GetOptions( "s|check-source" => \my $check_source,
"m|check-makefiles" => \my $check_makefiles,
"a|check-all" => \my $check_all,
"u|update-makefiles" => \my $update_makefiles,
"f|fixupind=s" => \my $fixupind,
"h|help" => \my $help
) or die_usage;
if ($fixupind) {
my $txt = read_file($fixupind);
$txt =~ s/^([^\n]*\n)/$1\n\\addcontentsline{toc}{chapter}{Index}\n/s;
write_file($fixupind, $txt);
exit 0;
}
my $failure;
$failure ||= check_source() if $check_all || $check_source;
$failure ||= check_defines() if $check_all || $check_defines;

View File

@ -403,7 +403,7 @@ doc/crypt.pdf: crypt.tex
latex crypt $(silent_stdout)
latex crypt $(silent_stdout)
makeindex crypt.idx $(silent_stdout)
perl fixupind.pl
perl helper.pl --fixupind crypt.ind
pdflatex crypt $(silent_stdout)
sed -b -i 's,^/ID \[.*\]$$,/ID [<0> <0>],g' crypt.pdf
mv -ivf crypt.pdf doc/crypt.pdf
@ -415,7 +415,7 @@ docdvi: crypt.tex
latex crypt $(silent_stdout)
latex crypt $(silent_stdout)
makeindex crypt.idx
perl fixupind.pl
perl helper.pl --fixupind crypt.ind
latex crypt $(silent_stdout)
latex crypt $(silent_stdout)