summaryrefslogtreecommitdiffstats
path: root/tools/addchangelog.pl
blob: eff3e76eac102fe53f91677a8df8083574057785 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/perl

@ARGV == 2 or die "usage $0: <dir> <cvslog2changelog script>\n";

($dir, $script) = @ARGV;

chomp(my $cwd = `pwd`);
$script = "$cwd/$script" if $script !~ m|^/|;

chdir $dir;
$date = (split('/', `grep ChangeLog CVS/Entries`))[3];

@changelog = `cvs log -d ">$date" | $script`;
@before = `cat ChangeLog`;

print foreach @changelog;

open F, ">ChangeLog";
print F foreach @changelog, @before;

system(q(cvs commit -m "New snapshot uploaded" ChangeLog));