Permalink
Browse files

podwrapper: Recognize git-style dates in ChangeLog

(cherry picked from commit bbfb9f9)
  • Loading branch information...
1 parent e9339c9 commit 2335152215f5d263776fb05e3d1a97a59d646355 @hillu hillu committed with rwmjones Feb 14, 2014
Showing with 10 additions and 2 deletions.
  1. +10 −2 podwrapper.pl.in
View
@@ -235,9 +235,17 @@ my $date;
my $filename = "$abs_top_srcdir/ChangeLog";
if (-r $filename) {
open FILE, $filename or die "$progname: $filename: $!";
- $_ = <FILE>;
+ while (<FILE>) {
+ if (/^Date:\s+...\s+(...)\s+(\d+)\s+..:..:..\s+(\d{4})\s+.*$/) {
+ my $i = 0;
+ my %month =
+ map { $_ => ++$i }
+ (qw< Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec >);
+ $date = sprintf '%04d-%02d-%02d', $3, $month{$1}, $2;
+ last;
+ }
+ }
close FILE;
- $date = $1 if /^(\d+-\d+-\d+)\s/;
}
$filename = "$abs_top_srcdir/.git";
if (!$date && -d $filename) {

0 comments on commit 2335152

Please sign in to comment.