You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by se...@apache.org on 2019/07/18 10:38:55 UTC

[whimsy] branch master updated: WHIMSY-278 Prepare to handle foundation-commits emails

This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new c01aab9  WHIMSY-278 Prepare to handle foundation-commits emails
c01aab9 is described below

commit c01aab9d47e97c1402e357f72703cf4ff2298f42
Author: Sebb <se...@apache.org>
AuthorDate: Thu Jul 18 11:38:45 2019 +0100

    WHIMSY-278 Prepare to handle foundation-commits emails
---
 tools/svnupdate.rb | 24 +++++++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)

diff --git a/tools/svnupdate.rb b/tools/svnupdate.rb
index d50a41d..56b1721 100644
--- a/tools/svnupdate.rb
+++ b/tools/svnupdate.rb
@@ -10,9 +10,23 @@ File.umask(0002)
 STDIN.binmode
 mail = Mail.new(STDIN.read)
 
+# This must agree with the file used by the svnupdate cron job
 LOG = '/srv/whimsy/www/logs/svn-update'
 
-if mail.subject =~ %r{^board: r\d+ -( in)? /foundation/board}
+def update(dir)
+  # prevent concurrent updates being performed by the cron job
+  File.open(LOG, File::RDWR|File::CREAT, 0644) do |log|
+    log.flock(File::LOCK_EX)
+
+    puts "#{Time.now} Updating #{dir}" # Temporary test
+    Dir.chdir dir do
+      `svn cleanup`
+      `svn update`
+    end
+  end
+end
+
+if mail.subject =~ %r{^board: r\d+ -( in)? /foundation/board} # board-commits@
 
   # prevent concurrent updates being performed by the cron job
   File.open(LOG, File::RDWR|File::CREAT, 0644) do |log|
@@ -24,7 +38,11 @@ if mail.subject =~ %r{^board: r\d+ -( in)? /foundation/board}
     end
   end
 
-elsif mail.subject =~ %r{^committers: r\d+ -( in)? /committers/board}
+elsif mail.subject =~ %r{^foundation: r\d+ -( in)? /foundation} # foundation-commits@
+  # includes members.txt
+  update '/srv/svn/foundation'
+
+elsif mail.subject =~ %r{^committers: r\d+ -( in)? /committers/board} # committers-cvs@
 
   # prevent concurrent updates being performed by the cron job
   File.open(LOG, File::RDWR|File::CREAT, 0644) do |log|
@@ -36,7 +54,7 @@ elsif mail.subject =~ %r{^committers: r\d+ -( in)? /committers/board}
     end
   end
 
-elsif mail.subject =~ %r{^bills: r\d+ -( in)? /financials/Bills}
+elsif mail.subject =~ %r{^bills: r\d+ -( in)? /financials/Bills} # operations@
 
   # prevent concurrent updates being performed by the cron job
   File.open(LOG, File::RDWR|File::CREAT, 0644) do |log|