]> xenbits.xensource.com Git - osstest.git/commitdiff
ts-debian-fixup: merge origin extra= to our own if necessary
authorWei Liu <wei.liu2@citrix.com>
Tue, 17 Oct 2017 16:10:10 +0000 (17:10 +0100)
committerIan Jackson <ian.jackson@eu.citrix.com>
Wed, 10 Apr 2019 14:03:43 +0000 (15:03 +0100)
The original extra= was not removed, so there were two extra= in the
resulting config file.

It wasn't a problem for xl because the second extra= took precedence.
However libvirt tests would only pick up the first extra= so they
worked by chance.

Fix this issue by merging the original. If there isn't already extra=
in $cfg, use our own.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
v3: handle situation when no extra= is in $cfg

ts-debian-fixup

index 3e5cdb97af891a8350f72015b216645a7b4a266b..478dc2afca83a69b108405fc1465c0efcd7d7e8a 100755 (executable)
@@ -178,7 +178,11 @@ sub otherfixupcfg () {
         $extra .= " iommu=soft";
     }
 
-    $cfg .= "\nextra='$extra'\n";
+    if ($cfg =~ m/extra\s*=\s*['"](.*)['"]/) {
+       $cfg =~ s/extra\s*=\s*['"](.*)['"]/extra = '$1 $extra'/;
+    } else {
+       $cfg .= "extra = '$extra'\n";
+    }
 };
 
 sub writecfg () {