|
#!/usr/bin/env perl
my $version = shift @ARGV ;
my $time = `date + '%F %T %z' `;
chomp $time ;
if ( $version )
{
{
my $rewrite = App::RewriteVersion->new;
$rewrite ->allow_decimal_underscore(1);
$rewrite ->verbose(1);
$rewrite ->rewrite_versions( $version );
}
{
my @lines ;
my $fh ;
my $first = 1;
open $fh , '<' , 'Changes' ;
while ( my $line = < $fh >)
{
if ( $first && $line =~ /^\s+-/)
{
push @lines , "$version $time\n" ;
$first = 0;
}
push @lines , $line ;
}
close $fh ;
open $fh , '>' , 'Changes' ;
print $fh $_ for @lines ;
close $fh ;
}
}
|