From 4dbda29f822e3928843e1d6ce8e4bc3f8c999225 Mon Sep 17 00:00:00 2001 From: "Markus F.X.J. Oberhumer" Date: Tue, 13 Jul 2004 02:54:24 +0000 Subject: [PATCH] New upstream version. committer: mfx 1089687264 +0000 --- scripts/cvs2cl.pl | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/scripts/cvs2cl.pl b/scripts/cvs2cl.pl index a69480a7..0d2a5b2c 100644 --- a/scripts/cvs2cl.pl +++ b/scripts/cvs2cl.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#! /usr/bin/perl -w ############################################################## @@ -7,8 +7,8 @@ ### ### ############################################################## -## $Revision: 2.55 $ -## $Date: 2004/05/15 20:09:14 $ +## $Revision: 2.57 $ +## $Date: 2004/07/10 19:38:37 $ ## $Author: fluffy $ ## @@ -141,7 +141,7 @@ use Time::Local qw( timegm ); # Globals -------------------------------------------------------------------- # In case we have to print it out: -my $VERSION = '$Revision: 2.55 $'; +my $VERSION = '$Revision: 2.57 $'; $VERSION =~ s/\S+\s+(\S+)\s+\S+/$1/; ## Vars set by options: @@ -1754,6 +1754,8 @@ sub files { wantarray ? @{$_[0]->{files}} : $_[0]->{files} } package CVS::Utils::ChangeLog::FileEntry; +use File::Basename qw( fileparse ); + # Each revision of a file has a little data structure (a `qunk') # associated with it. That data structure holds not only the # file's name, but any additional information about the file @@ -1939,6 +1941,7 @@ sub read_changelog { XX_Log_Source: while () { chomp; + s!\r$!!; # If on a new file and don't see filename, skip until we find it, and # when we find it, grab it. @@ -2208,10 +2211,11 @@ sub read_date_author_and_state { if defined $Domain && $Domain ne ''; my $pw = getpwnam($author); - my ($fullname, $office, $workphone, $homephone); + my ($fullname, $office, $workphone, $homephone, $gcos); if ( defined $pw ) { + $gcos = (getpwnam($author))[6]; ($fullname, $office, $workphone, $homephone) = - split /\s*,\s*/, $pw->gecos; + split /\s*,\s*/, $gcos; } else { warn "Couldn't find gecos info for author '$author'\n" unless $gecos_warned{$author}++; @@ -2282,18 +2286,22 @@ sub parse_date_author_and_state { # Parses the date/time and author out of a line like: # # date: 1999/02/19 23:29:05; author: apharris; state: Exp; + # + # or, in CVS 1.12.9: + # + # date: 2004-06-05 16:10:32 +0000; author: somebody; state: Exp; my ($year, $mon, $mday, $hours, $min, $secs, $utcOffset, $author, $state, $rest) = $line =~ - m!(\d+)[-/](\d+)[-/](\d+) \s+ (\d+):(\d+):(\d+)(\s+[+-]\d{4})?;\s+ + m!(\d+)[-/](\d+)[-/](\d+)\s+(\d+):(\d+):(\d+)(\s+[+-]\d{4})?;\s+ author:\s+([^;]+);\s+state:\s+([^;]+);(.*)!x or die "Couldn't parse date ``$line''"; die "Bad date or Y2K issues" unless $year > 1969 and $year < 2258; # Kinda arbitrary, but useful as a sanity check my $time = timegm($secs, $min, $hours, $mday, $mon-1, $year-1900); - if (defined $utcOffset) { - my ($plusminus, $hour, $minute) = $utcOffset =~ m/([+-])(\d\d)(\d\d)/; + if ( defined $utcOffset ) { + my ($plusminus, $hour, $minute) = ($utcOffset =~ m/([+-])(\d\d)(\d\d)/); my $offset = (($hour * 60) + $minute) * 60 * ($plusminus eq '+' ? -1 : 1); $time += $offset; }