[libvirt] [PATCH v1] rpc: reproducible genprotocol output

Olaf Hering olaf at aepfle.de
Wed Oct 10 09:15:37 UTC 2018


If the same source gets built twice ('build same source on different
hosts at different times') the resulting files may differ.
Fix this by sorting the hash keys before usage.

Signed-off-by: Olaf Hering <olaf at aepfle.de>
---
 src/rpc/genprotocol.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/rpc/genprotocol.pl b/src/rpc/genprotocol.pl
index 6ce268c024..6baa4f22d5 100755
--- a/src/rpc/genprotocol.pl
+++ b/src/rpc/genprotocol.pl
@@ -104,7 +104,7 @@ while (<RPCGEN>) {
         if (keys %uses >= 1) {
             my $i = 1;
 
-            foreach (keys %uses) {
+            foreach (sort(keys %uses)) {
                 $i = $uses{$_};
                 unshift @function,
                 ("        char **objp_cpp$i = (char **) (void *) &$_;\n");




More information about the libvir-list mailing list