incubator-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cross...@apache.org
Subject svn commit: r1165519 - /incubator/public/trunk/clutch.py
Date Tue, 06 Sep 2011 07:13:59 GMT
Author: crossley
Date: Tue Sep  6 07:13:59 2011
New Revision: 1165519

URL: http://svn.apache.org/viewvc?rev=1165519&view=rev
Log:
Continue the attempt to handle inconsistent project 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=1165519&r1=1165518&r2=1165519&view=diff
==============================================================================
--- incubator/public/trunk/clutch.py (original)
+++ incubator/public/trunk/clutch.py Tue Sep  6 07:13:59 2011
@@ -40,7 +40,7 @@ Note: The 'svn log' queries will only ru
 # FIXME: Some projects use different names in different contexts, and cannot
 #        be automatically handled, e.g. Lucene.Net, log4php (some of their stats
 #        are missing).
-#        See beginning attempt to handle this with "resourceName".
+#        See beginning attempt to handle this with "resourceNames".
 # FIXME: Perhaps send some error reporting to a log file:
 #        - validate the dates.
 #        - detect short description, e.g. Hama = Hama
@@ -179,7 +179,7 @@ for token in tokens:
     projects[id]['description'] = ""
     projects[id]['sponsor'] = "? not known"
     projects[id]['mentors'] = ""
-    projects[id]['resourceName'] = id
+    projects[id]['resourceNames'] = [id]
     projects[id]['startDate'] = ""
     projects[id]['entryDate'] = None
     projects[id]['committersSvn'] = None
@@ -206,21 +206,6 @@ for token in tokens:
   # If this still equals "month" at end, then there is a schedule error.
   projects[id]['reportingGroup'] = group
 
-  # Some projects use an alternate short resource name
-  # rather than their project name
-  if id == "zetacomponents":
-    projects[id]['resourceName'] = "zeta"
-  elif id == "beanvalidation":
-    projects[id]['resourceName'] = "bval"
-  elif id == "lucene.net":
-    projects[id]['resourceName'] = "lucene-net"
-  elif id == "manifoldcf":
-    projects[id]['resourceName'] = "connectors"
-  elif id == "openoffice.org":
-    projects[id]['resourceName'] = "ooo"
-  elif id == "odftoolkit":
-    projects[id]['resourceName'] = "odf"
-
 # End of processing the ReportingSchedule wiki page
 
 # Process the reporting schedule data, detect some potential issues.
@@ -231,6 +216,22 @@ for k in projectNames:
   if projects[k]['reportingGroup'] == 'month':
     print 'ERROR: %s: missing group' % k
     projects[k]['hasReportingGroup'] = False
+  # Some projects use an alternate short resource name
+  # rather than their project name
+  if k == "zetacomponents":
+    projects[k]['resourceNames'].append("zeta")
+  elif k == "beanvalidation":
+    projects[k]['resourceNames'].append("bval")
+  elif k == "lucene.net":
+    projects[k]['resourceNames'].append("lucene-net")
+  elif k == "manifoldcf":
+    projects[k]['resourceNames'].append("connectors")
+  elif k == "openoffice.org":
+    projects[k]['resourceNames'].append("ooo")
+  elif k == "odftoolkit":
+    projects[k]['resourceNames'].append("odf")
+  if optionVerbose and len(projects[k]['resourceNames']) > 1:
+    print "DEBUG: Will try alternate names: %s" % projects[k]['resourceNames']
 
 # Parse the projects table, ensure each is present, grab more details
 
@@ -266,7 +267,7 @@ for row in table.getElementsByTagName("t
   #print "Name: %s" % name
   id = id.replace(' ', '') # strip spaces from project ID
   # handle some inconsistent names
-  # FIXME: perhaps need to use resourceName
+  # FIXME: perhaps need to use resourceNames
   if 'manifoldcf' in id:
     id = 'manifoldcf'
   values = [getText(td.childNodes) for td in row.getElementsByTagName("td")[1:]]
@@ -664,7 +665,7 @@ for k in projectNames:
   # Add the number of committers
   # Sometimes the committer SVN group name contains the sponsor TLP,
   # e.g. portals-wsrp4j
-  tlpSvn = ""
+  svnGroups = projects[k]['resourceNames'][:]
   sponsor = projects[k]['sponsor'].lower()
   if '?' in sponsor:
     sponsor = "incubator"
@@ -672,13 +673,14 @@ for k in projectNames:
     if 'logging services' in sponsor:
       sponsor = "logging"
     tlpSvn = "%(a)s-%(b)s" % {'a': sponsor, 'b': k}
+    svnGroups.append(tlpSvn)
   if k == 'lucene.net':
     tlpSvn = "lucene-dot-net"
+    svnGroups.append(tlpSvn)
   if k == 'manifoldcf':
     tlpSvn = "lucene-connectors"
-  for svnGroup in [k, projects[k]['resourceName'], tlpSvn]:
-    if svnGroup == "":
-      break
+    svnGroups.append(tlpSvn)
+  for svnGroup in svnGroups:
     if optionVerbose:
       print "DEBUG: Trying committers group '%s'" % svnGroup
     try:
@@ -764,98 +766,111 @@ for k in projectNames:
   if optionUseClutchState and projects[k]['hasClutchState'] and state[k]['urlDist']:
     projects[k]['urlDist'] = state[k]['urlDist']
   else:
-    urlDist = "http://www.apache.org/dist/incubator/%s/" % \
-        projects[k]['resourceName']
-    urlMirror = "http://www.apache.org/dyn/closer.cgi/incubator/%s/" % \
-        projects[k]['resourceName']
-    try:
-      urllib2.urlopen(urlDist)
-    except IOError:
-      print 'INFO: %s: Does not yet have a distribution area' % k
-    else:
-      projects[k]['urlDist'] = urlMirror
+    for nameDist in projects[k]['resourceNames']:
+      urlDist = "http://www.apache.org/dist/incubator/%s/" % nameDist
+      urlMirror = "http://www.apache.org/dyn/closer.cgi/incubator/%s/" % nameDist
+      if optionVerbose:
+        print 'DEBUG: Trying dist area %s' % urlDist
+      try:
+        urllib2.urlopen(urlDist)
+      except IOError:
+        pass
+      else:
+        projects[k]['urlDist'] = urlMirror
+        break
+  if not projects[k]['urlDist']:
+    print 'INFO: %s: Does not yet have a distribution area' % k
+  elif optionVerbose:
+    print 'DEBUG: dist=%s' % projects[k]['urlDist']
 
   # Detect if they have a PGP KEYS file
   if projects[k]['urlDist']:
-    try:
-      keysList[k]
-    except KeyError:
+    match = re.search("/incubator/([^/]+)/", projects[k]['urlDist'])
+    if match:
+      nameDistArea = match.group(1)
       try:
-        keysList[projects[k]['resourceName']]
+        keysList[nameDistArea]
       except KeyError:
         print 'INFO: %s: Does not yet have a PGP KEYS file' % k
       else:
-        projects[k]['urlKeys'] = keysList[projects[k]['resourceName']]
-    else:
-      projects[k]['urlKeys'] = keysList[k]
+        projects[k]['urlKeys'] = keysList[nameDistArea]
+  if optionVerbose:
+    print 'DEBUG: KEYS=%s' % projects[k]['urlKeys']
 
-  # Detect mail lists established
+  # Detect mail lists established:
+  # For each alternate resourceName:
   # First, try the list names from their status page
   # then, try a standard list name under incubator.
   # To reduce network queries, if it is an incubator-hosted list then look up in
   # the list of mail-lists already gathered, otherwise it is a TLP-hosted list,
   # so try getting the archives URL.
-  projectName = projects[k]['resourceName']
-  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][mailListHintKey]
-    matchMail = re.search(mailListNameRE, projects[k][mailListHintKey])
-    if matchMail:
-      mailListGroup = "%s" % matchMail.group(1)
-      mailListNameHint = "%s" % matchMail.group(2)
-    else:
-      mailListGroup = "incubator"
-      mailListNameHint = ""
-    if optionVerbose:
-      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}
-      if mailListNameDefault == mailListNameHint:
-        mailListNameDefault = ""
-      for listName in [mailListNameHint, mailListNameDefault]:
-        if listName == "":
-          continue
+  foundMailLists = False
+  for projectName in projects[k]['resourceNames']:
+    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][mailListHintKey]
+      matchMail = re.search(mailListNameRE, projects[k][mailListHintKey])
+      if matchMail:
+        mailListGroup = "%s" % matchMail.group(1)
+        mailListNameHint = "%s" % matchMail.group(2)
+      else:
+        mailListGroup = "incubator"
+        mailListNameHint = ""
+      if optionVerbose:
+        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}
+        if mailListNameDefault == mailListNameHint:
+          mailListNameDefault = ""
+        for listName in [mailListNameHint, mailListNameDefault]:
+          if listName == "":
+            continue
+          if optionVerbose:
+            print "DEBUG: Trying listName=%s" % listName
+          try:
+            projectMailLists[projectName]
+          except KeyError:
+            print "INFO: %s: Does not yet have incubator group mail lists" % k
+            break
+          try:
+            projectMailLists[projectName][listType]
+          except:
+            print "INFO: %(a)s: Does not yet have hinted incubator mail list '%(b)s-%(c)s'"
% \
+                {'a': k, 'b': projectName, 'c': listType}
+            projects[k][mailListKey] = ""
+          else:
+            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]
+            foundMailLists = True
+            break
+      # End of processing incubator group mail list.
+      else:
+        listName = projects[k][mailListHintKey]
+        url = "http://mail-archives.apache.org/mod_mbox/%s/" % listName
         if optionVerbose:
-          print "DEBUG: Trying listName=%s" % listName
+          print "DEBUG: Trying mail url: %s" % url
         try:
-          projectMailLists[projectName]
-        except KeyError:
-          print "INFO: %s: Does not yet have incubator group mail lists" % k
-          break
-        try:
-          projectMailLists[projectName][listType]
-        except:
-          print "INFO: %(a)s: Does not yet have hinted incubator mail list '%(b)s-%(c)s'"
% \
-              {'a': k, 'b': projectName, 'c': listType}
+          urllib2.urlopen(url)
+        except IOError:
           projects[k][mailListKey] = ""
         else:
-          projects[k][mailListKey] = "http://mail-archives.apache.org/mod_mbox/incubator-%(a)s/"
% \
-              {'a': projectMailLists[projectName][listType]}
+          projects[k][mailListKey] = url
           if optionVerbose:
-            print "DEBUG: Successful Incubator mail url: %s" % projects[k][mailListKey]
-    # End of processing incubator group mail list.
-    else:
-      listName = projects[k][mailListHintKey]
-      url = "http://mail-archives.apache.org/mod_mbox/%s/" % listName
-      if optionVerbose:
-        print "DEBUG: Trying mail url: %s" % url
-      try:
-        urllib2.urlopen(url)
-      except IOError:
-        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}
+            print "DEBUG: Successful TLP mail url: %s" % url
+          foundMailLists = True
+      if not projects[k][mailListKey] and listName != "":
+        print "INFO: %(a)s: Does not yet have mail list '%(b)s'" % {'a': k, 'b': listName}
+    if foundMailLists:
+      break
   # End of processing project mail lists.
 
 # end of processing



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


Mime
View raw message