[libvirt PATCH 222/351] meson: src: add support for installing libvirt conf and augeas files

Peter Krempa pkrempa at redhat.com
Tue Jul 28 07:33:02 UTC 2020


On Tue, Jul 28, 2020 at 09:24:13 +0200, Pavel Hrdina wrote:
> On Mon, Jul 27, 2020 at 04:56:41PM +0200, Peter Krempa wrote:
> > On Thu, Jul 16, 2020 at 11:57:38 +0200, Pavel Hrdina wrote:
> > > Signed-off-by: Pavel Hrdina <phrdina at redhat.com>
> > > ---
> > >  src/Makefile.am        |   5 --
> > >  src/meson.build        | 103 +++++++++++++++++++++++++++++++++++++++++
> > >  src/remote/meson.build |  26 +++++++++++
> > >  3 files changed, 129 insertions(+), 5 deletions(-)
> > > 
> > > diff --git a/src/Makefile.am b/src/Makefile.am
> > > index 99bb71e6a03..471ebae2b79 100644
> > > --- a/src/Makefile.am
> > > +++ b/src/Makefile.am
> > > @@ -69,13 +69,8 @@ include storage/Makefile.inc.am
> > >  include remote/Makefile.inc.am
> > >  
> > >  
> > > -confdir = $(sysconfdir)/libvirt
> > >  conf_DATA += libvirt.conf
> > >  
> > > -augeasdir = $(datadir)/augeas/lenses
> > > -
> > > -augeastestdir = $(datadir)/augeas/lenses/tests
> > > -
> > >  # .libs/libvirt.so is built by libtool as a side-effect of the Makefile
> > >  # rule for libvirt.la.  However, checking symbols relies on Linux ELF layout
> > >  if WITH_LINUX
> > > diff --git a/src/meson.build b/src/meson.build
> > > index bb970f10c61..3a44cd9d663 100644
> > > --- a/src/meson.build
> > > +++ b/src/meson.build
> > > @@ -149,6 +149,32 @@ virt_daemons = []
> > >  #   * install_dir - installation directory (optional, libexecdir)
> > >  virt_helpers = []
> > >  
> > > +# virt_conf_files:
> > > +#   libvirt conf files
> > > +virt_conf_files = []
> > > +
> > > +# virt_aug_files:
> > > +#   libvirt aug files
> > > +virt_aug_files = []
> > > +
> > > +# virt_test_aug_files:
> > > +#   generate libvirt augeas test files
> > > +#   * name - augeas test file name (required)
> > > +#   * aug - augeas test file source (required)
> > > +#   * conf - conf file (required)
> > > +virt_test_aug_files = []
> > > +
> > > +# virt_daemon_confs:
> > > +#   generation libvirt daemon conf files
> > > +#   each entry is a dictionary with following items:
> > > +#   * name - daemon name (required)
> > > +#   * name_uc - daemon name with first letter uppercase (required)
> > 
> > I've seen that you called some magic inline python to calculate stuff
> > somewhere else.
> > 
> > Can't we do it here too?
> 
> Sure we can, I was just following what we have with autotools where we
> have both strings as well. I figured that calling
> 
> name_uc = run_command(python3_prog, '-c', 'print("{0}".capitalize())'.format(data['name'])).stdout().strip()
> 
> would a bit overkill for this.

I think it's _WAY_ better than having another entry in the dictionary
just for the name with uppercase first letter.

The autoconf thing was probably just because it wasn't possible to
automate.

> > > +#   * with_ip - only for libvirtd and virtproxyd (optional, default false)
> > > +virt_daemon_confs = []
> > > +
> > > +virt_aug_dir = datadir / 'augeas' / 'lenses'
> > > +virt_test_aug_dir = datadir / 'augeas' / 'lenses' / 'tests'
> > > +
> > >  
> > >  # list subdirectories
> > >  
> > > @@ -547,3 +573,80 @@ foreach helper : virt_helpers
> > >      install_rpath: libdir,
> > >    )
> > >  endforeach
> > > +
> > > +
> > > +# Generate daemon config, augeas and augeas test files
> > > +
> > > +install_data(virt_conf_files, install_dir: confdir)
> > > +install_data(virt_aug_files, install_dir: virt_aug_dir)
> > > +
> > > +foreach data : virt_test_aug_files
> > > +  custom_target(
> > > +    data['name'],
> > > +    input: [ data['conf'], data['aug'] ],
> > > +    output: data['name'],
> > > +    command: [ meson_python_prog, augeas_gentest_prog, '@INPUT@' ],
> > > +    capture: true,
> > > +    install: true,
> > 
> > Why do we install test files?
> 
> No idea :) but with autotools we install them as well. If we want to
> change it I would do it as followup patch once this is merged.

Fair enough. This can be kept as-is.




More information about the libvir-list mailing list