incubator-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cross...@apache.org
Subject svn commit: r883985 - /incubator/public/trunk/clutch.py
Date Wed, 25 Nov 2009 06:20:38 GMT
Author: crossley
Date: Wed Nov 25 06:20:38 2009
New Revision: 883985

URL: http://svn.apache.org/viewvc?rev=883985&view=rev
Log:
Improve mail list detection to handle non-standard list names.

Modified:
    incubator/public/trunk/clutch.py

Modified: incubator/public/trunk/clutch.py
URL: http://svn.apache.org/viewvc/incubator/public/trunk/clutch.py?rev=883985&r1=883984&r2=883985&view=diff
==============================================================================
--- incubator/public/trunk/clutch.py (original)
+++ incubator/public/trunk/clutch.py Wed Nov 25 06:20:38 2009
@@ -35,8 +35,7 @@
 
 
 # FIXME: mentorsList needs better splitting.
-# FIXME: Mail list detection assumes "-dev" for incubator.a.o
-#        so not handling "libcloud@i.a.o". Need to rethink.
+# FIXME: Mail list detection could be improved.
 # FIXME: Mail list detection. See svn comments with 2009-11-13 rush bug fix.
 # FIXME: Occasional trailing slash issue in Clutch cache.
 # FIXME: Some projects use different names in different contexts, and cannot
@@ -177,7 +176,9 @@
     projects[id]['startDate'] = ""
     projects[id]['entryDate'] = None
     projects[id]['committersSvn'] = None
+    projects[id]['hintMailListDev'] = ""
     projects[id]['hasMailListDev'] = ""
+    projects[id]['hintMailListCommits'] = ""
     projects[id]['hasMailListCommits'] = ""
     projects[id]['numberCommitters'] = 0
     projects[id]['numberCommittersNew'] = 0
@@ -309,7 +310,7 @@
           value = value.replace('@@', '@')
           matchMail = re.search(mailListRE, value)
           if matchMail:
-            projects[k]['hasMailListDev'] = "%(a)s-%(b)s" % \
+            projects[k]['hintMailListDev'] = "%(a)s-%(b)s" % \
                 {'a': matchMail.group(2), 'b': matchMail.group(1)}
           continue
         if cell.getAttribute('id') == "mail-commits":
@@ -321,7 +322,7 @@
           value = value.replace('@@', '@')
           matchMail = re.search(mailListRE, value)
           if matchMail:
-            projects[k]['hasMailListCommits'] = "%(a)s-%(b)s" % \
+            projects[k]['hintMailListCommits'] = "%(a)s-%(b)s" % \
                 {'a': matchMail.group(2), 'b': matchMail.group(1)}
           continue
         # Get hints for various url-based resources
@@ -432,7 +433,8 @@
 mailListNamesRE = re.compile("(.*)-([^-]+)/")
 mailListNamesUsualRE = re.compile("commits|cvs|dev|issues|user|spec")
 for listName in mailLists.names:
-  #print "DEBUG: listName=%s" % listName
+  if optionVerbose:
+    print "DEBUG: listName=%s" % listName
   if listName.find("/") == -1:
     continue
   if listName.find("-") != -1:
@@ -441,19 +443,24 @@
       projectMailLists[matchList.group(1)]
     except KeyError:
       projectMailLists[matchList.group(1)] = {}
-    projectMailLists[matchList.group(1)][matchList.group(2)] = True
-    #print "  Found list: %(a)s %(b)s" % {'a': matchList.group(1), 'b': matchList.group(2)}
+    listName = listName.replace('/', '')
+    projectMailLists[matchList.group(1)][matchList.group(2)] = listName
+    if optionVerbose:
+      print "DEBUG: Found list: %(a)s %(b)s" % {'a': matchList.group(1), 'b': matchList.group(2)}
     # FIXME: We assume that mail lists are always named like this
     # with "-dev" or "-commits" etc.
     matchListUsual = re.search(mailListNamesUsualRE, matchList.group(2))
     if not matchListUsual:
       print "WARN: Unusual mail list name '%s'" % listName
   else:
+    listName = listName.replace('/', '')
     try:
       projectMailLists[listName]
     except KeyError:
       projectMailLists[listName] = {}
-    projectMailLists[listName][listName] = True
+    projectMailLists[listName]["dev"] = listName
+    print "WARN: %(a)s: unusual mail list name '%(b)s', assuming it is their dev list" %
\
+        {'a': listName, 'b': projectMailLists[listName]["dev"]}
 
 print "Gather incubator PGP keys data ..."
 keysNamesRE = re.compile("/dist/incubator/([^/]+)/(.*)KEYS")
@@ -731,12 +738,14 @@
     projectName = "lucene-net"
   for listType in ['dev', 'commits']:
     if listType == "dev":
+      mailListHintKey = "hintMailListDev"
       mailListKey = "hasMailListDev"
     else:
+      mailListHintKey = "hintMailListCommits"
       mailListKey = "hasMailListCommits"
     if optionVerbose:
-      print "DEBUG: Looking for mailList: %s" % projects[k][mailListKey]
-    matchMail = re.search(mailListNameRE, projects[k][mailListKey])
+      print "DEBUG: Looking for mailList: %s" % projects[k][mailListHintKey]
+    matchMail = re.search(mailListNameRE, projects[k][mailListHintKey])
     if matchMail:
       mailListGroup = "%s" % matchMail.group(1)
       mailListNameHint = "%s" % matchMail.group(2)
@@ -744,7 +753,7 @@
       mailListGroup = "incubator"
       mailListNameHint = ""
     if optionVerbose:
-      print "DEBUG: Trying mailListGroup=%(a)s mailListNameHint=%(b)s|" % \
+      print "DEBUG: Trying mailListGroup=%(a)s mailListNameHint=%(b)s" % \
           {'a': mailListGroup, 'b': mailListNameHint}
     if mailListGroup == "incubator":
       mailListNameDefault = "%(a)s-%(b)s" % {'a': projectName, 'b': listType}
@@ -767,11 +776,13 @@
               {'a': k, 'b': projectName, 'c': listType}
           projects[k][mailListKey] = ""
         else:
-          projects[k][mailListKey] = "http://mail-archives.apache.org/mod_mbox/incubator-%(a)s-%(b)s/"
% \
-              {'a': projectName, 'b': listType}
+          projects[k][mailListKey] = "http://mail-archives.apache.org/mod_mbox/incubator-%(a)s/"
% \
+              {'a': projectMailLists[projectName][listType]}
+          if optionVerbose:
+            print "DEBUG: Successful Incubator mail url: %s" % projects[k][mailListKey]
     # End of processing incubator group mail list.
     else:
-      listName = projects[k][mailListKey]
+      listName = projects[k][mailListHintKey]
       url = "http://mail-archives.apache.org/mod_mbox/%s/" % listName
       if optionVerbose:
         print "DEBUG: Trying mail url: %s" % url
@@ -781,6 +792,8 @@
         projects[k][mailListKey] = ""
       else:
         projects[k][mailListKey] = url
+        if optionVerbose:
+          print "DEBUG: Successful TLP mail url: %s" % url
     if not projects[k][mailListKey] and listName != "":
       print "INFO: %(a)s: Does not yet have mail list '%(b)s'" % {'a': k, 'b': listName}
   # End of processing project mail lists.
@@ -1014,6 +1027,8 @@
       reportDevList += ' <general@incubator.apache.org>'
   else:
     reportDevList += ' <general@incubator.apache.org>'
+  if optionVerbose:
+    print "DEBUG: reportDevList=%s" % reportDevList
   if projects[k]['reportingMonthly']:
     reportList1 += '%s\n' % reportDevList
     reportList2 += '%s\n' % reportDevList



---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@incubator.apache.org
For additional commands, e-mail: cvs-help@incubator.apache.org


Mime
View raw message