Skip to content

Commit

Permalink
Item1210: Made the regexes more arsy to overcome problems with svn 1.4.2
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/branches/Release01x00@2895 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
CrawfordCurrie authored and CrawfordCurrie committed Mar 6, 2009
1 parent 71f5b12 commit fc6b22a
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions BuildContrib/lib/Foswiki/Contrib/Build.pm
Expand Up @@ -468,6 +468,8 @@ sub _loadDependenciesFrom {
close(PF);
}

# SMELL: Would be good to change this to use SVN::Client, but Sven warns us
# that SVN::Client doesn't work in most places :-(. Maybe some day.
sub _get_svn_version {
my $this = shift;

Expand Down Expand Up @@ -496,30 +498,32 @@ sub _get_svn_version {
my $maxd = 0;
eval {
my $log = $this->sys_action( 'svn', 'info', @files );

my $getDate = 0;
foreach my $line ( split( "\n", $log ) ) {
if ( $line =~ /^Last Changed Rev: (.*)$/ ) {
if ( $line =~ /^Last Changed Rev: (\d+)/ ) {
$getDate = 0;
if ( $1 > $max ) {
$max = $1;
$getDate = 1;
}
}
elsif ($getDate
&& $line =~ /^Text Last Updated: (.*?) (.*) \(/m )
&& $line =~ /^Text Last Updated: ([\d-]+) ([\d:]+) ([-+\d]+)?/m )
{
$maxd = Foswiki::Time::parseTime("$1T$2");
$maxd = Foswiki::Time::parseTime("$1T$2".($3||''));
$getDate = 0;
}
elsif ($getDate
&& $line =~ /Last Changed Date: (.*?) (.*) \(/m )
&& $line =~ /Last Changed Date: ([\d-]+) ([\d:]+) ([-+\d]+)?/m )
{
$maxd = Foswiki::Time::parseTime("$1T$2");
$maxd = Foswiki::Time::parseTime("$1T$2".($3||''));
$getDate = 0;
}
}
};
if ($@) {
print STDERR "WARNING: Failed to shell out to svn: $@";
}
$this->{DATE} =
Foswiki::Time::formatTime( $maxd, '$iso', 'gmtime' );
my $day = $this->{DATE};
Expand Down

0 comments on commit fc6b22a

Please sign in to comment.