[PATCH 3/5] Don't rely on having zenity and require it only for GUI

Vratislav Podzimek vpodzime at redhat.com
Tue Nov 19 11:50:27 UTC 2013


zenity pulls in the whole Gtk/X stack and we need it only for live
(i.e. GUI) installations. And the liveinst script may get along without it
anyway.

Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
---
 anaconda.spec.in       |  4 +++-
 data/liveinst/liveinst | 18 ++++++++++++++++--
 2 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/anaconda.spec.in b/anaconda.spec.in
index 2d77f82..7e8c3b8 100755
--- a/anaconda.spec.in
+++ b/anaconda.spec.in
@@ -115,7 +115,6 @@ Requires: pytz
 Requires: realmd
 %ifarch %livearches
 Requires: usermode
-Requires: zenity
 %endif
 %ifarch s390 s390x
 Requires: openssh
@@ -166,6 +165,9 @@ Requires: tigervnc-server-minimal
 Requires: libxklavier
 Requires: libgnomekbd
 Requires: nm-connection-editor
+%ifarch %livearches
+Requires: zenity
+%endif
 
 %description gui
 This package contains graphical user interface for the Anaconda installer.
diff --git a/data/liveinst/liveinst b/data/liveinst/liveinst
index dce02e5..a64fb0f 100755
--- a/data/liveinst/liveinst
+++ b/data/liveinst/liveinst
@@ -51,7 +51,14 @@ if [ -z "$LIVE_BLOCK" ]; then
 fi
 
 if [ $LIVE_INSTALL = 1 -a ! -b "$LIVE_BLOCK" ]; then
-  zenity --error --title="Not a Live image" --text "Can't do live image installation unless running from a live image"
+  title="Not a Live image"
+  text="Can't do live image installation unless running from a live image"
+  if which zenity &> /dev/null; then
+      zenity --error --title="$title" --text="$text"
+  else
+      echo "$title" >&2
+      echo "$text" >&2
+  fi
   exit 1
 fi
 
@@ -116,7 +123,14 @@ anaconda-cleanup $ANACONDA $*
 # Set up the updates, if provided.
 if [ ! -z "$UPDATES" ]; then
     if [ -e /tmp/updates.img -o -e /tmp/updates ]; then
-        zenity --error --title="Updates already exist" --text "updates= was provided, but an updates image already exists.  Please remove /tmp/updates.img and /tmp/updates and try again."
+        title="Updates already exist"
+        text="updates= was provided, but an updates image already exists.  Please remove /tmp/updates.img and /tmp/updates and try again."
+        if which zenity &> /dev/null; then
+            zenity --error --title="$title" --text="$text"
+        else
+            echo "$title" >&2
+            echo "$text" >&2
+        fi
         exit 1
     fi
 
-- 
1.8.4.2



More information about the anaconda-patches mailing list