community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From humbed...@apache.org
Subject svn commit: r1662771 - /comdev/projects.apache.org/scripts/cronjobs/parsereleases.py
Date Fri, 27 Feb 2015 18:03:22 GMT
Author: humbedooh
Date: Fri Feb 27 18:03:22 2015
New Revision: 1662771

URL: http://svn.apache.org/r1662771
Log:
dump more often, don't get lost in symlinks

Modified:
    comdev/projects.apache.org/scripts/cronjobs/parsereleases.py

Modified: comdev/projects.apache.org/scripts/cronjobs/parsereleases.py
URL: http://svn.apache.org/viewvc/comdev/projects.apache.org/scripts/cronjobs/parsereleases.py?rev=1662771&r1=1662770&r2=1662771&view=diff
==============================================================================
--- comdev/projects.apache.org/scripts/cronjobs/parsereleases.py (original)
+++ comdev/projects.apache.org/scripts/cronjobs/parsereleases.py Fri Feb 27 18:03:22 2015
@@ -24,16 +24,17 @@ def getDirList(url):
 
 def parseDir(project, path):
     print("Parsing %s..." % path)
-    for f, d, xd in getDirList("%s/%s" % (mainurl, path)):
-        if xd:
-            parseDir(project, "%s/%s" % (path, f))
-        elif not re.search(r"(md5|asc|sig)", f, flags=re.IGNORECASE):
-            match =  re.match(r"^(.+?)(\.(\S{1,4}))?\.(\S{1,7})$", f)
-            if match:
-                filename = match.group(1)
-                filename = re.sub(r"[-_.]*([Aa]pache|%s|src|bin|deps)[-_.]*" % project, "",
filename, count=10, flags=re.IGNORECASE|re.UNICODE)
-                releases[project][filename] = d
-    
+    if len(path) < 100:
+        for f, d, xd in getDirList("%s/%s" % (mainurl, path)):
+            if xd:
+                parseDir(project, "%s/%s" % (path, f))
+            elif not re.search(r"(md5|asc|sig)", f, flags=re.IGNORECASE):
+                match =  re.match(r"^(.+?)(\.(\S{1,4}))?\.(\S{1,7})$", f)
+                if match:
+                    filename = match.group(1)
+                    filename = re.sub(r"[-_.]*([Aa]pache|%s|src|bin|deps)[-_.]*" % project,
"", filename, count=10, flags=re.IGNORECASE|re.UNICODE)
+                    releases[project][filename] = d
+        
 
 for project, d, xdir in getDirList(mainurl):
     if project != "incubator":
@@ -46,7 +47,10 @@ for project, d, xdir in getDirList(mainu
             project = "incubator-%s" % podling
             releases[project] = releases[project] if project in releases else {}
             parseDir(project, "incubator/%s" % podling)
-
+    with open("../../site/json/foundation/releases.json", "w") as f:
+        f.write(json.dumps(releases))
+        f.close()
+    
 print("Writing releases.json")
 with open("../../site/json/foundation/releases.json", "w") as f:
     f.write(json.dumps(releases))



Mime
View raw message