From: Daniel P. Berrange Date: Thu, 19 Jan 2012 14:19:42 +0000 (+0000) Subject: Fix rpc generator to anchor matches for method names X-Git-Tag: v0.9.10-rc1~158 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=91f79d27cc84fdc54961f5d1c6a07159701cb9b2;p=thirdparty%2Flibvirt.git Fix rpc generator to anchor matches for method names The RPC generator transforms methods matching certain patterns like 'id' or 'uuid', etc but does not anchor its matches to the end of the word. So if a method contains 'id' in the middle (eg virIdentity) then the RPC generator munges that. * src/rpc/gendispatch.pl: Anchor matches --- diff --git a/src/rpc/gendispatch.pl b/src/rpc/gendispatch.pl index b36ca69292..0460fca32e 100755 --- a/src/rpc/gendispatch.pl +++ b/src/rpc/gendispatch.pl @@ -34,10 +34,10 @@ sub name_to_ProcName { my $name = shift; my @elems = split /_/, $name; @elems = map ucfirst, @elems; - @elems = map { $_ =~ s/Nwfilter/NWFilter/; $_ =~ s/Xml/XML/; - $_ =~ s/Uri/URI/; $_ =~ s/Uuid/UUID/; $_ =~ s/Id/ID/; - $_ =~ s/Mac/MAC/; $_ =~ s/Cpu/CPU/; $_ =~ s/Os/OS/; - $_ =~ s/Nmi/NMI/; $_ } @elems; + @elems = map { $_ =~ s/Nwfilter/NWFilter/; $_ =~ s/Xml$/XML/; + $_ =~ s/Uri$/URI/; $_ =~ s/Uuid$/UUID/; $_ =~ s/Id$/ID/; + $_ =~ s/Mac$/MAC/; $_ =~ s/Cpu$/CPU/; $_ =~ s/Os$/OS/; + $_ =~ s/Nmi$/NMI/; $_ } @elems; join "", @elems }