[libvirt] [PATCH 15/41] remote: reduce duplication in systemd unit file make rules into one

Andrea Bolognani abologna at redhat.com
Fri Jul 26 15:59:22 UTC 2019


On Tue, 2019-07-23 at 17:02 +0100, Daniel P. Berrangé wrote:
[...]
> +COMMON_UNIT_VARS = \
> +	-e 's|[@]localstatedir[@]|$(localstatedir)|g' \
> +	-e 's|[@]sbindir[@]|$(sbindir)|g' \
> +	-e 's|[@]sysconfdir[@]|$(sysconfdir)|g' \
> +	$(NULL)
>  
> +LIBVIRTD_UNIT_VARS = \
> +	$(COMMON_UNIT_VARS) \
> +	$(NULL)
>  
> +libvirtd.service: remote/libvirtd.service.in $(top_builddir)/config.status
> +	$(AM_V_GEN)sed $(LIBVIRTD_UNIT_VARS) < $< > $@-t && mv $@-t $@
>  
> +libvirt%.socket: remote/libvirt%.socket.in $(top_builddir)/config.status
> +	$(AM_V_GEN)sed $(LIBVIRTD_UNIT_VARS) < $< > $@-t && mv $@-t $@

This is a fantastic refactoring that I've been thinking about
spending time on for a long time, so thanks a lot for doing it!

It's a bummer that we don't go further in our DRY crusade and extend
it to .service files (even after the entire series has been applied),
but we can always do that as a follow-up series :)

  Reviewed-by: Andrea Bolognani <abologna at redhat.com>

-- 
Andrea Bolognani / Red Hat / Virtualization




More information about the libvir-list mailing list