From: Matthew Dillon Date: Tue, 10 Feb 2009 01:25:32 +0000 (-0800) Subject: Release Engineering: Enhance gui PFI to auto-detect xorg or curses X-Git-Tag: v2.2.0~6^2~4 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/d07a93d31afb3322b37358ee95f15898098ec4eb 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. --- 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