[libvirt] [PATCH 03/10] src: simplify sysconfig file handling in make rules

Daniel P. Berrangé posted 10 patches 7 years, 2 months ago
[libvirt] [PATCH 03/10] src: simplify sysconfig file handling in make rules
Posted by Daniel P. Berrangé 7 years, 2 months ago
Remove lots of duplication in the sysconfig file handling, so we can
add more conf files without modifying so many places.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 src/Makefile.am | 25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index de2441dd6b..bb51be50d7 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -2683,23 +2683,30 @@ EXTRA_DIST += $(LOCK_DAEMON_SOURCES) \
 	      $(LOG_DAEMON_SOURCES)
 endif ! WITH_LIBVIRTD
 
-EXTRA_DIST += \
+SYSCONF_FILES = \
 	locking/virtlockd.sysconf \
+	logging/virtlogd.sysconf \
+	$(NULL)
+
+EXTRA_DIST += \
 	locking/lockd.conf \
 	locking/libvirt_lockd.aug \
-	locking/test_libvirt_lockd.aug.in \
-	logging/virtlogd.sysconf
+	locking/test_libvirt_lockd.aug.in
 
 install-sysconfig:
 	$(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig
-	$(INSTALL_DATA) $(srcdir)/locking/virtlockd.sysconf \
-	  $(DESTDIR)$(sysconfdir)/sysconfig/virtlockd
-	$(INSTALL_DATA) $(srcdir)/logging/virtlogd.sysconf \
-	  $(DESTDIR)$(sysconfdir)/sysconfig/virtlogd
+	for f in $(SYSCONF_FILES:%.sysconf=%) ; \
+	do \
+	  tgt=`basename $$f`; \
+	  $(INSTALL_SCRIPT) $$f.sysconf $(DESTDIR)$(sysconfdir)/sysconfig/$$tgt; \
+	done
 
 uninstall-sysconfig:
-	rm -f $(DESTDIR)$(sysconfdir)/sysconfig/virtlogd
-	rm -f $(DESTDIR)$(sysconfdir)/sysconfig/virtlockd
+	for f in $(SYSCONF_FILES:%.sysconf=%) ; \
+	do \
+	  tgt=`basename $$f`; \
+	  rm -f $(DESTDIR)$(sysconfdir)/sysconfig/$$tgt; \
+	done
 	rmdir $(DESTDIR)$(sysconfdir)/sysconfig || :
 
 SYSVINIT_FILES_IN = \
-- 
2.14.3

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 03/10] src: simplify sysconfig file handling in make rules
Posted by Michal Privoznik 7 years, 2 months ago
On 02/21/2018 04:35 PM, Daniel P. Berrangé wrote:
> Remove lots of duplication in the sysconfig file handling, so we can
> add more conf files without modifying so many places.
> 
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>  src/Makefile.am | 25 ++++++++++++++++---------
>  1 file changed, 16 insertions(+), 9 deletions(-)
> 
> diff --git a/src/Makefile.am b/src/Makefile.am
> index de2441dd6b..bb51be50d7 100644
> --- a/src/Makefile.am
> +++ b/src/Makefile.am
> @@ -2683,23 +2683,30 @@ EXTRA_DIST += $(LOCK_DAEMON_SOURCES) \
>  	      $(LOG_DAEMON_SOURCES)
>  endif ! WITH_LIBVIRTD
>  
> -EXTRA_DIST += \
> +SYSCONF_FILES = \
>  	locking/virtlockd.sysconf \
> +	logging/virtlogd.sysconf \
> +	$(NULL)
> +
> +EXTRA_DIST += \
>  	locking/lockd.conf \
>  	locking/libvirt_lockd.aug \
> -	locking/test_libvirt_lockd.aug.in \
> -	logging/virtlogd.sysconf
> +	locking/test_libvirt_lockd.aug.in

I guess you wanted to add $(SYSCONF_FILES) to EXTRA_DIST too.

Michal

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 03/10] src: simplify sysconfig file handling in make rules
Posted by Daniel P. Berrangé 7 years, 2 months ago
On Thu, Feb 22, 2018 at 11:24:39AM +0100, Michal Privoznik wrote:
> On 02/21/2018 04:35 PM, Daniel P. Berrangé wrote:
> > Remove lots of duplication in the sysconfig file handling, so we can
> > add more conf files without modifying so many places.
> > 
> > Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> > ---
> >  src/Makefile.am | 25 ++++++++++++++++---------
> >  1 file changed, 16 insertions(+), 9 deletions(-)
> > 
> > diff --git a/src/Makefile.am b/src/Makefile.am
> > index de2441dd6b..bb51be50d7 100644
> > --- a/src/Makefile.am
> > +++ b/src/Makefile.am
> > @@ -2683,23 +2683,30 @@ EXTRA_DIST += $(LOCK_DAEMON_SOURCES) \
> >  	      $(LOG_DAEMON_SOURCES)
> >  endif ! WITH_LIBVIRTD
> >  
> > -EXTRA_DIST += \
> > +SYSCONF_FILES = \
> >  	locking/virtlockd.sysconf \
> > +	logging/virtlogd.sysconf \
> > +	$(NULL)
> > +
> > +EXTRA_DIST += \
> >  	locking/lockd.conf \
> >  	locking/libvirt_lockd.aug \
> > -	locking/test_libvirt_lockd.aug.in \
> > -	logging/virtlogd.sysconf
> > +	locking/test_libvirt_lockd.aug.in
> 
> I guess you wanted to add $(SYSCONF_FILES) to EXTRA_DIST too.

Opps, yes.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list