def spec_clauses(self, spec, body=False, transitive=True):
    "Return a list of clauses for a spec mandates are true.\n\n        Arguments:\n            spec (spack.spec.Spec): the spec to analyze\n            body (bool): if True, generate clauses to be used in rule bodies\n                (final values) instead of rule heads (setters).\n            transitive (bool): if False, don't generate clauses from\n                 dependencies (default True)\n        "
    clauses = []

    class Head(object):
        node = fn.node
        virtual_node = fn.virtual_node
        node_platform = fn.node_platform_set
        node_os = fn.node_os_set
        node_target = fn.node_target_set
        variant_value = fn.variant_set
        node_compiler = fn.node_compiler_set
        node_compiler_version = fn.node_compiler_version_set
        node_flag = fn.node_flag_set

    class Body(object):
        node = fn.node
        virtual_node = fn.virtual_node
        node_platform = fn.node_platform
        node_os = fn.node_os
        node_target = fn.node_target
        variant_value = fn.variant_value
        node_compiler = fn.node_compiler
        node_compiler_version = fn.node_compiler_version
        node_flag = fn.node_flag
    f = (Body if body else Head)
    if spec.name:
        clauses.append((f.node(spec.name) if (not spec.virtual) else f.virtual_node(spec.name)))
    clauses.extend(self.spec_versions(spec))
    arch = spec.architecture
    if arch:
        if arch.platform:
            clauses.append(f.node_platform(spec.name, arch.platform))
        if arch.os:
            clauses.append(f.node_os(spec.name, arch.os))
        if arch.target:
            clauses.extend(self.target_ranges(spec, f.node_target))
    for (vname, variant) in sorted(spec.variants.items()):
        values = variant.value
        if (not isinstance(values, (list, tuple))):
            values = [values]
        for value in values:
            if (value == '*'):
                continue
            if (not spec.concrete):
                reserved_names = spack.directives.reserved_names
                if ((not spec.virtual) and (vname not in reserved_names)):
                    try:
                        variant_def = spec.package.variants[vname]
                    except KeyError:
                        msg = 'variant "{0}" not found in package "{1}"'
                        raise RuntimeError(msg.format(vname, spec.name))
                    else:
                        variant_def.validate_or_raise(variant, spec.package)
            clauses.append(f.variant_value(spec.name, vname, value))
            self.variant_values_from_specs.add((spec.name, vname, value))
    if spec.compiler:
        clauses.append(f.node_compiler(spec.name, spec.compiler.name))
        if spec.compiler.concrete:
            clauses.append(f.node_compiler_version(spec.name, spec.compiler.name, spec.compiler.version))
        elif spec.compiler.versions:
            clauses.append(fn.node_compiler_version_satisfies(spec.name, spec.compiler.name, spec.compiler.versions))
            self.compiler_version_constraints.add((spec.name, spec.compiler))
    for (flag_type, flags) in spec.compiler_flags.items():
        for flag in flags:
            clauses.append(f.node_flag(spec.name, flag_type, flag))
    if spec.concrete:
        clauses.append(fn.concrete(spec.name))
    if transitive:
        for dep in spec.traverse(root=False):
            clauses.extend(self.spec_clauses(dep, body, transitive=False))
    return clauses
Return a list of clauses for a spec mandates are true.

Arguments:
    spec (spack.spec.Spec): the spec to analyze
    body (bool): if True, generate clauses to be used in rule bodies
        (final values) instead of rule heads (setters).
    transitive (bool): if False, don't generate clauses from
         dependencies (default True)
def spec_clauses(self, spec, body=False, transitive=True):
    "Return a list of clauses for a spec mandates are true.\n\n        Arguments:\n            spec (spack.spec.Spec): the spec to analyze\n            body (bool): if True, generate clauses to be used in rule bodies\n                (final values) instead of rule heads (setters).\n            transitive (bool): if False, don't generate clauses from\n                 dependencies (default True)\n        "
    clauses = []

    class Head(object):
        node = fn.node
        virtual_node = fn.virtual_node
        node_platform = fn.node_platform_set
        node_os = fn.node_os_set
        node_target = fn.node_target_set
        variant_value = fn.variant_set
        node_compiler = fn.node_compiler_set
        node_compiler_version = fn.node_compiler_version_set
        node_flag = fn.node_flag_set

    class Body(object):
        node = fn.node
        virtual_node = fn.virtual_node
        node_platform = fn.node_platform
        node_os = fn.node_os
        node_target = fn.node_target
        variant_value = fn.variant_value
        node_compiler = fn.node_compiler
        node_compiler_version = fn.node_compiler_version
        node_flag = fn.node_flag
    f = (Body if body else Head)
    if spec.name:
        clauses.append((f.node(spec.name) if (not spec.virtual) else f.virtual_node(spec.name)))
    clauses.extend(self.spec_versions(spec))
    arch = spec.architecture
    if arch:
        if arch.platform:
            clauses.append(f.node_platform(spec.name, arch.platform))
        if arch.os:
            clauses.append(f.node_os(spec.name, arch.os))
        if arch.target:
            clauses.extend(self.target_ranges(spec, f.node_target))
    for (vname, variant) in sorted(spec.variants.items()):
        values = variant.value
        if (not isinstance(values, (list, tuple))):
            values = [values]
        for value in values:
            if (value == '*'):
                continue
            if (not spec.concrete):
                reserved_names = spack.directives.reserved_names
                if ((not spec.virtual) and (vname not in reserved_names)):
                    try:
                        variant_def = spec.package.variants[vname]
                    except KeyError:
                        msg = 'variant "{0}" not found in package "{1}"'
                        raise RuntimeError(msg.format(vname, spec.name))
                    else:
                        variant_def.validate_or_raise(variant, spec.package)
            clauses.append(f.variant_value(spec.name, vname, value))
            self.variant_values_from_specs.add((spec.name, vname, value))
    if spec.compiler:
        clauses.append(f.node_compiler(spec.name, spec.compiler.name))
        if spec.compiler.concrete:
            clauses.append(f.node_compiler_version(spec.name, spec.compiler.name, spec.compiler.version))
        elif spec.compiler.versions:
            clauses.append(fn.node_compiler_version_satisfies(spec.name, spec.compiler.name, spec.compiler.versions))
            self.compiler_version_constraints.add((spec.name, spec.compiler))
    for (flag_type, flags) in spec.compiler_flags.items():
        for flag in flags:
            clauses.append(f.node_flag(spec.name, flag_type, flag))
    if spec.concrete:
        clauses.append(fn.concrete(spec.name))
    if transitive:
        for dep in spec.traverse(root=False):
            clauses.extend(self.spec_clauses(dep, body, transitive=False))
    return clauses