New upstream version.

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