From 77ac0bd5fe4d67bc2cde8f3c72a2ab9c0fc1eea9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Tue, 13 Dec 2022 14:37:54 +0100 Subject: [PATCH] section-config: make ReST dump reproducible MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- proxmox-section-config/src/lib.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/proxmox-section-config/src/lib.rs b/proxmox-section-config/src/lib.rs index 3c09b5d4..2c67941a 100644 --- a/proxmox-section-config/src/lib.rs +++ b/proxmox-section-config/src/lib.rs @@ -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],