Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master cauldron by Justin Boffemmyer (97172825992e2c66e473d14da0fd72f286f6a38e)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Justin Boffemmyer <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master cauldron by Justin Boffemmyer (97172825992e2c66e473d14da0fd72f286f6a38e)
  • Date: Sun, 28 Feb 2010 09:22:57 -0600

GIT changes to master cauldron by Justin Boffemmyer <flux AT sourcemage.org>:

enchantment/etc/config | 18 ++++++++++++------
enchantment/libenchantment | 39 ++++++++++++++++++++++-----------------
enchantment/shell/bashrc | 22 ++++++++++++++++------
3 files changed, 50 insertions(+), 29 deletions(-)

New commits:
commit 97172825992e2c66e473d14da0fd72f286f6a38e
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

enchantment: variable for installer-specific files

Added a variable which is set in the installer to point to
installer-specific files. This way libenchantment doesn't need anything
fancy to determine which installer is running in order to find the right
files, since the installer will provide that directly.

commit 7535f2a5c37d8b87a486164ae6a3349cc4c00de5
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

enchantment: cleanup comments and use of functions

Cleaned up some of the comments for better appearance/accuracy, and
added a few comments to make things more explicit. Fixed use of the
shell-specific functions in the shell installer, and re-added the
shell() command (which shouldn't have been removed).

diff --git a/enchantment/etc/config b/enchantment/etc/config
index 27d069a..5e9ba1e 100644
--- a/enchantment/etc/config
+++ b/enchantment/etc/config
@@ -1,24 +1,30 @@
#!/bin/bash

-# path to the ISO system (this should usually be null, unless
-# you are doing some tricky hacking)
+ # path to the ISO system (this should usually be null, unless
+ # you are doing some tricky hacking)
ENCHANT_ISO_PATH="${ENCHANT_ISO_PATH:-}"
-# path to the enchant library modules
+ # path to the enchant library modules
ENCHANT_BASE="${ENCHANT_BASE:-$ENCHANT_ISO_PATH/var/lib/cauldron/}"
ENCHANT_LIBS="${ENCHANT_LIBS:-$ENCHANT_BASE/enchantment}"
+ # temp directory used during the install
ENCHANT_TMP="${ENCHANT_TMP:-$ENCHANT_ISO_PATH/tmp/enchantment}"
- ENCHANT_STATUS="${ENCHANT_STATUS:-$ENCHANT_TMP/status}"
+ # install module (step) info
+ ENCHANT_STATUS="${ENCHANT_STATUS:-$ENCHANT_TMP/current_module}"
ENCHANT_BACK="${ENCHANT_BACK:-$ENCHANT_TMP/history/back}"
ENCHANT_FORWARD="${ENCHANT_FORWARD:-$ENCHANT_TMP/history/forward}"
+ # where the target system is mounted
ENCHANT_TARGET="${ENCHANT_TARGET:-$ENCHANT_ISO_PATH/mnt/root}"
+ # where the installer files are located

ENCHANT_DATA="${ENCHANT_DATA:-$ENCHANT_ISO_PATH/usr/share/enchantment}"
+ # location of the install modules (steps)
ENCHANT_MODULES="${ENCHANT_MODULES:-$ENCHANT_DATA/modules}"
+ # location of installer documentation

ENCHANT_DOCS="${ENCHANT_DOCS:-$ENCHANT_ISO_PATH/usr/share/doc/enchantment}"

-# whether to use color for displaying messages
+ # whether to use color for displaying messages
ENCHANT_COLOR="${ENCHANT_COLOR:-yes}"

-# size of history buffers, total size = $ENCHANT_HISTORY * 2 = (back +
forward)
+ # size of history buffers, total size = $ENCHANT_HISTORY * 2 = (back
+ forward)
ENCHANT_HISTORY=${ENCHANT_HISTORY:-20}

ENCHANT_SORCERY_CONFIG="${ENCHANT_SORCERY_CONFIG:-/etc/sorcery/config}"
diff --git a/enchantment/libenchantment b/enchantment/libenchantment
index b8f6cea..29b7022 100755
--- a/enchantment/libenchantment
+++ b/enchantment/libenchantment
@@ -164,8 +164,8 @@ function enchant_cleanup() {


#-------------------------------------------------------------------------------
##
-## Returns a list of all steps recognized for the current installation,
pruned
-## of duplicates and the special "error" step
+## Returns a list of all modules recognized for the current installation,
pruned
+## of duplicates and the special "error" module.
##

#-------------------------------------------------------------------------------
function enchant_get_modules() {
@@ -188,7 +188,7 @@ function enchant_get_modules() {


#-------------------------------------------------------------------------------
##
-## Determines and returns the current step in the installation procedure
+## Determines and returns the current module in the installation procedure.
##

#-------------------------------------------------------------------------------
function enchant_get_current() {
@@ -203,7 +203,9 @@ function enchant_get_current() {
##
## @param step
##
-## Sets the current step of the installer to be the step passed as an
argument
+## Sets the current module of the installer to be the step passed as an
+## argument. Stores the current module to the back history before setting it
to
+## the new module.
##

#-------------------------------------------------------------------------------
function enchant_set_current() {
@@ -231,7 +233,7 @@ function enchant_set_current() {


#-------------------------------------------------------------------------------
##
-## Determines and returns the next step in the installation procedure
+## Determines and returns the next module in the installation procedure.
##

#-------------------------------------------------------------------------------
function enchant_get_next() {
@@ -254,24 +256,24 @@ function enchant_get_next() {


#-------------------------------------------------------------------------------
##
-## Determines and returns the next step in the installation procedure
+## Sets the current module to the next module in the installation procedure.
##

#-------------------------------------------------------------------------------
function enchant_set_next() {
- local step
+ local module

# get next step
- step="$(enchant_get_next)" || return $ERR_SET_NEXT
+ module="$(enchant_get_next)" || return $ERR_SET_NEXT

# save new status
- enchant_set_step "$step" || return $ERR_SET_NEXT
+ enchant_set_step "$module" || return $ERR_SET_NEXT

return $ERR_OK
}


#-------------------------------------------------------------------------------
##
-## Determines and returns the previous step in the installation procedure
+## Determines and returns the previous module in the installation procedure.
##

#-------------------------------------------------------------------------------
function enchant_get_prev() {
@@ -297,16 +299,16 @@ function enchant_get_prev() {


#-------------------------------------------------------------------------------
##
-## Determines and returns the previous step in the installation procedure
+## Sets the current module to the previous module in the installation
procedure.
##

#-------------------------------------------------------------------------------
function enchant_set_prev() {
- local step
+ local module

# get the current step
- step="$(enchant_get_prev)" || return $ERR_SET_PREV
+ module="$(enchant_get_prev)" || return $ERR_SET_PREV

- enchant_set_current "$step" || return $ERR_SET_PREV
+ enchant_set_current "$module" || return $ERR_SET_PREV

return $ERR_OK
}
@@ -377,11 +379,14 @@ function enchant_forward() {


#-------------------------------------------------------------------------------
##
-## Returns the number of the current step to perform during the installation
+## Returns the number of the current module to perform during the
installation.
+## Expects $ENCHANT_INSTALLER to be set by the installer which is calling
this
+## function, and for that installer to have a 'modules' file (see the
+## implementation of the shell installer for an example).
##

#-------------------------------------------------------------------------------
function enchant_get_num() {
- local num="$(grep -n -m1 \"^$(enchant_get_current):\"
$ENCHANT_DATA/modules)"
+ local num="$(grep -n -m1 \"^$(enchant_get_current):\"
$ENCHANT_INSTALLER/modules)"

if [[ -z $num ]]
then
@@ -395,7 +400,7 @@ function enchant_get_num() {


#-------------------------------------------------------------------------------
##
-## Returns the total number of steps to perform during the installation
+## Returns the total number of modules to perform during the installation
##

#-------------------------------------------------------------------------------
function enchant_get_total() {
diff --git a/enchantment/shell/bashrc b/enchantment/shell/bashrc
index 01d5742..0f8368a 100755
--- a/enchantment/shell/bashrc
+++ b/enchantment/shell/bashrc
@@ -17,16 +17,22 @@
##

#-------------------------------------------------------------------------------

+
+# source configs and libenchantment
. "/etc/cauldron/enchant.config"
. "/etc/cauldron/local/enchant.config" 2> /dev/null
. "${ENCHANT_DATA}/libenchantment"

+# source libcolor if possible
if enchant_color
then
. "${ENCHANT_BASE}/libcolor" ||
liberror_print_error $ERR_LIBCOLOR $LIBERR_STDERR
fi

+# let libenchantment know which installer this is
+ENCHANT_INSTALLER="shell"
+
# Ensure installer sanity
enchant_prepare

@@ -99,10 +105,10 @@ function todo() {
curstep="${curstep:-$(enchant_getstep)}"

# output the header
- header
+ shell_header

# output the current module's instructions
- instructions "$ENCHANT_MODULES/$curstep"
+ shell_instructions "$ENCHANT_MODULES/$curstep"
}

function next() {
@@ -123,6 +129,10 @@ function forward() {
enchant_forward
}

+function steps() {
+ shell_modules
+}
+
function jump() {
local hilight="${LIBCOLOR_MESSAGE_COLOR:-}"
local normal="${LIBCOLOR_NORMAL_COLOR:-}"
@@ -141,15 +151,15 @@ function jump() {
}

function welcome() {
- header
- instructions "$ENCHANT_MODULES/welcome/welcome"
+ shell_header
+ shell_instructions "$ENCHANT_MODULES/welcome/welcome"
}

function help() {
helpfile="$ENCHANT_MODULES/help/${1:-index}"
if [[ -e $helpfile ]] ;then
- header
- instructions $helpfile
+ shell_header
+ shell_instructions $helpfile
else
echo "No installer help for '$1', falling back to bash's builtin help"
builtin help $1



  • [SM-Commit] GIT changes to master cauldron by Justin Boffemmyer (97172825992e2c66e473d14da0fd72f286f6a38e), Justin Boffemmyer, 02/28/2010

Archive powered by MHonArc 2.6.24.

Top of Page