}
}
}
+ `cat /tmp/report-$c-install.part /tmp/report-$c-minor-upgrade.part /tmp/report-$c-major-upgrade.part /tmp/report-$c-double-upgrade.part /tmp/report-$c-update.part >> /tmp/report-body-$c.html 2>/dev/null`;
+ `rm -f /tmp/report-$c-*.part`;
+
+ # TOC
+ #
+ # keep in sync with toc.pl
+ #
+ open TH, ">", "/tmp/toc-$c.html";
+ open FH, "<", "/tmp/report-body-$c.html";
+ if ($? == 0) {
+ my $i;
+
+ printf TH "<H1>Content</H1>\n";
+ while (<FH>) {
+ chomp;
+
+ if (/<A NAME="([^"]*)".*<\/A>.*<H(.)>([^<]*)<\/H.*/) {
+ foreach $i (2..$2) {
+ printf TH " ";
+ }
+ printf TH "<A HREF=\"#$1\">$3</A><BR>\n";
+ }
+ }
+ printf TH "\n";
+ close FH;
+
+ printf TH "<H1>Reports</H1>\n";
+ }
+ close TH;
+
`cat ../template.header.html | sed 's/\@TITLE\@/$c/' > /tmp/report-$c.html`;
- `cat /tmp/report-$c-install.part /tmp/report-$c-minor-upgrade.part /tmp/report-$c-major-upgrade.part /tmp/report-$c-double-upgrade.part /tmp/report-$c-update.part >> /tmp/report-$c.html 2>/dev/null`;
+ `cat /tmp/toc-$c.html >> /tmp/report-$c.html`;
+ `cat /tmp/report-body-$c.html >> /tmp/report-$c.html`;
`cat ../template.footer.html >> /tmp/report-$c.html`;
- `rm -f /tmp/report-$c-*.part`;
+
+ `rm -f /tmp/toc-$c.html /tmp/report-body-$c.html`;
}
--- /dev/null
+#! /usr/bin/perl -w
+
+use strict;
+
+#
+# keep in sync with gluer in matrixgen.pl
+#
+
+#
+# usage:
+# cat report1.html report2.html... | ./toc.pl lb > reports.html
+#
+
+ # TOC
+ my $i;
+ my $c = 'Title';
+ my $dir = `dirname $0`;
+ my $tmpbody = "/tmp/body.$$.html";
+ chomp $dir;
+
+ if ($#ARGV >= 0) { $c = $ARGV[0]; }
+
+ system("cat $dir/template.header.html | sed 's/\@TITLE\@/$c/'");
+
+ open FH, ">", $tmpbody;
+ print "<H1>Content</H1>\n";
+ while (<>) {
+ chomp;
+ printf FH "%s", "$_\n";
+
+ if (/<A NAME="([^"]*)".*<\/A>.*<H(.)>([^<]*)<\/H.*/) {
+ foreach $i (2..$2) {
+ print " ";
+ }
+ print "<A HREF=\"#$1\">$3</A><BR>\n";
+ }
+ }
+ print "\n";
+ close FH;
+
+ print "<H1>Reports</H1>\n";
+
+ system("cat $tmpbody");
+ system("cat $dir/template.footer.html");
+ `rm -f $tmpbody`;