summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbill-auger <mr.j.spam.me@gmail.com>2020-09-13 21:33:42 -0400
committerbill-auger <mr.j.spam.me@gmail.com>2020-09-13 22:08:44 -0400
commitdde688ba6d7633d17d25e40b9300eaed733a38da (patch)
treedf002db4937ff746209c887d536559dd387344af
parent98700463219f53abdeb0b35b45f5be5714ff2011 (diff)
[wizard]: add debugging mocksunified
-rwxr-xr-xconfigs/profile/root-image/root/.session/install/install.sh15
-rw-r--r--configs/profile/root-image/root/.session/session-common.sh.inc12
2 files changed, 27 insertions, 0 deletions
diff --git a/configs/profile/root-image/root/.session/install/install.sh b/configs/profile/root-image/root/.session/install/install.sh
index 4a9f5c2..573bf0e 100755
--- a/configs/profile/root-image/root/.session/install/install.sh
+++ b/configs/profile/root-image/root/.session/install/install.sh
@@ -79,6 +79,9 @@ NoticeCustomize() { WizardDlg "" --msgbox "${TR[notice_customize-${TR_KEY}]}" 0
SelectDefaults()
{
+${MOCK_SELECTDEFAULTS}
+# ${MOCK_SELECTDEFAULTS_NO}
+
if (( $( WizardDlg "${TR[dlg_defaults-${TR_KEY}]}" \
--yesno "${TR[defaults-${TR_KEY}]}" 20 70 ) ))
then [[ "$(GetStateVar 'INSTALL')" == 'prompt' ]] && \
@@ -96,6 +99,8 @@ SelectDefaults()
SelectLogins()
{
+${MOCK_SELECTLOGINS}
+
# prompt for root user password
local pass='in valid' pass2='not valid'
until [[ "${pass}" == "${pass2}" ]]
@@ -113,6 +118,8 @@ SelectLogins()
done
SetStateVar 'ROOT_PASS' ${pass}
+${MOCK_SELECTLOGINS_NO}
+
# prompt to create an unprivileged user login
(( $( WizardDlg "${dlg_title}" --yesno "${TR[user-${TR_KEY}]}" 20 70 ) )) || return 0
@@ -144,6 +151,8 @@ SelectLogins()
SelectBase()
{
+${MOCK_SELECTBASE}
+
# check to skip this stage per SelectDefaults()
[[ -z "$(GetStateVar 'BASE')" || -z "$(GetStateVar 'INIT')" ]] || return 0
@@ -175,6 +184,8 @@ NoticeOptional() { WizardDlg "" --msgbox "${TR[notice_optional-${TR_KEY}]}" 0 0
SelectBoot()
{
+${MOCK_SELECTBOOT}
+
# prompt to install GRUB
(( $( WizardDlg "${TR[dlg_boot-${TR_KEY}]}" \
--yesno "${TR[grub-${TR_KEY}]}" 20 70 ) )) && \
@@ -184,6 +195,8 @@ SelectBoot()
SelectWmde()
{
+${MOCK_SELECTWMDE}
+
# check to skip this stage per SelectDefaults()
[[ -z "$(GetStateVar 'WMDE')" ]] && SetStateVar 'WMDE' 'cli' || return 0
@@ -203,6 +216,8 @@ SelectWmde()
SelectEnv()
{
+${MOCK_SELECTENV}
+
[[ -z "$(GetStateVar 'HOSTNAME')" || -z "$(GetStateVar 'TIMEZONE')" || \
-z "$(GetStateVar 'KEYMAP' )" || -z "$(GetStateVar 'LOCALES' )" || \
-z "$(GetStateVar 'LANGUAGE')" ]] || return 0
diff --git a/configs/profile/root-image/root/.session/session-common.sh.inc b/configs/profile/root-image/root/.session/session-common.sh.inc
index 1f76ea4..8f8d57c 100644
--- a/configs/profile/root-image/root/.session/session-common.sh.inc
+++ b/configs/profile/root-image/root/.session/session-common.sh.inc
@@ -293,6 +293,18 @@ LogError() # (source_file func_name line_n)
}
+## debugging helpers ##
+
+readonly MOCK_SELECTDEFAULTS="SetStateVar 'INSTALL' \${DEF_INSTALL} ; SetStateVar 'BASE' \${DEF_PKG_SET} ; SetStateVar 'INIT' \${DEF_INIT} ; SetStateVar 'WMDE' \${DEF_WMDE} ; SetStateVar 'HOSTNAME' \${DEF_HOSTNAME} ; SetStateVar 'TIMEZONE' \${DEF_TIMEZONE} ; SetStateVar 'KEYMAP' \$(GetStateVar 'XKBMAP' ${DEF_KEYMAP} ) ; SetStateVar 'LOCALES' \$(GetStateVar 'LANG' \${DEF_LOCALE} ) ; SetStateVar 'LANGUAGE' \$(GetStateVar 'LANG' \${DEF_LANGUAGE}) ; return 0 ;"
+readonly MOCK_SELECTDEFAULTS_NO="return 0 ;"
+readonly MOCK_SELECTLOGINS_NO="SetStateVar 'USER_LOGIN' USER_LOGIN ; SetStateVar 'USER_PASS' USER_PASS ; return 0 ;"
+readonly MOCK_SELECTLOGINS="SetStateVar 'ROOT_PASS' ROOT_PASS \$(eval \${MOCK_SELECTLOGINS_NO})" ;
+readonly MOCK_SELECTBASE="SetStateVar 'INSTALL' \${DEF_INSTALL} ; SetStateVar 'BASE' \${DEF_PKG_SET} ; SetStateVar 'INIT' \${DEF_INIT} ; return 0 ;"
+readonly MOCK_SELECTBOOT="SetStateVar 'BOOT' 'grub' ; return 0 ;"
+readonly MOCK_SELECTWMDE="[[ -z "$(GetStateVar 'WMDE')" ]] && SetStateVar 'WMDE' 'cli'"
+readonly MOCK_SELECTENV="SetStateVar 'HOSTNAME' \${DEF_HOSTNAME} ; SetStateVar 'TIMEZONE' \${DEF_TIMEZONE} ; SetStateVar 'KEYMAP' \$(GetStateVar 'XKBMAP' \${DEF_KEYMAP}) ; SetStateVar 'LOCALES' \$(GetStateVar 'LANG' \${DEF_LOCALE}) ; SetStateVar 'LANGUAGE' \$(GetStateVar 'LANG' \${DEF_LANGUAGE}) ; return 0"
+
+
## translations for user-facing strings ##
readonly TRANSLATIONS=" en es gl pt " # pending translations 'eo' 'fr' 'it' 'pl'