summaryrefslogtreecommitdiff
path: root/d
diff options
context:
space:
mode:
authorschodet2004-10-03 09:42:56 +0000
committerschodet2004-10-03 09:42:56 +0000
commit1117692f50612eb879f058a2e6e81c04206ee0da (patch)
tree24f6a22af9368faed2628b492a61e18c8ea93856 /d
parent20299c1bc51e63a5d00af10c97cc001cce2503b5 (diff)
Bug corrigé dans extractdoc.
Ajout de cvslog2html.
Diffstat (limited to 'd')
-rwxr-xr-xd/dev/sys/lampion/scripts/cvslog2html129
-rwxr-xr-xd/dev/sys/lampion/scripts/extractdoc2
2 files changed, 130 insertions, 1 deletions
diff --git a/d/dev/sys/lampion/scripts/cvslog2html b/d/dev/sys/lampion/scripts/cvslog2html
new file mode 100755
index 0000000..45c7a8a
--- /dev/null
+++ b/d/dev/sys/lampion/scripts/cvslog2html
@@ -0,0 +1,129 @@
+#!/usr/bin/perl
+
+use warnings;
+use strict;
+
+use File::Basename;
+
+sub print_header
+{
+ print '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">', "\n";
+ print "<html>\n<head>\n<title>Log CVS</title>\n";
+ print '<link rel="stylesheet" type="text/css" href="style.css" media="screen" title="Normal" />', "\n";
+ print '<link rel="alternate stylesheet" type="text/css" href="" media="screen" title="Sans habillage" />', "\n";
+ print '<meta http-equiv="Content-Type" content="text/HTML; charset=iso-8859-1" />', "\n";
+ print '<meta name="content-language" content="fr" />', "\n";
+ print "</head>\n<body>\n";
+ print '<div id="page">', "\n";
+}
+
+sub print_footer
+{
+ print "</div>\n</body>\n</html>\n";
+}
+
+sub print_entry
+{
+ return if (!defined ($_[0]));
+ shift if ($_[0] =~ m/^\s*$/);
+ print "<div class=\"entry\">\n<hr />\n";
+ if ($_[0] =~ m/^LOG: (\w+) ([\w\/]+)/) {
+ print '<div class="id">' , $2 , "</div>\n";
+ print '<div class="auteur">' , $1 , "</div>\n";
+ }
+ my ($mod, $msg);
+ for (my $i = 0; $i < @_; $i ++) {
+ $mod = $i if ((!defined ($mod)) && ($_[$i] =~ /^\w+ Files:$/));
+ $msg = $i if ($_[$i] =~ /^Log Message:$/);
+ }
+ if (defined ($msg)) {
+ print "<div class=\"log\">\n<h3>Message</h3>\n<p>\n";
+ for (my $i = $msg + 1; $i < @_; $i ++) {
+ print $_[$i], "<br />\n" if ($_[$i] !~ /^\s*$/);
+ }
+ print "</p>\n</div>\n";
+ }
+ if (defined ($mod)) {
+ print "<div class=\"action\">\n";
+ for (my $i = $mod; $i < $msg; ) {
+ if ($_[$i] =~ /^(\w+) Files:/) {
+ my $type = $1;
+ print "<h3>Fichiers ajoutés</h3>\n" if ($type =~ m/Added/);
+ print "<h3>Fichiers supprimés</h3>\n" if ($type =~ m/Removed/);
+ print "<h3>Fichiers modifiés</h3>\n" if ($type =~ m/Modified/);
+ $i ++;
+ }
+ else {
+ print "<p>\n";
+ for (; $i < $msg; $i++) {
+ last if ($_[$i] =~ m/^\w+ Files:/);
+ for (split (/ /,$_[$i])) {
+ print $_, "<br />\n";
+ }
+
+ }
+ print "</p>\n";
+ }
+
+ }
+ print "</div>\n";
+ }
+ print "</div>\n";
+}
+
+sub print_import
+{
+ return if (!defined ($_[0]));
+ shift if ($_[0] =~ m/^\s*$/);
+ print "<div class=\"entry\">\n<hr />\n";
+ if ($_[0] =~ m/^LOG: (\w+) ([\w\/]+)/) {
+ print '<div class="id">' , $2 , "</div>\n";
+ print '<div class="auteur">' , $1 , "</div>\n";
+ }
+ my ($msg,$sta);
+ for (my $i = 0; $i < @_; $i ++) {
+ $msg = $i if ($_[$i] =~ /^Log Message:$/);
+ $sta = $i if ($_[$i] =~ /^Status:$/);
+ }
+ print "<div class=\"log\">\n<h3>Message</h3>\n<p>\n";
+ for (my $i = $msg + 1; $i < $sta; $i ++) {
+ print $_[$i], "<br />\n" if ($_[$i] !~ /^\s*$/);
+ }
+ print "</p>\n</div>\n";
+ print "<div class=\"action\">\n";
+ print "<h3>Fichiers importés</h3>\n<p>\n";
+ for (my $i = $msg ; $i < @_; $i ++) {
+ print $_[$i], "<br />\n" if ($_[$i] =~ /^N /);
+ }
+ print "</p>\n</div>\n";
+ print "</div>\n";
+}
+
+
+die "usage: $0 files\n" if (!defined ($ARGV[0]));
+
+print_header ();
+#$/ = "\n\n\n"; user qui fout de la merde dans le log (genre deux lignes vides
+#a la fin obligé de recoder a la main
+my $line;
+for (@ARGV)
+{
+ open LOG, $_ or die "Can' open $_: $!\n";
+ print "<h1>Log CVS ", basename ($_), "</h1>\n";
+ $line = <LOG>;
+ while (!eof LOG) {
+ my @lines;
+ push @lines, $line;
+ while ((defined ($line = <LOG>)) && ($line !~ /^LOG: /)) {
+ chomp $line;
+ push @lines, $line;
+ }
+ if ($lines[0] =~ /Imported/) {
+ print_import (@lines);
+ } else {
+ print_entry (@lines);
+ }
+ }
+ close LOG;
+}
+print_footer ();
diff --git a/d/dev/sys/lampion/scripts/extractdoc b/d/dev/sys/lampion/scripts/extractdoc
index 90992b7..01c0198 100755
--- a/d/dev/sys/lampion/scripts/extractdoc
+++ b/d/dev/sys/lampion/scripts/extractdoc
@@ -44,7 +44,7 @@ while (<>)
INNER: {
do {
chomp;
- s/\).*/);/;
+ s/\)[^)]*$/);/;
push @def, $_;
last if /\)/;
} while (<>);