]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tests: Fix qemucapsfixreplies
authorAndrea Bolognani <abologna@redhat.com>
Tue, 19 Jun 2018 11:51:00 +0000 (13:51 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Tue, 19 Jun 2018 12:01:14 +0000 (14:01 +0200)
Since e6be524508d5 we include the executed command along
with the reply in *.replies files, which breaks the
renumbering logic implemented in qemucapsfixreplies.

Adapt the script so that it works with the new format.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
tests/qemucapsfixreplies

index 4e3371a1f750e95fa287a2999930d3a60e32f967..597f9ecd6e46ace658893130e7582cc851a5dcea 100755 (executable)
@@ -8,7 +8,7 @@ if [ "$#" -ne 1 ] || [ "$1" = "--help" ] || [ ! -f "$1" ]; then
 fi
 
 awk -i inplace \
-    'BEGIN {count=1; pattern="libvirt-[0-9]+"}
+    'BEGIN {last=0; pattern="libvirt-[0-9]+"}
     {
         if (match($0, "libvirt-1[^0-9]")) {
             count=1;
@@ -16,7 +16,11 @@ awk -i inplace \
         if (match($0, pattern)) {
             str="libvirt-" count;
             sub(pattern, str, $0);
-            count++;
+            if (last != count) {
+                last=count;
+            } else {
+                count++;
+            }
         }
         print
     }' "$1"