[llvm-commits] [hlvm] r38241 - in /hlvm/trunk/build: configure.py filterbuilders.py hlvm.py

Reid Spencer reid at x10sys.com
Sat Jul 7 17:01:31 PDT 2007


Author: reid
Date: Sat Jul  7 19:01:31 2007
New Revision: 38241

URL: http://llvm.org/viewvc/llvm-project?rev=38241&view=rev
Log:
Make sure the RNG schema validates before allowing its use.

Modified:
    hlvm/trunk/build/configure.py
    hlvm/trunk/build/filterbuilders.py
    hlvm/trunk/build/hlvm.py

Modified: hlvm/trunk/build/configure.py
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/build/configure.py?rev=38241&r1=38240&r2=38241&view=diff

==============================================================================
--- hlvm/trunk/build/configure.py (original)
+++ hlvm/trunk/build/configure.py Sat Jul  7 19:01:31 2007
@@ -178,7 +178,7 @@
 def FindLibXML2(conf):
   code = 'xmlNewParserCtxt();'
   return conf.FindPackage('LIBXML2',pjoin('libxml','parser.h'),['xml2'],code,
-    [conf.env['with_libxml2']],[],'libxml2')
+    [conf.env['with_libxml2']],[],'libxml2',['xmllint'])
 
 def CheckProgram(ctxt,progname,varname,moredirs=[],critical=1):
   ctxt.Message("Checking for Program " + progname + "...")
@@ -247,6 +247,7 @@
   conf.CheckProgram('gperf','with_gperf')
   conf.CheckProgram('pod2html','with_pod2html',[],0)
   conf.CheckProgram('pod2man','with_pod2man',[],0)
+  conf.CheckProgram('xmllint','with_xmllint',['LIBXML2_bin'],0)
   if not conf.CheckProgram('runtest','with_runtest',[],0):
     print "*** TESTING DISABLED ***"
   if not conf.CheckProgram('doxygen','with_doxygen',[],0):

Modified: hlvm/trunk/build/filterbuilders.py
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/build/filterbuilders.py?rev=38241&r1=38240&r2=38241&view=diff

==============================================================================
--- hlvm/trunk/build/filterbuilders.py (original)
+++ hlvm/trunk/build/filterbuilders.py Sat Jul  7 19:01:31 2007
@@ -18,8 +18,12 @@
   lines += '\n'
   f.write(lines)
   f.close()
+  return 0
 
 def QuoteSourceAction(target,source,env):
+  if env.Execute(env['with_xmllint'] + ' --relaxng ' + source[0].path + 
+      ' test/return0/helloworld.hlx >/dev/null'):
+    return 1
   substs = [
     ['<!--.*?-->',''],
     ['<annotation>.*?</annotation>',''],
@@ -30,8 +34,7 @@
     ['^([^\\n]*)$','"\\1"'],
     ['^"[ \\t]*?"$\\n','']
   ]
-  _sedit(source,target,substs)
-  return 0
+  return _sedit(source,target,substs)
 
 def QuoteSourceMessage(target,source,env):
   return "Converting %s to %s as quoted source" % (source[0],target[0])
@@ -48,13 +51,9 @@
   valuPat = re.compile('<value>\s*([^<\s]*)')
   tokens = []
   for line in fileinput.input(fname):
-    print line;
-    new_tokens = []
-    new_tokens += elemPat.findall(line)
-    new_tokens += attrPat.findall(line)
-    new_tokens += valuPat.findall(line)
-    print "    ",new_tokens
-    tokens += new_tokens
+    tokens += elemPat.findall(line)
+    tokens += attrPat.findall(line)
+    tokens += valuPat.findall(line)
   dict = {}
   for tok in tokens:
     dict[tok] = 1
@@ -102,7 +101,8 @@
   gperfAction = env.Action(
     env['with_gperf'] + " -tcDCIoGl --fast 0 -L C++ -Z " + TokenHashClass +
     " -s 2 -S 1 -k '*' " + tknFilename + " >" + TokenHashFile)
-  env.Execute(gperfAction)
+  if env.Execute(gperfAction):
+    return 1;
   tokenList = ""
   for tkn in tokens:
     tokenList += "TKN_" + tkn + ",\n    "

Modified: hlvm/trunk/build/hlvm.py
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/build/hlvm.py?rev=38241&r1=38240&r2=38241&view=diff

==============================================================================
--- hlvm/trunk/build/hlvm.py (original)
+++ hlvm/trunk/build/hlvm.py Sat Jul  7 19:01:31 2007
@@ -176,6 +176,8 @@
            '/usr/local/bin/pod2html')
   opts.Add('with_pod2man','Specify where the POD to MAN generator is located',
            '/usr/local/bin/pod2man')
+  opts.Add('with_xmllint','Specify where the xmllint program is located',
+           '/usr/local/bin/xmllint')
   opts.Update(env)
   env['HLVM_Copyright'] = 'Copyright (c) 2006 Reid Spencer'
   env['HLVM_Maintainer'] = 'Reid Spencer <rspencer at reidspencer>'





More information about the llvm-commits mailing list