community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1877995 - /comdev/projects.apache.org/trunk/scripts/project2attic.py
Date Thu, 21 May 2020 10:05:15 GMT
Author: sebb
Date: Thu May 21 10:05:15 2020
New Revision: 1877995

URL: http://svn.apache.org/viewvc?rev=1877995&view=rev
Log:
Only write one category

Modified:
    comdev/projects.apache.org/trunk/scripts/project2attic.py

Modified: comdev/projects.apache.org/trunk/scripts/project2attic.py
URL: http://svn.apache.org/viewvc/comdev/projects.apache.org/trunk/scripts/project2attic.py?rev=1877995&r1=1877994&r2=1877995&view=diff
==============================================================================
--- comdev/projects.apache.org/trunk/scripts/project2attic.py (original)
+++ comdev/projects.apache.org/trunk/scripts/project2attic.py Thu May 21 10:05:15 2020
@@ -35,6 +35,7 @@ datadir = join(dirname(MYHOME),'data')
 def update_doap(doap, source):
     infile = doap
     tmpfile = doap + '.t'
+    catWrite = True
     with open(infile,'r') as r, open(tmpfile,'w') as w:
         for l in r:
             if re.search("<rdf:RDF",l):
@@ -42,8 +43,9 @@ def update_doap(doap, source):
             if re.search("<asfext:pmc rdf:resource=", l):
                 w.write(re.sub("=['\"].+?['\"]",'="http://attic.apache.org/"',l))
                 continue # don't write original line
-            if re.search("<category",l):
-                w.write('<category rdf:resource="http://projects.apache.org/category/retired"
/>\n')
+            if catWrite and re.search("<category",l):
+                catWrite = False
+                w.write('    <category rdf:resource="http://projects.apache.org/category/retired"
/>\n')
             w.write(l) # write the original line
             
     os.system("diff %s*" % (infile))



Mime
View raw message