From 846471086b3c581619eeda5ad706475a1a17ddf9 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Wed, 29 Dec 2010 18:08:49 +0100 Subject: refactor locale, initcpio and initialtime code * remove locale, initcpio and initialtime workers, move logic in new postconfigure_target function * for base and automatic procedures, postconfigure_target() gets called automatically * interactive procedure calls this in interactive_configure_system in the same way it calls preconfigure_target * rename target_run_mkinitcpio to target_run_mkinitcpio, to be consistent with other functions --- src/core/libs/lib-ui-interactive.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/core/libs/lib-ui-interactive.sh') diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh index f73c5b8..2aea25b 100644 --- a/src/core/libs/lib-ui-interactive.sh +++ b/src/core/libs/lib-ui-interactive.sh @@ -80,6 +80,14 @@ preconfigure_target () { # TODO: we should probably update /etc/crypttab if the user has non-/ encrypted disks. } +# do some target configuration steps automatically, after user decided he configured his system. +# as usual, this function is okay with being called multiple times +postconfigure_target () { + target_run_mkinitcpio || return $? + target_locale-gen || return $? + cp /etc/localtime ${var_TARGET_DIR}/etc/localtime || return $? +} + interactive_configure_system() { seteditor || return 1 @@ -139,6 +147,12 @@ interactive_configure_system() # temporary backup files are not useful anymore past this point. find "${var_TARGET_DIR}/etc/" -name '*~' -delete &>/dev/null + if ! postconfigure_target + then + show_warning "Postconfigure failed" "Beware: I just tried to automatically configure some stuff, but something failed. Please report this. Continue at your own risk" + ask_yesno "Do you want to continue?" no || return 1 + fi + return 0 } -- cgit v1.2.3-54-g00ecf