From a792bf240f45bdbb202ac0c13a7f2624a6bbcf06 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Wed, 31 Mar 2010 14:58:40 -0600 Subject: [PATCH] build: more fallout from test -a * 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. --- 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 45da56a513..2e7b68ac50 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='\ $@ || (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 6cadf8422c..21e311c0ed 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,,\n $UUID," \ diff --git a/tools/virt-pki-validate.in b/tools/virt-pki-validate.in index b3fc986dcf..72ed9e5539 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`'"' -- GitLab