[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH 5/7] src: Simplify installing/uninstalling data



On Wed, Jan 09, 2019 at 07:35:52PM +0100, Andrea Bolognani wrote:
> Instead of defining targets conditionally and depending on
> them unconditionally, define a couple of variables and
> conditionally add targets to them.
>
> In addition to removing a bunch of useless code, this has
> the nice effect of no longer requiring the main Makefile.am
> to have any knowledge about the contents of the various
> snippets it includes.
>
> Signed-off-by: Andrea Bolognani <abologna redhat com>
> ---
>  src/Makefile.am            | 54 ++++++++++++++++----------------------
>  src/remote/Makefile.inc.am | 30 +++++++++------------
>  2 files changed, 34 insertions(+), 50 deletions(-)
>
> diff --git a/src/Makefile.am b/src/Makefile.am
> index d3e8a1b572..ce1a810a0f 100644
> --- a/src/Makefile.am
> +++ b/src/Makefile.am
> @@ -72,6 +72,8 @@ STATEFUL_DRIVER_SOURCE_FILES =
>  noinst_LTLIBRARIES =
>  mod_LTLIBRARIES =
>  INSTALL_DATA_DIRS =
> +INSTALL_DATA_LOCAL =
> +UNINSTALL_LOCAL =
>  libvirt_la_BUILT_LIBADD =
>  SYM_FILES =
>  USED_SYM_FILES =
> @@ -805,10 +807,10 @@ install-logrotate: $(LOGROTATE_FILES)
>  uninstall-logrotate:
>  	rm -f $(LOGROTATE_FILES:%.logrotate=$(DESTDIR)$(sysconfdir)/logrotate.d/%)
>  	rmdir $(DESTDIR)$(sysconfdir)/logrotate.d || :
> -else ! WITH_LIBVIRTD
> -install-logrotate:
> -uninstall-logrotate:
> -endif ! WITH_LIBVIRTD
> +
> +INSTALL_DATA_LOCAL += install-logrotate
> +UNINSTALL_LOCAL += uninstall-logrotate
> +endif WITH_LIBVIRTD
>
>  if LIBVIRT_INIT_SCRIPT_RED_HAT
>  install-init:: $(SYSVINIT_FILES) install-sysconfig
> @@ -824,10 +826,10 @@ uninstall-init:: uninstall-sysconfig
>
>  BUILT_SOURCES += $(SYSVINIT_FILES)
>  DISTCLEANFILES += $(SYSVINIT_FILES)
> -else ! LIBVIRT_INIT_SCRIPT_RED_HAT
> -install-init::
> -uninstall-init::
> -endif ! LIBVIRT_INIT_SCRIPT_RED_HAT
> +
> +INSTALL_DATA_LOCAL += install-init
> +UNINSTALL_LOCAL += uninstall-init
> +endif LIBVIRT_INIT_SCRIPT_RED_HAT
>
>
>  %.8: %.8.in $(top_srcdir)/configure.ac
> @@ -847,7 +849,6 @@ EXTRA_DIST += \
>          $(NULL)
>
>
> -if WITH_LIBVIRTD

Can we really do ^this?

[...]
>
> -if WITH_LIBVIRTD

Similarly here...

[..]

>
> -else ! WITH_POLKIT
> -install-polkit::
> -uninstall-polkit::
> -endif ! WITH_POLKIT
> +INSTALL_DATA_LOCAL += install-polkit
> +UNINSTALL_LOCAL += uninstall-polkit
> +endif WITH_POLKIT
>
> -else ! WITH_LIBVIRTD

And here I'm also not sure.

No comments to the rest.
Erik


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]