[libvirt] [PATCHv3] build: more fallout from test -a

Eric Blake eblake at redhat.com
Wed Mar 31 20:59:52 UTC 2010


* cfg.mk (sc_prohibit_test_minus_ao): Also check for [.
* docs/Makefile.am (%.html, html/index.html): Avoid non-portable
test usage.
* libvirt.spec.in (%post): Likewise.
* tools/virt-pki-validate.in (servercert.pem): Likewise.
* configure.ac (LOGNAME): Use test, not [, in files processed by
autoconf.
Detected by Matthias Bolte.
---

Version 3 is even better, right?  :)

 cfg.mk                     |    2 +-
 configure.ac               |    2 +-
 docs/Makefile.am           |    7 ++++---
 libvirt.spec.in            |    2 +-
 tools/virt-pki-validate.in |    2 +-
 5 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/cfg.mk b/cfg.mk
index 45da56a..2e7b68a 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -276,7 +276,7 @@ _m1 = use "test C1 && test C2", not "test C1 -''a C2"
 _m2 = use "test C1 || test C2", not "test C1 -''o C2"
 # Using test's -a and -o operators is not portable.
 sc_prohibit_test_minus_ao:
-	@re='\<test .+ -[ao] '						\
+	@re='(\<test| \[+) .+ -[ao] '					\
 	msg='$(_m1); $(_m2)'						\
 	  $(_prohibit_regexp)

diff --git a/configure.ac b/configure.ac
index 3c3d7b3..e13961e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -240,7 +240,7 @@ AC_ARG_WITH([libvirtd],
 dnl
 dnl specific tests to setup DV devel environments with debug etc ...
 dnl
-if [[ "${LOGNAME}" = "veillard" && test "`pwd`" = "/u/veillard/libvirt" ]] ; then
+if test "${LOGNAME}" = "veillard" && test "`pwd`" = "/u/veillard/libvirt" ; then
     STATIC_BINARIES="-static"
 else
     STATIC_BINARIES=
diff --git a/docs/Makefile.am b/docs/Makefile.am
index edf6fc8..a18821b 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -106,7 +106,7 @@ ChangeLog.html.in: ChangeLog.xml ChangeLog.xsl
 	  $(XSLTPROC) --stringparam pagename $$name --nonet --html $(top_srcdir)/docs/site.xsl $< > $@ || (rm $@ && exit 1) ; fi )

 %.html: %.html.tmp
-	@(if [ -x $(XMLLINT) -a -x $(XMLCATALOG) ] ; then \
+	@(if test -x $(XMLLINT) && test -x $(XMLCATALOG) ; then \
 	  if $(XMLCATALOG) /etc/xml/catalog "-//W3C//DTD XHTML 1.0 Strict//EN" > /dev/null ; then \
 	  echo "Validating $@" ; \
 	  $(XMLLINT) --nonet --format --valid $< > $@ || (rm $@ && exit 1) ; \
@@ -117,8 +117,9 @@ html/index.html: libvirt-api.xml newapi.xsl page.xsl sitemap.html.in
 	-@(if [ -x $(XSLTPROC) ] ; then \
 	  echo "Rebuilding the HTML pages from the XML API" ; \
 	  $(XSLTPROC) --nonet $(srcdir)/newapi.xsl libvirt-api.xml ; fi )
-	-@(if [ -x $(XMLLINT) -a -x $(XMLCATALOG) ] ; then \
-	  if $(XMLCATALOG) /etc/xml/catalog "-//W3C//DTD XHTML 1.0 Strict//EN" > /dev/null ; then \
+	-@(if test -x $(XMLLINT) && test -x $(XMLCATALOG) ; then \
+	  if $(XMLCATALOG) /etc/xml/catalog "-//W3C//DTD XHTML 1.0 Strict//EN" \
+	    > /dev/null ; then \
 	  echo "Validating the resulting XHTML pages" ; \
 	  $(XMLLINT) --nonet --valid --noout html/*.html ; \
 	  else echo "missing XHTML1 DTD" ; fi ; fi );
diff --git a/libvirt.spec.in b/libvirt.spec.in
index 6cadf84..21e311c 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -629,7 +629,7 @@ getent passwd qemu >/dev/null || \
 # or on the first upgrade from a non-network aware libvirt only.
 # We check this by looking to see if the daemon is already installed
 /sbin/chkconfig --list libvirtd 1>/dev/null 2>&1
-if [ $? != 0 -a ! -f %{_sysconfdir}/libvirt/qemu/networks/default.xml ]
+if test $? != 0 && test ! -f %{_sysconfdir}/libvirt/qemu/networks/default.xml
 then
     UUID=`/usr/bin/uuidgen`
     sed -e "s,</name>,</name>\n  <uuid>$UUID</uuid>," \
diff --git a/tools/virt-pki-validate.in b/tools/virt-pki-validate.in
index b3fc986..72ed9e5 100755
--- a/tools/virt-pki-validate.in
+++ b/tools/virt-pki-validate.in
@@ -203,7 +203,7 @@ then
 	    echo Server organization: $S_ORG
 	fi
 	S_HOST=`$CERTOOL -i --infile $LIBVIRT/servercert.pem | grep Subject: | sed 's+.*CN=\([a-zA-Z\. _-]*\)+\1+'`
-	if [ "$S_HOST" != "`hostname -s`" -a "$S_HOST" != "`hostname`" ]
+	if test "$S_HOST" != "`hostname -s`" && test "$S_HOST" != "`hostname`"
 	then
 	    echo The server certificate does not seem to match the host name
 	    echo hostname: '"'`hostname`'"'
-- 
1.6.6.1




More information about the libvir-list mailing list