public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pbs-devel] [PATCH proxmox 1/2] section-config: make ReST dump reproducible
@ 2022-12-13 13:37 Fabian Grünbichler
  2022-12-13 13:37 ` [pbs-devel] [PATCH proxmox 2/2] section-config: silence clippy Fabian Grünbichler
  2022-12-13 13:53 ` [pbs-devel] applied-series: [PATCH proxmox 1/2] section-config: make ReST dump reproducible Wolfgang Bumiller
  0 siblings, 2 replies; 3+ messages in thread
From: Fabian Grünbichler @ 2022-12-13 13:37 UTC (permalink / raw)
  To: pbs-devel

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>
---
tested PBS build with the resulting proxmox-section-config crate, the -docs
package is now reproducible ;)

 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 1706718..51f6770 100644
--- a/proxmox-section-config/src/lib.rs
+++ b/proxmox-section-config/src/lib.rs
@@ -1110,10 +1110,13 @@ token: asdf@pbs!asdftoken
 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],
-- 
2.30.2





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-12-13 13:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-13 13:37 [pbs-devel] [PATCH proxmox 1/2] section-config: make ReST dump reproducible Fabian Grünbichler
2022-12-13 13:37 ` [pbs-devel] [PATCH proxmox 2/2] section-config: silence clippy Fabian Grünbichler
2022-12-13 13:53 ` [pbs-devel] applied-series: [PATCH proxmox 1/2] section-config: make ReST dump reproducible Wolfgang Bumiller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal