]> xenbits.xensource.com Git - people/iwj/osstest.git/commitdiff
Massage spaces in host proprties into underscores.
authorIan Campbell <ian.campbell@citrix.com>
Mon, 9 Sep 2013 09:09:41 +0000 (10:09 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Mon, 9 Sep 2013 09:13:47 +0000 (10:13 +0100)
'-' is intended to bind more tightly than ' '.

Osstest/TestSupport.pm

index 6a491e1f9e076e169a745f4cf4965c6eb80df6db..1a3d6ea276582569936cb109a81c61652b35f3a3 100644 (file)
@@ -746,16 +746,25 @@ sub selecthost ($) {
 
 sub propname_massage ($) {
     # property names used to be in the form word-word-word
-    # and are moving to WordWordWord
+    # and are moving to WordWordWord.
+    #
+    # Some property names are "some-words other-words". Massage them
+    # into "some-words_other-words" and then into
+    # "SomeWords_OtherWords".
+
     my ($prop) = @_;
+    my $before = $prop;
 
-    # some property names are "word word word". make it word-word-word
-    # before massaging into WordWordWord
-    $prop =~ s/ /-/g;
     $prop = ucfirst $prop;
+
+    while ($prop =~ m/ /) {
+       $prop = $`."_".ucfirst $'; #';
+    }
+
     while ($prop =~ m/-/) {
        $prop = $`.ucfirst $'; #';
     }
+
     return $prop;
 }