]> mj.ucw.cz Git - libucw.git/blob - build/cvslog
Merged obj2buck.h and buck2obj.h to object.h, the number of includes
[libucw.git] / build / cvslog
1 #!/usr/bin/perl
2 # Process `cvs log' output to get a resonable changelog
3 # (c) 2003--2004 Martin Mares <mj@ucw.cz>
4
5 use Digest::MD5;
6 use POSIX;
7
8 my %names= (
9         'mj'            => 'Martin Mares <mj@ucw.cz>',
10         'robert'        => 'Robert Spalek <robert@ucw.cz>',
11         'tom'           => 'Tomas Valla <tom@ucw.cz>',
12         'valla'         => 'Tomas Valla <tom@ucw.cz>',
13         'milan'         => 'Milan Vancura <milan@ucw.cz>',
14         'milanek'       => 'Milan Vancura <milan@ucw.cz>',
15         'tomhol'        => 'Tomas Holusa <tomas.holusa@netcentrum.cz>',
16         'centrum'       => 'Tomas Holusa <tomas.holusa@netcentrum.cz>',
17         'root'          => 'Tomas Holusa <tomas.holusa@netcentrum.cz>',
18         'pavel'         => 'Pavel Machek <pavel@ucw.cz>'
19 );
20
21 while (<STDIN>) {
22         chomp;
23         /^$/ && next;
24         /^[?]/ && next;
25         /^RCS file: / || die;
26         $_ = <STDIN>;
27         chomp;
28         my ($file) = /^Working file: (.*)$/ or die;
29         #print "$file\n";
30         do {
31                 $_ = <STDIN> or die;
32         } while (!/^description:/);
33         $_ = <STDIN>;
34         for(;;) {
35                 /^======/ && last;
36                 if (/^------/) { $_ = <STDIN>; next; }
37                 /^revision / || die;
38                 $_ = <STDIN>;
39                 my ($author) = /;\s*author:\s*([^;]+)/ or die;
40                 my ($yy,$mm,$dd,$HH,$MM,$SS) = /^date: (....)\/(..)\/(..) (..):(..):(..);/ or die;
41                 my $t = POSIX::mktime($SS,$MM,$HH,$dd,$mm-1,$yy-1900) or die;
42                 my $T = sprintf("%06d", int(($t + 1800)/3600));
43                 $d = "";
44                 while ($_ = <STDIN>) {
45                         /^(-----|=====)/ && last;
46                         $d .= "  $_";
47                 }
48                 my $id = "$T:" . Digest::MD5::md5_hex($d);
49                 if (!defined $msg{$id}) {
50                         $date{$id} = "$yy-$mm-$dd $HH:$MM:$SS";
51                         $msg{$id} = $d;
52                         $files{$id} = "";
53                         $author{$id} = $author;
54                 }
55                 $files{$id} .= "  * $file\n";
56                 #print "\t$id\n";
57         }
58 }
59
60 foreach $id (sort keys %date) {
61         if (!exists ($names{$author{$id}})) {
62                 die "Unknown commiter $author{$id}";
63         }
64         print "### ", $date{$id}, "  ", $names{$author{$id}}, "\n\n";
65         print $files{$id}, "\n";
66         print $msg{$id}, "\n";
67 }