section-config: make ReST dump reproducible

HashMaps are not ordered, so each package build containing a section config
dump would have the documentation ordered randomly.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
This commit is contained in:
Fabian Grünbichler 2022-12-13 14:37:54 +01:00 committed by Wolfgang Bumiller
parent cb2646c7b4
commit 77ac0bd5fe

View File

@ -1214,10 +1214,13 @@ sync: fail
pub fn dump_section_config(config: &SectionConfig) -> String {
let mut res = String::new();
let mut plugins: Vec<&String> = config.plugins().keys().collect();
plugins.sort_unstable();
let plugin_count = config.plugins().len();
for plugin in config.plugins().values() {
let name = plugin.type_name();
for name in plugins {
let plugin = config.plugins().get(name).unwrap();
let properties = plugin.properties();
let skip = match plugin.id_property() {
Some(id) => vec![id],