From a2ae80239a0fd19724c792e669a7044bbdc32337 Mon Sep 17 00:00:00 2001 From: Ykkrosh Date: Sat, 22 Nov 2008 15:05:41 +0000 Subject: [PATCH] # Updated public SVN logger Mostly just changes to work in the new server location This was SVN commit r6497. --- source/tools/autolog/SVNLog/config.yml | 12 +++++------ .../SVNLog/lib/SVNLog/Controller/LogUpdate.pm | 21 ++++++++++++------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/source/tools/autolog/SVNLog/config.yml b/source/tools/autolog/SVNLog/config.yml index 8ef71a162c..2c90348e53 100644 --- a/source/tools/autolog/SVNLog/config.yml +++ b/source/tools/autolog/SVNLog/config.yml @@ -2,10 +2,10 @@ name: SVNLog svn: username: philip password: ???????? - url : http://svn.0ad.homeip.net/svn/ps/trunk + url : http://svn.wildfiregames.com/svn/ps/trunk cdbi: - dsn : dbi:SQLite:/var/www/svnlog/SVNLog/sql/svnlog.db -scp: - command : /usr/bin/scp -i /var/www/svnlog/ssh/wfgkey - filename: philip@wildfiregames.com:~/svnlog/public - filename_feed: philip@wildfiregames.com:~/public_html/svnlog.xml + dsn : dbi:SQLite:/var/svn/autolog/SVNLog/sql/svnlog.db +output: + filename: /var/svn/htdocs/log.html + filename_feed: /var/svn/htdocs/log.atom + feed_url: http://svn.wildfiregames.com/log.atom diff --git a/source/tools/autolog/SVNLog/lib/SVNLog/Controller/LogUpdate.pm b/source/tools/autolog/SVNLog/lib/SVNLog/Controller/LogUpdate.pm index 5b81a08320..4c8cdd42ce 100644 --- a/source/tools/autolog/SVNLog/lib/SVNLog/Controller/LogUpdate.pm +++ b/source/tools/autolog/SVNLog/lib/SVNLog/Controller/LogUpdate.pm @@ -4,12 +4,9 @@ use strict; use base 'Catalyst::Controller'; use XML::Simple; -use File::Remote; use XML::Atom::SimpleFeed; use Data::UUID; -my $feed_url = 'http://www.wildfiregames.com/~philip/svnlog.xml'; - sub doupdate : Local { my ($self, $c) = @_; @@ -49,9 +46,10 @@ sub doupdate : Local add_default_public_msgs($c); - my $scp = new File::Remote(rcp => $c->config->{scp}{command}); - $scp->writefile($c->config->{scp}{filename}, generate_text()) or die $!; - $scp->writefile($c->config->{scp}{filename_feed}, generate_feed()) or die $!; + open my $text_fh, '>', $c->config->{output}{filename} or die $!; + print $text_fh $self->generate_text($c); + open my $feed_fh, '>', $c->config->{output}{filename_feed} or die $!; + print $feed_fh $self->generate_feed($c); $c->res->body("Updated log to $max_seen."); } @@ -96,14 +94,14 @@ sub add_default_public_msgs sub createtext : Local { my ($self, $c) = @_; - my $out = generate_text(); + my $out = $self->generate_text($c); $c->res->body($out); } sub createfeed : Local { my ($self, $c) = @_; - my $out = generate_feed(); + my $out = $self->generate_feed($c); $c->res->body($out); } @@ -125,6 +123,9 @@ sub get_log_entries sub generate_text { + my ($self, $c) = @_; + + my $feed_url = $c->config->{output}{feed_url}; my $out = qq{Atom feed\n}; my @logentries = get_log_entries(28, 10); @@ -157,8 +158,12 @@ EOF sub generate_feed { + my ($self, $c) = @_; + my $uid_gen = new Data::UUID; + my $feed_url = $c->config->{output}{feed_url}; + my $feed = new XML::Atom::SimpleFeed( title => "0 A.D. Revision Log", link => "http://www.wildfiregames.com/0ad/",