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 9290e82 Add listing of archivers, with classification
9290e82 is described below
commit 9290e82193afe21084b3312434b2449eaacb699a
Author: Sebb <[email protected]>
AuthorDate: Mon Jan 21 22:41:33 2019 +0000
Add listing of archivers, with classification
---
lib/whimsy/asf/mlist.rb | 42 ++++++++++++++++++++++++++++++++++++++++--
1 file changed, 40 insertions(+), 2 deletions(-)
diff --git a/lib/whimsy/asf/mlist.rb b/lib/whimsy/asf/mlist.rb
index 5877e87..9f90e78 100644
--- a/lib/whimsy/asf/mlist.rb
+++ b/lib/whimsy/asf/mlist.rb
@@ -157,8 +157,39 @@ module ASF
return subscribers.to_h, (File.mtime(LIST_TIME) rescue
File.mtime(LIST_SUBS))
end
+ def self.list_archivers
+ list_parse('sub') do |dom, list, subs|
+ yield [dom, list, subs.select {|s| is_archiver? s}.map{|m|
[m,archiver_type(m,dom,list)].flatten}]
+ end
+ end
+
private
+ # return the archiver type as array: [:MBOX|:PONY|:MINO,
'public'|'private'|'alias'|'direct']
+ # minotaur archiver names do not include any public/private indication as
that is in bin/.archives
+ def self.archiver_type(email, dom,list)
+ case email
+ when ARCH_MBOX_PUB then return [:MBOX, 'public']
+ when ARCH_MBOX_PRV then return [:MBOX, 'private']
+ when ARCH_PONY_PUB then return [:PONY, 'public']
+ when ARCH_PONY_PRV then return [:PONY, 'private']
+ # normal archiver routed via .qmail-[tlp-]list-archive
+ when "#{list}-archive@#{dom}" then return [:MINO, 'alias']
+ # Direct mail to minotaur
+ when "apmail-#{dom.split('.').first}-#{list}[email protected]"
then return [:MINO, 'direct']
+ end
+ raise "Unexpected archiver email #{email} for #{list}@#{dom}" # Should
not happen?
+ end
+
+ # Is the email a minotaur archiver?
+ def self.is_mino_archiver? (e)
+ e =~ /.-archive@([^.]+\.)?(apache\.org|apachecon\.com)$/
+ end
+
+ def self.is_archiver? (e)
+ ARCHIVERS.include? e or is_mino_archiver? e
+ end
+
def self.downcase(array)
array.map{|m| m.downcase}
end
@@ -229,8 +260,15 @@ module ASF
end
# Standard ASF archivers
- ARCHIVERS = ["[email protected]",
"[email protected]",
- "[email protected]", "[email protected]",
"[email protected]"]
+ ARCH_MBOX_PUB = "[email protected]"
+ ARCH_MBOX_PRV = "[email protected]"
+ ARCH_MBOX_RST = "[email protected]"
+
+ ARCH_PONY_PUB = "[email protected]"
+ ARCH_PONY_PRV = "[email protected]"
+
+ ARCHIVERS = [ARCH_PONY_PRV, ARCH_PONY_PUB,
+ ARCH_MBOX_PUB, ARCH_MBOX_PRV, ARCH_MBOX_RST]
# TODO alias archivers: either add list or use RE to filter them
LIST_MODS = '/srv/subscriptions/list-mods'