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

Eric Blake eblake at redhat.com
Wed Jun 22 16:36:19 UTC 2011


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, at 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, at 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 at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110622/41e017d4/attachment-0001.sig>


More information about the libvir-list mailing list