]> xenbits.xensource.com Git - libvirt.git/commitdiff
build: make augeas-gentest.pl write to stdout
authorDaniel P. Berrangé <berrange@redhat.com>
Wed, 17 Jul 2019 10:39:32 +0000 (11:39 +0100)
committerDaniel P. Berrangé <berrange@redhat.com>
Fri, 9 Aug 2019 13:05:06 +0000 (14:05 +0100)
The augeas-gentest.pl program merges a config file into a augeas
file, saving the output to a new file. It is going to be useful
to further process the output file, and it would be easier if this can
be done with a pipeline, so change augeas-gentest.pl to write to stdout
instead of a file.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
build-aux/augeas-gentest.pl
src/bhyve/Makefile.inc.am
src/libxl/Makefile.inc.am
src/locking/Makefile.inc.am
src/logging/Makefile.inc.am
src/lxc/Makefile.inc.am
src/qemu/Makefile.inc.am
src/remote/Makefile.inc.am

index 567fc651f3c82bc04e2c0b536a2802db031126f9..faf2fd593eb0a8e4de0b40e3c77425a572b36c5d 100755 (executable)
 use strict;
 use warnings;
 
-die "syntax: $0 CONFIG TEMPLATE AUGTEST\n" unless @ARGV == 3;
+die "syntax: $0 CONFIG TEMPLATE\n" unless @ARGV == 2;
 
 my $config = shift @ARGV;
 my $template = shift @ARGV;
-my $augtest = shift @ARGV;
-
-open AUGTEST, ">", $augtest or die "cannot create $augtest: $!";
-
-$SIG{__DIE__} = sub {
-    unlink $augtest;
-};
 
 open CONFIG, "<", $config or die "cannot read $config: $!";
 open TEMPLATE, "<", $template or die "cannot read $template: $!";
@@ -39,12 +32,12 @@ my $group = 0;
 while (<TEMPLATE>) {
     if (/::CONFIG::/) {
         my $group = 0;
-        print AUGTEST "  let conf = \"";
+        print "  let conf = \"";
         while (<CONFIG>) {
             if (/^#\w/) {
                 s/^#//;
                 s/\"/\\\"/g;
-                print AUGTEST $_;
+                print $_;
                 $group = /\[\s$/;
             } elsif ($group) {
                 s/\"/\\\"/g;
@@ -53,16 +46,15 @@ while (<TEMPLATE>) {
                 }
                 if (/^#/) {
                     s/^#//;
-                    print AUGTEST $_;
+                    print $_;
                 }
             }
         }
-        print AUGTEST "\"\n";
+        print "\"\n";
     } else {
-        print AUGTEST $_;
+        print $_;
     }
 }
 
 close TEMPLATE;
 close CONFIG;
-close AUGTEST or die "cannot save $augtest: $!";
index 36af5d75048597510fda98d17697af08575c485b..6e8e6ad5d8cd37160c9affbac672cda2accb3b5f 100644 (file)
@@ -55,7 +55,7 @@ AUGEAS_DIRS += bhyve
 
 test_libvirtd_bhyve.aug: bhyve/test_libvirtd_bhyve.aug.in \
                $(srcdir)/bhyve/bhyve.conf $(AUG_GENTEST)
-       $(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/bhyve/bhyve.conf $< $@
+       $(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/bhyve/bhyve.conf $< $@
 
 check-augeas-bhyve: test_libvirtd_bhyve.aug
        $(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
index 7f60b449d8520cc44de342b54435dd16b6dd0cd0..abc65ede2cf7a5a6d60200e3cb2c7ac37bc5e1cf 100644 (file)
@@ -74,7 +74,7 @@ AUGEAS_DIRS += libxl
 
 test_libvirtd_libxl.aug: libxl/test_libvirtd_libxl.aug.in \
                $(srcdir)/libxl/libxl.conf $(AUG_GENTEST)
-       $(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/libxl/libxl.conf $< $@
+       $(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/libxl/libxl.conf $< $@
 
 check-augeas-libxl: test_libvirtd_libxl.aug
        $(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
index 46ab11c2a9bb15121b6567fb27ce81506ed88e26..c44f74a529c7e4d5de45208a4579327c205e21b2 100644 (file)
@@ -228,7 +228,7 @@ if WITH_SANLOCK
 if WITH_QEMU
 test_libvirt_sanlock.aug: locking/test_libvirt_sanlock.aug.in \
                locking/qemu-sanlock.conf $(AUG_GENTEST)
-       $(AM_V_GEN)$(AUG_GENTEST) locking/qemu-sanlock.conf $< $@
+       $(AM_V_GEN)$(AUG_GENTEST) locking/qemu-sanlock.conf $< $@
 
 check-augeas-sanlock: test_libvirt_sanlock.aug
        $(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
@@ -244,14 +244,14 @@ endif ! WITH_SANLOCK
 if WITH_QEMU
 test_libvirt_lockd.aug: locking/test_libvirt_lockd.aug.in \
                locking/qemu-lockd.conf $(AUG_GENTEST)
-       $(AM_V_GEN)$(AUG_GENTEST) locking/qemu-lockd.conf $< $@
+       $(AM_V_GEN)$(AUG_GENTEST) locking/qemu-lockd.conf $< $@
 else ! WITH_QEMU
 test_libvirt_lockd.aug:
 endif ! WITH_QEMU
 
 test_virtlockd.aug: locking/test_virtlockd.aug.in \
                locking/virtlockd.conf $(AUG_GENTEST)
-       $(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/locking/virtlockd.conf $< $@
+       $(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/locking/virtlockd.conf $< $@
 
 if WITH_QEMU
 check-augeas-lockd: test_libvirt_lockd.aug
index d57394cbdebd902984d946635e39c04fcf703a1a..8527890eb06e0b3a79d95de834093e3ef42660f8 100644 (file)
@@ -101,7 +101,7 @@ augeastest_DATA += test_virtlogd.aug
 
 test_virtlogd.aug: logging/test_virtlogd.aug.in \
                logging/virtlogd.conf $(AUG_GENTEST)
-       $(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/logging/virtlogd.conf $< $@
+       $(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/logging/virtlogd.conf $< $@
 
 AUGEAS_DIRS += logging
 
index f27827c1e9f7d370c98426e6d3fdb98a6a24959d..1c0b715a2f923faf7916ff9ec5fbd4bc118beb1e 100644 (file)
@@ -163,7 +163,7 @@ AUGEAS_DIRS += lxc
 
 test_libvirtd_lxc.aug: lxc/test_libvirtd_lxc.aug.in \
                $(srcdir)/lxc/lxc.conf $(AUG_GENTEST)
-       $(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/lxc/lxc.conf $< $@
+       $(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/lxc/lxc.conf $< $@
 
 check-augeas-lxc: test_libvirtd_lxc.aug
        $(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
index 254ba07dc0766ddbb2ea89916ab1e53fc75b1b54..e8c7d4b5b14e8874f3d29990bc4ff5d116f48d51 100644 (file)
@@ -122,7 +122,7 @@ AUGEAS_DIRS += qemu
 
 test_libvirtd_qemu.aug: qemu/test_libvirtd_qemu.aug.in \
                $(srcdir)/qemu/qemu.conf $(AUG_GENTEST)
-       $(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/qemu/qemu.conf $< $@
+       $(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/qemu/qemu.conf $< $@
 
 check-augeas-qemu: test_libvirtd_qemu.aug
        $(AM_V_GEN)if test -x '$(AUGPARSE)'; then \
index 0cf00cb9020b428f668f793f30cf77f7929bb70b..4f706f9743a63286a3419708cb8594a0fbb0f7c2 100644 (file)
@@ -190,7 +190,7 @@ AUGEAS_DIRS += remote
 
 test_libvirtd.aug: remote/test_libvirtd.aug.in \
                remote/libvirtd.conf $(AUG_GENTEST)
-       $(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/remote/libvirtd.conf $< $@
+       $(AM_V_GEN)$(AUG_GENTEST) $(srcdir)/remote/libvirtd.conf $< $@
 
 check-augeas-remote: test_libvirtd.aug
        $(AM_V_GEN)if test -x '$(AUGPARSE)'; then \