| 1238 | the specified values in attribute `_Config.conf_min_features`. |
| 1239 | """ |
| 1240 | def __init__(self): |
| 1241 | if hasattr(self, "feature_is_cached"): |
| 1242 | return |
| 1243 | self.feature_supported = pfeatures = self.conf_features_partial() |
| 1244 | for feature_name in list(pfeatures.keys()): |
| 1245 | feature = pfeatures[feature_name] |
| 1246 | cfeature = self.conf_features[feature_name] |
| 1247 | feature.update({ |
| 1248 | k:v for k,v in cfeature.items() if k not in feature |
| 1249 | }) |
| 1250 | disabled = feature.get("disable") |
| 1251 | if disabled is not None: |
| 1252 | pfeatures.pop(feature_name) |
| 1253 | self.dist_log( |
| 1254 | "feature '%s' is disabled," % feature_name, |
| 1255 | disabled, stderr=True |
| 1256 | ) |
| 1257 | continue |
| 1258 | # list is used internally for these options |
| 1259 | for option in ( |
| 1260 | "implies", "group", "detect", "headers", "flags", "extra_checks" |
| 1261 | ) : |
| 1262 | oval = feature.get(option) |
| 1263 | if isinstance(oval, str): |
| 1264 | feature[option] = oval.split() |
| 1265 | |
| 1266 | self.feature_min = set() |
| 1267 | min_f = self.conf_min_features.get(self.cc_march, "") |
| 1268 | for F in min_f.upper().split(): |
| 1269 | if F in self.feature_supported: |
| 1270 | self.feature_min.add(F) |
| 1271 | |
| 1272 | self.feature_is_cached = True |
| 1273 | |
| 1274 | def feature_names(self, names=None, force_flags=None, macros=[]): |
| 1275 | """ |