Author: sebb
Date: Thu Jun 16 13:20:24 2022
New Revision: 1901973
URL: http://svn.apache.org/viewvc?rev=1901973&view=rev
Log:
Check for Attic project
Modified:
comdev/projects.apache.org/trunk/scripts/newtlp.py
Modified: comdev/projects.apache.org/trunk/scripts/newtlp.py
URL:
http://svn.apache.org/viewvc/comdev/projects.apache.org/trunk/scripts/newtlp.py?rev=1901973&r1=1901972&r2=1901973&view=diff
==============================================================================
--- comdev/projects.apache.org/trunk/scripts/newtlp.py (original)
+++ comdev/projects.apache.org/trunk/scripts/newtlp.py Thu Jun 16 13:20:24 2022
@@ -32,25 +32,27 @@ import committee_info
print("Reading committee-info")
committees = committee_info.committees()
-datadir = os.path.join(committee_info.COMDEV_HOME,'data')
-rdfdir = os.path.join(datadir,'committees')
+DATADIR = os.path.join(committee_info.COMDEV_HOME,'data')
+RDFDIR = os.path.join(DATADIR,'committees')
+RETIREDDIR = os.path.join(DATADIR,'committees-retired')
+OVERRIDEDIR = os.path.join(DATADIR,'projects-override')
print("Reading _template.rdf")
-tmpfile = os.path.join(rdfdir,'_template.rdf')
+tmpfile = os.path.join(RDFDIR,'_template.rdf')
with open(tmpfile,'r') as t:
template = Template(t.read())
def update_xml(pid):
- xmlfile = os.path.join(datadir,'committees.xml')
- xmlfilet = os.path.join(datadir,'committees.xml.t')
+ xmlfile = os.path.join(DATADIR,'committees.xml')
+ xmlfilet = os.path.join(DATADIR,'committees.xml.t')
print("Updating committees.xml")
notYetFound = True
with open(xmlfile,'r') as r, open(xmlfilet,'w') as w:
for l in r:
if notYetFound:
- m = re.search("^(\s+)<location>committees/(.+)\.rdf<",l)
+ m = re.search("^(\\s+)<location>committees/(.+)\\.rdf<",l)
if m:
indent = m.group(1)
mid = m.group(2)
@@ -71,10 +73,18 @@ def update_xml(pid):
for arg in sys.argv[1:]:
print("Processing "+arg)
- outfile = os.path.join(rdfdir,"%s.%s"%(arg,'rdf'))
+ outfile = os.path.join(RDFDIR,"%s.%s"%(arg,'rdf'))
if os.path.exists(outfile):
print("RDF file for %s already exists!" % arg)
continue
+ oldrdf = os.path.join(RETIREDDIR,"%s.%s"%(arg,'rdf'))
+ if os.path.exists(oldrdf):
+ print("%s exists - sorry cannot handle exit from Attic" % oldrdf)
+ continue
+ oldrdf = os.path.join(OVERRIDEDIR,"%s.%s"%(arg,'rdf'))
+ if os.path.exists(oldrdf):
+ print("%s exists - sorry cannot handle exit from Attic" % oldrdf)
+ continue
try:
cttee = committees[arg]
if cttee['description']:
@@ -95,4 +105,4 @@ for arg in sys.argv[1:]:
except KeyError:
print("Cannot find "+arg)
-os.system("svn diff %s" % datadir)
\ No newline at end of file
+os.system("svn diff %s" % DATADIR)
\ No newline at end of file