From d07a93d31afb3322b37358ee95f15898098ec4eb Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Mon, 9 Feb 2009 17:25:32 -0800 Subject: [PATCH] Release Engineering: Enhance gui PFI to auto-detect xorg or curses Add an "auto" feature for pfi_frontend and change the default to "auto". Adjust the gui/usr/local/bin/installer script to accept "auto" and set pfi_frontend to "xorg" or "curses" based on the existance of the DISPLAY variable. --- nrelease/gui/etc/defaults/pfi.conf | 6 ++++-- nrelease/gui/usr/local/bin/installer | 8 ++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/nrelease/gui/etc/defaults/pfi.conf b/nrelease/gui/etc/defaults/pfi.conf index edf8028863..4f68f0a3b2 100644 --- a/nrelease/gui/etc/defaults/pfi.conf +++ b/nrelease/gui/etc/defaults/pfi.conf @@ -13,9 +13,11 @@ pfi_rc_actions="" # Determines which installer frontend to use. Defaults to "curses"; -# other legal options are "cgi" and "none". +# other legal options are "xorg", "cgi", and "none". +# +# "auto" will select curses or xorg based on the existence of DISPLAY -pfi_frontend="xorg" +pfi_frontend="auto" # Determines which installer backend to use. Typically this is # "/usr/sbin/dfuibe_installer", the traditional C backend, diff --git a/nrelease/gui/usr/local/bin/installer b/nrelease/gui/usr/local/bin/installer index 9931288529..3eb008efd5 100755 --- a/nrelease/gui/usr/local/bin/installer +++ b/nrelease/gui/usr/local/bin/installer @@ -80,6 +80,14 @@ installer_start() pfi_frontend=none fi + if [ "X$pfi_frontend" = "Xauto" ]; then + if [ "X$DISPLAY" = "X" ]; then + pfi_frontend="curses" + else + pfi_frontend="xorg" + fi + fi + case "X$pfi_frontend" in Xqt) $pfi_backend -r $RENDEZVOUS -t $pfi_dfui_transport -- 2.41.0