From: "Fabian Grünbichler" <f.gruenbichler@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox 1/2] section-config: make ReST dump reproducible
Date: Tue, 13 Dec 2022 14:37:54 +0100 [thread overview]
Message-ID: <20221213133755.751536-1-f.gruenbichler@proxmox.com> (raw)
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
next reply other threads:[~2022-12-13 13:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-13 13:37 Fabian Grünbichler [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221213133755.751536-1-f.gruenbichler@proxmox.com \
--to=f.gruenbichler@proxmox.com \
--cc=pbs-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox