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.
This commit is contained in:
Eric Blake 2010-03-31 14:58:40 -06:00
parent eff24046d8
commit a792bf240f
5 changed files with 8 additions and 7 deletions

2
cfg.mk
View File

@ -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" _m2 = use "test C1 || test C2", not "test C1 -''o C2"
# Using test's -a and -o operators is not portable. # Using test's -a and -o operators is not portable.
sc_prohibit_test_minus_ao: sc_prohibit_test_minus_ao:
@re='\<test .+ -[ao] ' \ @re='(\<test| \[+) .+ -[ao] ' \
msg='$(_m1); $(_m2)' \ msg='$(_m1); $(_m2)' \
$(_prohibit_regexp) $(_prohibit_regexp)

View File

@ -240,7 +240,7 @@ AC_ARG_WITH([libvirtd],
dnl dnl
dnl specific tests to setup DV devel environments with debug etc ... dnl specific tests to setup DV devel environments with debug etc ...
dnl dnl
if [[ "${LOGNAME}" = "veillard" && test "`pwd`" = "/u/veillard/libvirt" ]] ; then if test "${LOGNAME}" = "veillard" && test "`pwd`" = "/u/veillard/libvirt" ; then
STATIC_BINARIES="-static" STATIC_BINARIES="-static"
else else
STATIC_BINARIES= STATIC_BINARIES=

View File

@ -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 ) $(XSLTPROC) --stringparam pagename $$name --nonet --html $(top_srcdir)/docs/site.xsl $< > $@ || (rm $@ && exit 1) ; fi )
%.html: %.html.tmp %.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 \ if $(XMLCATALOG) /etc/xml/catalog "-//W3C//DTD XHTML 1.0 Strict//EN" > /dev/null ; then \
echo "Validating $@" ; \ echo "Validating $@" ; \
$(XMLLINT) --nonet --format --valid $< > $@ || (rm $@ && exit 1) ; \ $(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 \ -@(if [ -x $(XSLTPROC) ] ; then \
echo "Rebuilding the HTML pages from the XML API" ; \ echo "Rebuilding the HTML pages from the XML API" ; \
$(XSLTPROC) --nonet $(srcdir)/newapi.xsl libvirt-api.xml ; fi ) $(XSLTPROC) --nonet $(srcdir)/newapi.xsl libvirt-api.xml ; fi )
-@(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 \ if $(XMLCATALOG) /etc/xml/catalog "-//W3C//DTD XHTML 1.0 Strict//EN" \
> /dev/null ; then \
echo "Validating the resulting XHTML pages" ; \ echo "Validating the resulting XHTML pages" ; \
$(XMLLINT) --nonet --valid --noout html/*.html ; \ $(XMLLINT) --nonet --valid --noout html/*.html ; \
else echo "missing XHTML1 DTD" ; fi ; fi ); else echo "missing XHTML1 DTD" ; fi ; fi );

View File

@ -629,7 +629,7 @@ getent passwd qemu >/dev/null || \
# or on the first upgrade from a non-network aware libvirt only. # 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 # We check this by looking to see if the daemon is already installed
/sbin/chkconfig --list libvirtd 1>/dev/null 2>&1 /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 then
UUID=`/usr/bin/uuidgen` UUID=`/usr/bin/uuidgen`
sed -e "s,</name>,</name>\n <uuid>$UUID</uuid>," \ sed -e "s,</name>,</name>\n <uuid>$UUID</uuid>," \

View File

@ -203,7 +203,7 @@ then
echo Server organization: $S_ORG echo Server organization: $S_ORG
fi fi
S_HOST=`$CERTOOL -i --infile $LIBVIRT/servercert.pem | grep Subject: | sed 's+.*CN=\([a-zA-Z\. _-]*\)+\1+'` 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 then
echo The server certificate does not seem to match the host name echo The server certificate does not seem to match the host name
echo hostname: '"'`hostname`'"' echo hostname: '"'`hostname`'"'