Skip Menu |

This queue is for tickets about the VCI CPAN distribution.

Report information
The Basics
Id: 61430
Status: resolved
Priority: 0/
Queue: VCI

People
Owner: mkanat [...] cpan.org
Requestors: danieltwc [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in:
  • 0.5.4
  • 0.6.2
Fixed in: (no value)



Subject: Error parsing time for CVS
Hi, I am seeing the same error with the CVS tests reported here: http://www.cpantesters.org/cpan/report/e1dbb20e-b5f9-11df-bcaa-907a06264d1f Apparently some versions of CVS output a timezone with the commit time. For example: revision 1.1 date: 2003-02-05 19:39:23 -0500; author: dwc; state: Exp; Initial checkin This is on: $ cvs --version Concurrent Versions System (CVS) 1.12.12 (client) Attached is a possible fix, forcing the timezone to UTC before running `cvs log` and adding an optional part to the regular expression to make it work on the different output.
Subject: vci-cvs-timezone.patch
=== modified file 'lib/VCI/VCS/Cvs/File.pm' --- lib/VCI/VCS/Cvs/File.pm 2010-08-21 20:02:18 +0000 +++ lib/VCI/VCS/Cvs/File.pm 2010-09-17 14:52:58 +0000 @@ -20,14 +20,18 @@ sub _build_time { my $self = shift; my $rev = $self->revision; + + # Force timezone to UTC in order to get consistent commit times + local $ENV{TZ} = 'UTC'; my $output = $self->vci->x_do( args => ['-n', 'log', '-N', "-r$rev", $self->name], fromdir => $self->parent->x_cvs_dir); - $output =~ /^date: (\S+ \S+);/ms; + $output =~ /^date: (\S+ \S+)( \S+)?;/ms; my $time = $1; + my $tz = $2 || 'UTC'; confess("Failed to parse time for " . $self->path->stringify . " $rev") if !defined $time; - return "$time UTC"; + return "$time $tz"; } sub _build_content {
Ah ha! Thanks for the report; I was wondering what that failure was. I suspect it's a result of using a 1.12 version of CVS. Most systems (including mine) still ship 1.11. I think your fix for forcing it to output UTC is a good idea no matter what--I just have to find out whether or not it will work properly in both 1.11 and 1.12.
All right, I can reproduce with cvs 1.12! Now I'll look at your fix and see how best to apply it. :-)
Okay, I've committed a fix: modified lib/VCI/VCS/Cvs/File.pm Committed revision 219 It should be in the 0.6.3 release when that comes out.