]> xenbits.xensource.com Git - libvirt.git/commitdiff
configure: Remove nested conditionals in LIBVIRT_CHECK_INIT_SCRIPT
authorAndrea Bolognani <abologna@redhat.com>
Tue, 3 May 2016 08:34:52 +0000 (10:34 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Tue, 3 May 2016 14:10:43 +0000 (16:10 +0200)
We don't need them any longer; moreover, the previous structure
made it very easy for bugs to slip in, by having the result of one
check influence the following one.

By placing the check for "$with_init_script" = check front and
center, hopefully this won't happen (as easily) again.

m4/virt-init-script.m4

index d6a52e70a896f7072f8d59a345d9a44a1e0db483..c307b0e9b298d1a95e83db690197a9b60941c639 100644 (file)
@@ -30,20 +30,14 @@ AC_DEFUN([LIBVIRT_CHECK_INIT_SCRIPT],[
     init_systemd=no
     init_upstart=no
 
-    if test "$with_init_script" = check; then
-        if test "$cross_compiling" = yes; then
-            with_init_script=none
-        fi
+    if test "$with_init_script" = check && test "$cross_compiling" = yes; then
+        with_init_script=none
     fi
-    if type systemctl >/dev/null 2>&1; then
-        if test "$with_init_script" = check; then
-            with_init_script=systemd
-        fi
+    if test "$with_init_script" = check && type systemctl >/dev/null 2>&1; then
+        with_init_script=systemd
     fi
-    if test -f /etc/redhat-release; then
-        if test "$with_init_script" = check; then
-            with_init_script=redhat
-        fi
+    if test "$with_init_script" = check && test -f /etc/redhat-release; then
+        with_init_script=redhat
     fi
     if test "$with_init_script" = check; then
         with_init_script=none