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(a)redhat.com>
--
Andrea Bolognani / Red Hat / Virtualization