rpc: reproducible genprotocol output

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>
This commit is contained in:
Olaf Hering 2018-10-10 11:15:37 +02:00 committed by Michal Privoznik
parent 86a6cb13e9
commit 297ed93ae0

View File

@ -104,7 +104,7 @@ while (<RPCGEN>) {
if (keys %uses >= 1) { if (keys %uses >= 1) {
my $i = 1; my $i = 1;
foreach (keys %uses) { foreach (sort(keys %uses)) {
$i = $uses{$_}; $i = $uses{$_};
unshift @function, unshift @function,
(" char **objp_cpp$i = (char **) (void *) &$_;\n"); (" char **objp_cpp$i = (char **) (void *) &$_;\n");