]> mj.ucw.cz Git - ga.git/blob - all/preprocess
Upraveny uploadovaci skriptiky, aby generovaly changelog od tistene verze.
[ga.git] / all / preprocess
1 #!/usr/bin/perl
2
3 use warnings;
4 use strict;
5
6 foreach my $f (@ARGV) {
7         my $d = $f;
8         $d =~ s@/[^/]*$@/@;
9         open X, $f or die;
10         while (<X>) {
11                 /^\\input .*sgr\.tex/ && next;
12                 /^\\references/ && next;
13                 /^\\bye/ && last;
14                 s@\\(figure|fig|inlinefig|epsfbox){([^}]+)}@\\$1\{$d$2}@g;
15                 s@\\(twofigures){([^}]+)}({[^}]+}{[^}]+}){([^}]+)}@\\$1\{$d$2}$3\{$d$4}@g;
16                 print;
17         }
18         close X;
19         print "\\chapterend\n";
20 }