Whenm make-secnet-sites is writing the "output" sites file in -u
(groupfile update) mode, it includes the effective contents of files
referenced in "include" directives, rather than the "include"
directive itself.
So the "output" sites file does not any longer depend on any files
included by the header.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
"Process a configuration file line"
global allow_defs, obstack, root
w=string.split(i.rstrip('\n'))
"Process a configuration file line"
global allow_defs, obstack, root
w=string.split(i.rstrip('\n'))
+ if len(w)==0: return [i]
keyword=w[0]
current=obstack[len(obstack)-1]
if keyword=='end-definitions':
allow_defs=sitelevel.depth
obstack=[root]
keyword=w[0]
current=obstack[len(obstack)-1]
if keyword=='end-definitions':
allow_defs=sitelevel.depth
obstack=[root]
if keyword=='include':
if not allow_include:
complain("include not permitted here")
if keyword=='include':
if not allow_include:
complain("include not permitted here")
if len(w) != 2:
complain("include requires one argument")
if len(w) != 2:
complain("include requires one argument")
newfile=os.path.join(os.path.dirname(file),w[1])
newfile=os.path.join(os.path.dirname(file),w[1])
- pfilepath(newfile,allow_include=allow_include)
- return
+ return pfilepath(newfile,allow_include=allow_include)
if levels.has_key(keyword):
# We may go up any number of levels, but only down by one
newdepth=levels[keyword].depth
if levels.has_key(keyword):
# We may go up any number of levels, but only down by one
newdepth=levels[keyword].depth
current.children[w[1]]=nl
current=nl
obstack.append(current)
current.children[w[1]]=nl
current=nl
obstack.append(current)
if current.allow_properties.has_key(keyword):
set_property(current,w)
if current.allow_properties.has_key(keyword):
set_property(current,w)
else:
complain("Property %s not allowed at %s level"%
(keyword,current.type))
else:
complain("Property %s not allowed at %s level"%
(keyword,current.type))
complain("unknown keyword '%s'"%(keyword))
def pfilepath(pathname,allow_include=False):
f=open(pathname)
complain("unknown keyword '%s'"%(keyword))
def pfilepath(pathname,allow_include=False):
f=open(pathname)
- lines=f.readlines()
- pfile(pathname,lines,allow_include=allow_include)
+ outlines=pfile(pathname,f.readlines(),allow_include=allow_include)
def pfile(name,lines,allow_include=False):
"Process a file"
global file,line
file=name
line=0
def pfile(name,lines,allow_include=False):
"Process a file"
global file,line
file=name
line=0
for i in lines:
line=line+1
if (i[0]=='#'): continue
for i in lines:
line=line+1
if (i[0]=='#'): continue
- pline(i,allow_include=allow_include)
+ outlines += pline(i,allow_include=allow_include)
+ return outlines
def outputsites(w):
"Output include file for secnet configuration"
def outputsites(w):
"Output include file for secnet configuration"