Re: [PATCH] Replace @SYSCONFDIR@ with ::SYSCONFDIR:: to avoid syntax-check warning

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

 



On 06/22/2011 10:29 AM, Daniel P. Berrange wrote:
> make syntax-check complains if any Makefile.am uses the old
> style @FOO@ for replacement, rather than $(FOO).
> 
> Unfortunately the tools/Makefile.am intentionally uses the
> @FOO@ syntax for generating some scripts. Currently these
> are whitelisted in cfg.mk, but adding more to this whitelist
> makes the entire check rather worthless.
> 
> This changes the tools/ directory to use ::FOO:: as the
> replacement syntax for virt-pki-validate.in and
> virt-xml-validate.in
> 
> * tools/Makefile.am, tools/virt-pki-validate.in
>   tools/virt-xml-validate.in: Change @FOO@ to ::FOO::
> * cfg.mk: Remove _makefile_at_at_check_exceptions

Hmm, I'm thinking we should go for a v2.

The @FOO@ notation in virt-xml-validate.in is pretty idiomatic, so
instead of changing to ::FOO::, why don't we instead change
tools/Makefile.am to not fall foul of the syntax check rule in the first
place, with a well-placed regex bracket sequence?

Smaller patches are always nicer :)

diff --git i/cfg.mk w/cfg.mk
index 5d3ef26..c2230b8 100644
--- i/cfg.mk
+++ w/cfg.mk
@@ -581,9 +581,6 @@ _autogen:
 	$(srcdir)/autogen.sh
 	./config.status

-# Exempt @...@ uses of these symbols.
-_makefile_at_at_check_exceptions = ' && !/(SCHEMA|SYSCONF)DIR/'
-
 # regenerate HACKING as part of the syntax-check
 syntax-check: $(top_srcdir)/HACKING

diff --git i/tools/Makefile.am w/tools/Makefile.am
index 826674a..909c4b2 100644
--- i/tools/Makefile.am
+++ w/tools/Makefile.am
@@ -23,14 +23,14 @@ dist_man1_MANS = virt-xml-validate.1
virt-pki-validate.1 virsh.1


 virt-xml-validate: virt-xml-validate.in Makefile
-	$(AM_V_GEN)sed -e 's,@SCHEMADIR@,$(pkgdatadir)/schemas,' < $< > $@ \
+	$(AM_V_GEN)sed -e 's,[@]SCHEMADIR@,$(pkgdatadir)/schemas,' < $< > $@ \
 	    || (rm $@ && exit 1) && chmod +x $@

 virt-xml-validate.1: virt-xml-validate.in
 	$(AM_V_GEN)$(POD2MAN) $< $(srcdir)/$@

 virt-pki-validate: virt-pki-validate.in Makefile
-	$(AM_V_GEN)sed -e 's,@SYSCONFDIR@,$(sysconfdir),' < $< > $@ \
+	$(AM_V_GEN)sed -e 's,[@]SYSCONFDIR@,$(sysconfdir),' < $< > $@ \
 	    || (rm $@ && exit 1) && chmod +x $@

 virt-pki-validate.1: virt-pki-validate.in


-- 
Eric Blake   eblake@xxxxxxxxxx    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

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

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]