* to generate updated or new *.replies data files.
*
* If you manually edit replies files you can run
- * "tests/qemucapsfixreplies foo.replies" to fix the replies ids.
+ * VIR_TEST_REGENERATE_OUTPUT=1 tests/qemucapabilitiesnumbering
+ * to fix the replies ids.
*
* Once a replies file has been generated and tweaked if necessary,
* you can drop it into tests/qemucapabilitiesdata/ (with a sensible
* to generate updated or new *.replies data files.
*
* If you manually edit replies files you can run
- * "tests/qemucapsfixreplies foo.replies" to fix the replies ids.
+ * VIR_TEST_REGENERATE_OUTPUT=1 tests/qemucapabilitiesnumbering
+ * to fix the replies ids. The tool also allows for programatic modification
+ * of the replies file.
*
* Once a replies file has been generated and tweaked if necessary,
* you can drop it into tests/qemucapabilitiesdata/ (with a sensible
+++ /dev/null
-#!/bin/sh
-
-if [ "$#" -ne 1 ] || [ "$1" = "--help" ] || [ ! -f "$1" ]; then
- echo "This script fixes replies ids in QEMU replies files."
- echo ""
- echo " Usage: $0 path/to/qemu.replies"
- exit 0
-fi
-
-awk -i inplace \
- 'BEGIN {last=0; pattern="libvirt-[0-9]+"}
- {
- if (match($0, "libvirt-1[^0-9]")) {
- count=1;
- }
- if (match($0, pattern)) {
- str="libvirt-" count;
- sub(pattern, str, $0);
- if (last != count) {
- last=count;
- } else {
- count++;
- }
- }
- print
- }' "$1"