]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
rpc: reproducible genprotocol output
authorOlaf Hering <olaf@aepfle.de>
Wed, 10 Oct 2018 09:15:37 +0000 (11:15 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Fri, 12 Oct 2018 12:44:43 +0000 (14:44 +0200)
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@aepfle.de>
src/rpc/genprotocol.pl

index 6ce268c0241586da91a390662f497906e77e259b..6baa4f22d549c7f0520ea523c5c2e7ee7ac70c00 100755 (executable)
@@ -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");