diff mbox

build: predictably generate systemtap tapsets (bz 1173641)

Message ID a6f1ba1b65e6bb57a6ca2df59aaab3434875829f.1453302381.git.crobinso@redhat.com
State Accepted
Commit a1edb05c6028470aa24b74aa0f8d5fb5a181128a
Headers show

Commit Message

Cole Robinson Jan. 20, 2016, 3:06 p.m. UTC
The generated output is dependent on perl hashtable ordering, which
gives different results for i686 and x86_64. Fix this by sorting
the hash keys before iterating over them

https://bugzilla.redhat.com/show_bug.cgi?id=1173641
---
 src/rpc/gensystemtap.pl | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

-- 
2.5.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list

Comments

Cole Robinson Jan. 20, 2016, 3:28 p.m. UTC | #1
On 01/20/2016 10:23 AM, Daniel P. Berrange wrote:
> On Wed, Jan 20, 2016 at 10:06:21AM -0500, Cole Robinson wrote:

>> The generated output is dependent on perl hashtable ordering, which

>> gives different results for i686 and x86_64. Fix this by sorting

>> the hash keys before iterating over them

>>

>> https://bugzilla.redhat.com/show_bug.cgi?id=1173641

>> ---

>>  src/rpc/gensystemtap.pl | 10 +++++-----

>>  1 file changed, 5 insertions(+), 5 deletions(-)

>>

>> diff --git a/src/rpc/gensystemtap.pl b/src/rpc/gensystemtap.pl

>> index 2467300..7b80fbf 100755

>> --- a/src/rpc/gensystemtap.pl

>> +++ b/src/rpc/gensystemtap.pl

>> @@ -72,7 +72,7 @@ function libvirt_rpc_auth_name(type, verbose)

>>  {

>>  EOF

>>  my $first = 1;

>> -foreach my $type (keys %auth) {

>> +foreach my $type (sort(keys %auth)) {

> 

> Nitpick, you don't really need the round brackets ie you can do

> 

>    sort keys %auth

> 

> 

> ACK

> 


Thanks, pushed now

- Cole

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
diff mbox

Patch

diff --git a/src/rpc/gensystemtap.pl b/src/rpc/gensystemtap.pl
index 2467300..7b80fbf 100755
--- a/src/rpc/gensystemtap.pl
+++ b/src/rpc/gensystemtap.pl
@@ -72,7 +72,7 @@  function libvirt_rpc_auth_name(type, verbose)
 {
 EOF
 my $first = 1;
-foreach my $type (keys %auth) {
+foreach my $type (sort(keys %auth)) {
     my $cond = $first ? "if" : "} else if";
     $first = 0;
     print "  $cond (type == ", $type, ") {\n";
@@ -95,7 +95,7 @@  function libvirt_rpc_type_name(type, verbose)
 {
 EOF
 $first = 1;
-foreach my $type (keys %type) {
+foreach my $type (sort(keys %type)) {
     my $cond = $first ? "if" : "} else if";
     $first = 0;
     print "  $cond (type == ", $type, ") {\n";
@@ -118,7 +118,7 @@  function libvirt_rpc_status_name(status, verbose)
 {
 EOF
 $first = 1;
-foreach my $status (keys %status) {
+foreach my $status (sort(keys %status)) {
     my $cond = $first ? "if" : "} else if";
     $first = 0;
     print "  $cond (status == ", $status, ") {\n";
@@ -141,7 +141,7 @@  function libvirt_rpc_program_name(program, verbose)
 {
 EOF
 $first = 1;
-foreach my $prog (keys %funcs) {
+foreach my $prog (sort(keys %funcs)) {
     my $cond = $first ? "if" : "} else if";
     $first = 0;
     print "  $cond (program == ", $funcs{$prog}->{id}, ") {\n";
@@ -165,7 +165,7 @@  function libvirt_rpc_procedure_name(program, version, proc, verbose)
 {
 EOF
 $first = 1;
-foreach my $prog (keys %funcs) {
+foreach my $prog (sort(keys %funcs)) {
     my $cond = $first ? "if" : "} else if";
     $first = 0;
     print "  $cond (program == ", $funcs{$prog}->{id}, " && version == ", $funcs{$prog}->{version}, ") {\n";