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: $!";
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;
}
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: $!";
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 \
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 \
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 \
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
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
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 \
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 \
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 \