]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
maint: enforce whitespace on shell scripts
authorEric Blake <eblake@redhat.com>
Wed, 21 Apr 2010 23:21:06 +0000 (17:21 -0600)
committerEric Blake <eblake@redhat.com>
Thu, 22 Apr 2010 15:06:30 +0000 (09:06 -0600)
Noticed because virt-pki-validate was very inconsistent on
using tabs vs. 8 spaces, sometimes mixing both paradigms on
a single line.

'git diff -b' shows significant changes only in cfg.mk.

* cfg.mk (sc_TAB_in_indentation): Add a few files.
* daemon/libvirtd.init.in: Avoid tabs.
* tools/virt-pki-validate.in: Likewise.

cfg.mk
daemon/libvirtd.init.in
tools/virt-pki-validate.in

diff --git a/cfg.mk b/cfg.mk
index 790d3570c341683eda594464bdfcc99018da9291..105b625517c113483c668691e029244d8f484829 100644 (file)
--- a/cfg.mk
+++ b/cfg.mk
@@ -139,8 +139,8 @@ sc_prohibit_ctype_h:
 # files in gnulib, since they're imported.
 sc_TAB_in_indentation:
        @prohibit='^ *  '                                               \
-       in_vc_files='\.(rng|[ch](\.in)?)$$'                             \
-       halt='use spaces, not TAB, for indentation in C sources and RNG schemas' \
+       in_vc_files='(\.(rng|[ch](\.in)?)|(daemon|tools)/.*\.in)$$'     \
+       halt='use spaces, not TAB, for indentation in C, sh, and RNG schemas' \
         $(_sc_search_regexp)
 
 ctype_re = isalnum|isalpha|isascii|isblank|iscntrl|isdigit|isgraph|islower\
index 4c8821b2cedaf2de3f063f531b9c961f5b79fc35..d4dc98b1bb875c0e9041d57f417b83b18ae8a868 100644 (file)
@@ -72,7 +72,7 @@ stop() {
     if [ $RETVAL -eq 0 ]; then
         rm -f @localstatedir@/lock/subsys/$SERVICE
         rm -f $PIDFILE
-       rm -rf @localstatedir@/cache/libvirt/*
+        rm -rf @localstatedir@/cache/libvirt/*
     fi
 }
 
@@ -101,13 +101,13 @@ case "$1" in
         ;;
     force-reload)
         reload
-       ;;
+        ;;
     condrestart|try-restart)
         [ -f @localstatedir@/lock/subsys/$SERVICE ] && restart || :
         ;;
     *)
         echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|force-reload|try-restart}"
-       exit 2
+        exit 2
         ;;
 esac
 exit $RETVAL
index ee7b79d5d70c2fb47b96a5202aea3fb6fb54c2bf..9a1c6fae17e166b43e63ee40a7a0a7acefd62d73 100755 (executable)
@@ -147,35 +147,35 @@ then
     if [ ! -r $LIBVIRT/clientcert.pem ]
     then
         echo Client certificate $LIBVIRT/clientcert.pem should be world readable
-       echo "as root do: chown root:root $LIBVIRT/clientcert.pem ; chmod 644 $LIBVIRT/clientcert.pem"
+        echo "as root do: chown root:root $LIBVIRT/clientcert.pem ; chmod 644 $LIBVIRT/clientcert.pem"
     else
         S_ORG=`$CERTOOL -i --infile $LIBVIRT/clientcert.pem | grep Subject: | sed 's+.*O=\([a-zA-Z \._-]*\).*+\1+'`
-       if [ "$ORG" != "$S_ORG" ]
-       then
-           echo The CA certificate and the client certificate do not match
-           echo CA organization: $ORG
-           echo Client organization: $S_ORG
-       fi
-       CLIENT=`$CERTOOL -i --infile $LIBVIRT/clientcert.pem | grep Subject: | sed 's+.*CN=\(.[a-zA-Z \._-]*\).*+\1+'`
-       echo Found client certificate $LIBVIRT/clientcert.pem for $CLIENT
-       if [ ! -e $LIBVIRTP/clientkey.pem ]
-       then
-           echo Missing client private key $LIBVIRTP/clientkey.pem
-       else
-           echo Found client private key $LIBVIRTP/clientkey.pem
-           OWN=`ls -l $LIBVIRTP/clientkey.pem | awk '{ print $3 }'`
-           MOD=`ls -l $LIBVIRTP/clientkey.pem | awk '{ print $1 }'`
-           if [ "$OWN" != "root" ]
-           then
-               echo The client private key should be owned by root
-               echo "as root do: chown root $LIBVIRTP/clientkey.pem"
-           fi
-           if [ "$MOD" != "-rw-r--r--" ]
-           then
-               echo The client private key need to be read by client tools
-               echo "as root do: chmod 644 $LIBVIRTP/clientkey.pem"
-           fi
-       fi
+        if [ "$ORG" != "$S_ORG" ]
+        then
+            echo The CA certificate and the client certificate do not match
+            echo CA organization: $ORG
+            echo Client organization: $S_ORG
+        fi
+        CLIENT=`$CERTOOL -i --infile $LIBVIRT/clientcert.pem | grep Subject: | sed 's+.*CN=\(.[a-zA-Z \._-]*\).*+\1+'`
+        echo Found client certificate $LIBVIRT/clientcert.pem for $CLIENT
+        if [ ! -e $LIBVIRTP/clientkey.pem ]
+        then
+            echo Missing client private key $LIBVIRTP/clientkey.pem
+        else
+            echo Found client private key $LIBVIRTP/clientkey.pem
+            OWN=`ls -l $LIBVIRTP/clientkey.pem | awk '{ print $3 }'`
+            MOD=`ls -l $LIBVIRTP/clientkey.pem | awk '{ print $1 }'`
+            if [ "$OWN" != "root" ]
+            then
+                echo The client private key should be owned by root
+                echo "as root do: chown root $LIBVIRTP/clientkey.pem"
+            fi
+            if [ "$MOD" != "-rw-r--r--" ]
+            then
+                echo The client private key need to be read by client tools
+                echo "as root do: chmod 644 $LIBVIRTP/clientkey.pem"
+            fi
+        fi
 
     fi
 else
@@ -193,41 +193,41 @@ then
     if [ ! -r $LIBVIRT/servercert.pem ]
     then
         echo Server certificate $LIBVIRT/servercert.pem should be world readable
-       echo "as root do: chown root:root $LIBVIRT/servercert.pem ; chmod 644 $LIBVIRT/servercert.pem"
+        echo "as root do: chown root:root $LIBVIRT/servercert.pem ; chmod 644 $LIBVIRT/servercert.pem"
     else
         S_ORG=`$CERTOOL -i --infile $LIBVIRT/servercert.pem | grep Subject: | sed 's+.*O=\([a-zA-Z\. _-]*\).*+\1+'`
-       if [ "$ORG" != "$S_ORG" ]
-       then
-           echo The CA certificate and the server certificate do not match
-           echo CA organization: $ORG
-           echo Server organization: $S_ORG
-       fi
-       S_HOST=`$CERTOOL -i --infile $LIBVIRT/servercert.pem | grep Subject: | sed 's+.*CN=\([a-zA-Z\. _-]*\)+\1+'`
-       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`'"'
-           echo Server certificate CN: '"'$S_HOST'"'
-       fi
-       echo Found server certificate $LIBVIRT/servercert.pem for $S_HOST
-       if [ ! -e $LIBVIRTP/serverkey.pem ]
-       then
-           echo Missing server private key $LIBVIRTP/serverkey.pem
-       else
-           echo Found server private key $LIBVIRTP/serverkey.pem
-           OWN=`ls -l $LIBVIRTP/serverkey.pem | awk '{ print $3 }'`
-           MOD=`ls -l $LIBVIRTP/serverkey.pem | awk '{ print $1 }'`
-           if [ "$OWN" != "root" ]
-           then
-               echo The server private key should be owned by root
-               echo "as root do: chown root $LIBVIRTP/serverkey.pem"
-           fi
-           if [ "$MOD" != "-rw-------" ]
-           then
-               echo The server private key need to be read only by root
-               echo "as root do: chmod 600 $LIBVIRTP/serverkey.pem"
-           fi
-       fi
+        if [ "$ORG" != "$S_ORG" ]
+        then
+            echo The CA certificate and the server certificate do not match
+            echo CA organization: $ORG
+            echo Server organization: $S_ORG
+        fi
+        S_HOST=`$CERTOOL -i --infile $LIBVIRT/servercert.pem | grep Subject: | sed 's+.*CN=\([a-zA-Z\. _-]*\)+\1+'`
+        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`'"'
+            echo Server certificate CN: '"'$S_HOST'"'
+        fi
+        echo Found server certificate $LIBVIRT/servercert.pem for $S_HOST
+        if [ ! -e $LIBVIRTP/serverkey.pem ]
+        then
+            echo Missing server private key $LIBVIRTP/serverkey.pem
+        else
+            echo Found server private key $LIBVIRTP/serverkey.pem
+            OWN=`ls -l $LIBVIRTP/serverkey.pem | awk '{ print $3 }'`
+            MOD=`ls -l $LIBVIRTP/serverkey.pem | awk '{ print $1 }'`
+            if [ "$OWN" != "root" ]
+            then
+                echo The server private key should be owned by root
+                echo "as root do: chown root $LIBVIRTP/serverkey.pem"
+            fi
+            if [ "$MOD" != "-rw-------" ]
+            then
+                echo The server private key need to be read only by root
+                echo "as root do: chmod 600 $LIBVIRTP/serverkey.pem"
+            fi
+        fi
 
     fi
 else
@@ -243,19 +243,19 @@ then
     if [ -r $(SYSCONFDIR)/sysconfig/libvirtd ]
     then
         if [ "`grep '^LIBVIRTD_ARGS' $(SYSCONFDIR)/sysconfig/libvirtd | grep -- '--listen'`" = "" ]
-       then
-           echo Make sure $(SYSCONFDIR)/sysconfig/libvirtd is setup to listen to
-           echo TCP/IP connections and restart the libvirtd service
-       fi
+        then
+            echo Make sure $(SYSCONFDIR)/sysconfig/libvirtd is setup to listen to
+            echo TCP/IP connections and restart the libvirtd service
+        fi
     fi
     if [ -r $(SYSCONFDIR)/sysconfig/iptables ]
     then
         if [ "`grep $PORT $(SYSCONFDIR)/sysconfig/iptables`" = "" ]
-       then
-           echo Make sure $(SYSCONFDIR)/sysconfig/iptables is setup to allow
-           echo incoming TCP/IP connections on port $PORT and
-           echo restart the iptables service
-       fi
+        then
+            echo Make sure $(SYSCONFDIR)/sysconfig/iptables is setup to allow
+            echo incoming TCP/IP connections on port $PORT and
+            echo restart the iptables service
+        fi
     fi
 fi