Created a way to generate 0 and 1's while retaining Yes and No in CML

CML boolean type compiles into #define and #undefs.
This is not useful for capabilities since a value of 0 or 1 can be
used automatically for setting or unsetting bits in permission words.

Meanwhile using an integer type with 0 - 1 range has a worse usability
experience than the boolean Y, N.

Also moved parsing of container.template.cml to newer Python argument
parsing format.
This commit is contained in:
Bahadir Balban
2009-10-02 20:03:25 +03:00
parent d3b96ca646
commit f3bca7ba00
2 changed files with 368 additions and 308 deletions

View File

@@ -39,7 +39,6 @@ def add_container_constraint(cid):
return cml_string
def generate_container_cml(arch, ncont):
contid_occurence = 380 # Exact number of arguments
fbody = ""
with open(join(CML2_CONFIG_SRCDIR, arch + '.cml')) as in_cml:
fbody += in_cml.read()
@@ -61,7 +60,7 @@ def generate_container_cml(arch, ncont):
with open(CML2_CONT_DEFFILE, "rU") as contdefs:
defbody = contdefs.read()
defbody = defbody.replace("%\n", "%%\n")
fbody += defbody % tuple(contid_occurence * [cont])
fbody += defbody % { 'cn' : cont }
# Write the result to output rules file.
with open(join(CML2_CONFIG_SRCDIR, "out.cml"), "w+") as out_cml: