#!/usr/bin/perl -w use strict; # # Not actually contributed by anybody, but people might find this useful. # # This is a small PERL script to convert a ChangeLog in the same format as that # used by devtodo into a devtodo database. # # DISCLAIMER: I've only been using PERL for about a week, so I'm sure there are # much easier ways of doing some of these things. # sub htmlify { s/&/&/g; s//>/g; return $_; } open(CHANGELOG, "ChangeLog"); print "\n"; my $version = ""; my $item = ""; my $pseudotime = 0; while () { if (/^[0-9]\.[0-9]\.[0-9]/) { if ($item ne "") { print $item; print "\n"; $item = ""; } if ($version ne "") { print "\n"; $version = ""; } print "$_\n"; $pseudotime++; $version = $_; } elsif (/^\*/) { s/^\*\w*//; if ($item ne "") { print $item; print "\n"; $item = ""; } print "\n"; $pseudotime++; chomp(); $item = htmlify($_); } else { chomp(); $item .= htmlify($_); } } if ($item ne "") { print $item; print "\n"; $item = ""; } if ($version ne "") { print "\n"; $version = ""; } print "\n"; close(CHANGELOG);