Skip to Content.
Sympa Menu

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

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 (84d651c38e482f90d558e96776670ffd6f65768b)
  • Date: Sun, 2 Jan 2011 20:15:51 -0600

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

enchantment/errorcodes | 12 ++-
enchantment/etc/config | 2
enchantment/lib.i18n | 40 +++++++-----
enchantment/lib.install | 8 +-
enchantment/lib.potion | 117
+++++++++++++++++++++++++-------------
enchantment/libenchantment | 4 -
enchantment/shell/bin/enchantment | 18 ++---
enchantment/shell/functions | 11 +--
8 files changed, 133 insertions(+), 79 deletions(-)

New commits:
commit 84d651c38e482f90d558e96776670ffd6f65768b
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

enchmantment: potion: fix quaff implementation

Correct the implementation of cauldron_potion_quaff, in particular its
handling of the start and end module arguments. This commit also
optimizes the processing cauldron_potion_quaff performs a bit, but only
marginally so.

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

enchantment: potion: check->update

Change the lib.potion function names from *check* to *update*. The
functions perform checks to see if updates are needed, but they also
always perform the updates if available, so simply calling them "check"
is an inadequate description. The error code associated with the main
update function is also updated accordingly.

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

enchantment: config: ISO kvers default value

Provide a good default value for ENCHANT_ISO_KVERS, which will be
whatever the running kernel on the ISO is. This will typically be what
is installed by most users anyway, assuming we have a reasonably good
default kernel.

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

enchantment: shell: lower 'help' in case stack

Move the handling for the help command lower down in the case stack,
since it is logically quite separate/distinct from the rest of the
processing (the order is arbitrary, but it may be helpful when reading
the code).

commit 59882f96f254651cc9d36144b656078b6aeaff5f
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

enchantment: more verbose function headers

Make the comment headers for some functions in lib.install more verbose,
making it clear that the functions can operate without arguments as well
as with arguments.

commit 97f236b6a7124830e68f03043add3b4405ef8a54
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

enchantment: shell: correct function call names

Bring the source and cache install function names in sync with what's
defined in lib.install.

commit 0639f2d0e267ef2030b53d06087124124ea7b72b
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

enchantment: shell: keymap can take 1 arg

The keymap command can either be called with no arguments, in which case
it will present a menu to the user from which they can select their
desired keymap. If called with an actual keymap name (any name
recognized directly by loadkeys, with or without path information), then
it will not present a menu and instead just set the keymap directly.

commit 5b6f3fbedf1621a1c95cbc664b6e7d078e74352c
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

enchantment: shell installer: better func names

Rename shell's "instructions" to "print", since the function is really
for output in general rather than processing instructions. Also, don't
claim we will fall back to bash's builtin help if the user requests help
that doesn't exist, now that all shell commands are subcommands to the
one enchantment command (i.e., they are properly "namespaced").

commit 063f2dace6a31ea4e27b57cf11b92be021c8cb3f
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

enchantment: lib.i18n: simple optimization

Collapse two lines into one single bash routine instead of evaluating
the math separate from assigning the value. Also avoids the extra
assignment, which isn't needed.

commit 4cced6c432fe8acf70fd49f66d948cbe7ee6b824
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>

enchantment: lib.i18n: better API conformance

Improve the function naming (as well as usage/interaction between
callers and callees) to be more API compliant and consistent.

diff --git a/enchantment/errorcodes b/enchantment/errorcodes
index d4ffffb..f01c202 100644
--- a/enchantment/errorcodes
+++ b/enchantment/errorcodes
@@ -57,7 +57,8 @@ ERR_KEYMAP_LIST=52 # keymap list empty or not
provided
ERR_KEYMAP_LIST_SIZE=53 # invalid list size provided
ERR_KEYMAP_INPUT=54 # invalid user input
ERR_KEYMAP_LOAD=55 # could not load selected keymap
-ERR_KEYMAP_SAVE=56 # could not save selected keymap
+ERR_KEYMAP_GET=56 # could not get selected keymap
+ERR_KEYMAP_SET=57 # could not set selected keymap

# lib.install
ERR_INSTALL_DIR=60 # could not install directory
@@ -76,7 +77,7 @@ ERR_MODULE_EXIT=73 # could not process module exit
ERR_MODULE_GET_NUM=74 # could not get number of current module

# lib.potion base
-ERR_POTION_CHECK_STATE=80 # could not process installer state
+ERR_POTION_UPDATE=80 # could not process installer state
ERR_POTION_DIR=81 # potion directory is missing
ERR_POTION_CACHE_FILE=82 # couldn't copy file into potion dir
ERR_POTION_ARCHIVE_FORMAT=83 # unknown archive format
@@ -107,7 +108,7 @@ ERR_POTION_CHK_USERS=108 # could not store
user/group config

# error messages
ERR_MSGS=(
- # base error codes
+ # base error codes
"operation succeeded" # ERR_OK
"fatal error" # ERR_FATAL
"could not make directory" # ERR_MK_DIR
@@ -146,7 +147,8 @@ ERR_MSGS=(
"invalid list size provided" #
ERR_KEYMAP_LIST_SIZE
"invalid user input" #
ERR_KEYMAP_INPUT
"could not load selected keymap" # ERR_KEYMAP_LOAD
- "could not save selected keymap" # ERR_KEYMAP_SAVE
+ "could not get selected keymap" # ERR_KEYMAP_GET
+ "could not set selected keymap" # ERR_KEYMAP_SET

# lib.install
"could not install directory" # ERR_INSTALL_DIR
@@ -165,7 +167,7 @@ ERR_MSGS=(
"could not get number of current module" #
ERR_MODULE_GET_NUM

# lib.potion base
- "could not process installer state" #
ERR_POTION_CHECK_STATE
+ "could not process installer state" #
ERR_POTION_UPDATE
"potion directory is missing" # ERR_POTION_DIR
"could not cache file" #
ERR_POTION_CACHE_FILE
"unknown archive format" #
ERR_POTION_ARCHIVE_FORMAT
diff --git a/enchantment/etc/config b/enchantment/etc/config
index 4e44f8f..108a3fd 100644
--- a/enchantment/etc/config
+++ b/enchantment/etc/config
@@ -71,7 +71,7 @@
ENCHANT_TARGET_SOURCES="${ENCHANT_TARGET_SOURCES:-$ENCHANT_TARGET/var/spool/sorc
ENCHANT_COLOR="${ENCHANT_COLOR:-yes}"

# kernel version to use for installs
- ENCHANT_ISO_KVERS="${ENCHANT_ISO_KVERS:-}"
+ ENCHANT_ISO_KVERS="${ENCHANT_ISO_KVERS:-$(uname -r)}"
# kernel image to use for installs

ENCHANT_ISO_KERNEL="${ENCHANT_ISO_KERNEL:-$ENCHANT_ISO_PATH/boot/vmlinux}"
# path to the kernel modules to use for the install
diff --git a/enchantment/lib.i18n b/enchantment/lib.i18n
index 24c4f34..d3a1349 100644
--- a/enchantment/lib.i18n
+++ b/enchantment/lib.i18n
@@ -29,7 +29,7 @@
## caller can do any cleanup needed and then exit.
##

#-------------------------------------------------------------------------------
-function enchant_i18n_keymap_get_input() {
+function enchant_i18n_keymap_input_get() {
local max="$1"
local input=""

@@ -95,13 +95,24 @@ function enchant_i18n_keymap_make_list {
}


#-------------------------------------------------------------------------------
+##
+## Get the current keymap setting from the enchantment temporary directory.
+##
+#-------------------------------------------------------------------------------
+function enchant_i18n_keymap_get() {
+ cat "$ENCHANT_KEYMAP" || return $ERR_KEYMAP_GET
+
+ return $ERR_OK
+}
+
+#-------------------------------------------------------------------------------
## @param keymap to load
##
## Load the keymap passed as the first argument and store it into the
## enchantment temporary directory for later use.
##

#-------------------------------------------------------------------------------
-function enchant_keymap_change() {
+function enchant_i18n_keymap_set() {
local keymap="$1"

[[ -f "$keymap" ]] || return $ERR_FILE_NOT_FOUND
@@ -110,12 +121,9 @@ function enchant_keymap_change() {

# store the selected keymap for later use by enchantment (e.g., for
potions)
echo "${keymap%.*map.*}" > "$ENCHANT_KEYMAP" ||
- return $ERR_KEYMAP_SAVE
+ return $ERR_KEYMAP_SET

- # instead of returning OK, return ERR_KEYMAP_EXIT to let the caller know
that
- # a keymap was successfully changed and this round of keymap processing
should
- # stop
- return $ERR_KEYMAP_EXIT
+ return $ERR_OK
}


#-------------------------------------------------------------------------------
@@ -123,10 +131,10 @@ function enchant_keymap_change() {
## @param size of choices list (highest numbered entry to choose from)
##
## Gets the user input and then processes it, possibly calling
-## enchant_keymap_change to actually set the keymap if that's what was input.
+## enchant_i18n_keymap_set to actually set the keymap if that's what was
input.
##

#-------------------------------------------------------------------------------
-function enchant_i18n_keymap_input() {
+function enchant_i18n_keymap_input_handler() {
local prefix="${1:-$ENCHANT_ISO_PATH/usr/share/keymaps}"
local max="$2"
local input=""
@@ -137,7 +145,7 @@ function enchant_i18n_keymap_input() {
[[ -z "$max" ]] && return $ERR_KEYMAP_LIST_SIZE

# get the user's menu choice
- input="$(enchant_i18n_keymap_get_input $max)"
+ input="$(enchant_i18n_keymap_input_get $max)"
rc="$?"

# if the user entered '*', exit the keymap routines
@@ -155,8 +163,7 @@ function enchant_i18n_keymap_input() {
prefix="${prefix%/[^/]*}"
else
# get the menu item, adjusting for array indexed from 0
- (( input -= 1 ))
- input="${choices[input]}"
+ input="${choices[((input-1))]}"

# if the input corresponds to a keymap file, attempt to switch to that
# keymap, otherwise set the prefix to the new path and loop again
@@ -164,11 +171,12 @@ function enchant_i18n_keymap_input() {
then
prefix="$prefix/$input"

- enchant_keymap_change "$prefix"
+ # if a keymap is successfully set, return ERR_KEYMAP_EXIT to the
caller,
+ # so they know that the keymap was successfully chosen and loaded
+ enchant_i18n_keymap_set "$prefix" && return $ERR_KEYMAP_EXIT

- # returns whatever enchant_keymap_change returns, which is either an
error
- # if something failed or ERR_KEYMAP_EXIT (meaning the keymap processing
- # should end) if successful
+ # return any errors from enchant_i18n_keymap_set if it didn't load a
+ # keymap successfully
return "$?"
else
prefix="$prefix/$input"
diff --git a/enchantment/lib.install b/enchantment/lib.install
index 0d2ecc2..92f701b 100644
--- a/enchantment/lib.install
+++ b/enchantment/lib.install
@@ -66,7 +66,9 @@ function enchant_install_dir() {
##
## @param sources_list
##
-## Copies the selected spell sources into the target.
+## Copies the selected spell sources into the target. If sources_list is
empty
+## (no sources were passed as arguments), it reads the list of sources to
+## install from $ENCHANT_SOURCES_LIST.
##

#-------------------------------------------------------------------------------
function enchant_install_sources() {
@@ -86,7 +88,9 @@ function enchant_install_sources() {
##
## @param caches_list
##
-## Copies the selected spell caches into the target.
+## Copies the selected spell caches into the target. If caches_list is empty
+## (no caches were passed as arguments), it reads the list of caches to
+## install from $ENCHANT_SOURCES_LIST.
##

#-------------------------------------------------------------------------------
function enchant_install_caches() {
diff --git a/enchantment/lib.potion b/enchantment/lib.potion
index ec09781..11f365b 100644
--- a/enchantment/lib.potion
+++ b/enchantment/lib.potion
@@ -205,7 +205,7 @@ function enchant_potion_get_partitions() {
## cache if they were changed.
##

#-------------------------------------------------------------------------------
-function enchant_potion_check_partitions() {
+function enchant_potion_update_partitions() {
local potion_parts="$ENCHANT_POTION/$1/filesystems"
local parts="$ENCHANT_POTION/filesystems"
local potion="${1:-$ENCHANT_POTION_CURRENT}"
@@ -254,7 +254,7 @@ function enchant_potion_get_filesystems() {
## changed, and updates the state cache if they were changed.
##

#-------------------------------------------------------------------------------
-function enchant_potion_check_filesystems() {
+function enchant_potion_update_filesystems() {
local potion_fs="$ENCHANT_POTION/$1/filesystems"
local fs="$ENCHANT_POTION/filesystems"
local potion="${1:-$ENCHANT_POTION_CURRENT}"
@@ -304,7 +304,7 @@ function enchant_potion_get_mount_points() {
## changed.
##

#-------------------------------------------------------------------------------
-function enchant_potion_check_mount_points() {
+function enchant_potion_update_mount_points() {
local potion_mounts="$ENCHANT_POTION/$1/mount_points"
local mounts="$ENCHANT_POTION/mount_points"
local potion="${1:-$ENCHANT_POTION_CURRENT}"
@@ -328,7 +328,7 @@ function enchant_potion_check_mount_points() {
## used. Updates the state cache if the kernel config changed.
##

#-------------------------------------------------------------------------------
-function enchant_potion_check_kernel_config() {
+function enchant_potion_update_kernel_config() {
local potion="${1:-$ENCHANT_POTION_CURRENT}"
local kernel_config="$ENCHANT_TARGET/usr/src/linux/.config"

@@ -346,7 +346,7 @@ function enchant_potion_check_kernel_config() {
## Updates the state cache if the kernel choice changed.
##

#-------------------------------------------------------------------------------
-function enchant_potion_check_kernel() {
+function enchant_potion_update_kernel() {
local potion="${1:-$ENCHANT_POTION_CURRENT}"
local kernels="$ENCHANT_TMP/kernels"

@@ -364,7 +364,7 @@ function enchant_potion_check_kernel() {
## updates the state cache if the list changed.
##

#-------------------------------------------------------------------------------
-function enchant_potion_check_spell_sources() {
+function enchant_potion_update_spell_sources() {
local potion="${1:-$ENCHANT_POTION_CURRENT}"
local spells="$ENCHANT_TMP/spells"

@@ -382,9 +382,9 @@ function enchant_potion_check_spell_sources() {
## choice changed.
##

#-------------------------------------------------------------------------------
-function enchant_potion_check_bootloader() {
+function enchant_potion_update_bootloader() {
local potion="${1:-$ENCHANT_POTION_CURRENT}"
- local kernels="$ENCHANT_TMP/bootloaders"
+ local bootloaders="$ENCHANT_TMP/bootloaders"

[[ -f "$bootloaders" ]] || return $ERR_FILE_NOT_FOUND

@@ -400,7 +400,7 @@ function enchant_potion_check_bootloader() {
## state cache if there were any changes.
##

#-------------------------------------------------------------------------------
-function enchant_potion_check_confs() {
+function enchant_potion_update_confs() {
local potion="${1:-$ENCHANT_POTION_CURRENT}"
local conf=""

@@ -422,7 +422,7 @@ function enchant_potion_check_confs() {
## cache if there were any changes.
##

#-------------------------------------------------------------------------------
-function enchant_potion_check_users() {
+function enchant_potion_update_users() {
local potion="${1:-$ENCHANT_POTION_CURRENT}"
local file=""

@@ -440,20 +440,20 @@ function enchant_potion_check_users() {

#-------------------------------------------------------------------------------
## @param potion directory name (relative to $ENCHANT_POTION/) [optional]
##
-## Checks various state data for updates during the install.
+## Checks various state data and performs any needed updates during the
install.
##

#-------------------------------------------------------------------------------
-function enchant_potion_check_state() {
+function enchant_potion_update() {
local potion="${1:-$ENCHANT_POTION_CURRENT}"

- enchant_potion_check_partitions "$potion" || return
$ERR_POTION_CHK_PARTITIONS
- enchant_potion_check_filesystems "$potion" || return
$ERR_POTION_CHK_FILESYSTEMS
- enchant_potion_check_mount_points "$potion" || return
$ERR_POTION_CHK_MOUNT_POINTS
- enchant_potion_check_opt_spells "$potion" || return
$ERR_POTION_CHK_OPT_SPELLS
- enchant_potion_check_kernel "$potion" || return $ERR_POTION_CHK_KERNEL
- enchant_potion_check_bootloader "$potion" || return
$ERR_POTION_CHK_BOOTLOADER
- enchant_potion_check_confs "$potion" || return $ERR_POTION_CHK_CONFS
- enchant_potion_check_users "$potion" || return $ERR_POTION_CHK_USERS
+ enchant_potion_update_partitions "$potion" || return
$ERR_POTION_CHK_PARTITIONS
+ enchant_potion_update_filesystems "$potion" || return
$ERR_POTION_CHK_FILESYSTEMS
+ enchant_potion_update_mount_points "$potion" || return
$ERR_POTION_CHK_MOUNT_POINTS
+ enchant_potion_update_opt_spells "$potion" || return
$ERR_POTION_CHK_OPT_SPELLS
+ enchant_potion_update_kernel "$potion" || return $ERR_POTION_CHK_KERNEL
+ enchant_potion_update_bootloader "$potion" || return
$ERR_POTION_CHK_BOOTLOADER
+ enchant_potion_update_confs "$potion" || return $ERR_POTION_CHK_CONFS
+ enchant_potion_update_users "$potion" || return $ERR_POTION_CHK_USERS

return $ERR_OK
}
@@ -495,31 +495,65 @@ function enchant_potion_bottle() {
}


#-------------------------------------------------------------------------------
-## @param potion
-## @param start
-## @param end
+## @param -s start (optional)
+## @param -e end (optional)
+## @param potion (required)
##
## If potion is an archive, it unpacks the archive and performs an automated
## install. If potion is a directory, it assumes it is a proper state
directory
## (what an unpacked potion archive is) and does the same as for an archive,
but
-## skipping the unpacking step. If the second argument (optional) is given,
it
-## determines at which module to begin the automation (defaults to the
first).
-## If the third argument is given, it determines at which module to end the
-## automation and at which module to end the automation (defaults to the
last).
+## skipping the unpacking step.
+##
+## If the start argument is given, it determines at which module to begin the
+## automation (defaults to the first). If the end ## argument is given, it
+## determines at which module to end the automation and at which module to
end
+## the automation (defaults to the last). Both start and end can be specified
+## either as module names or (positional) module numbers. If '--' is passed
as
+## an argument, it forces the function to stop scanning for flag parameters
so that
+## one can pass in filenames beginning with a '-' and not experience an
error.
+##
+## Once the potion is unpacked and ready, each module from start to end is
+## processed in turn by calling enchant_modules_potion, which runs any
+## module-specific scripts (in the module's directory) for processing potion
+## actions.
##

#-------------------------------------------------------------------------------
function enchant_potion_quaff() {
local potion="$1"
- local startmod="${2:-0}"
- local endmod="$3"
+ local current=""
+ local end=""
+ local list=""

- # get the list of modules to operate on
- local list="$(enchant_modules_list)"
+ # process any optional parameters
+ while [[ "${1:0:1}" == "-" ]]
+ do
+ case "$1" in
+ # starting module
+ "-s")
+ current="${2}"
+ shift 2
+ ;;
+ # ending module
+ "-e")
+ end="${2}"
+ shift 2
+ ;;
+ # stop processing optional parameters if passed '--'
+ "--")
+ shift
+ break
+ ;;
+ *)
+ ;;
+ esac
+ done

- # if the start module is given as the module name, get it's positional
number
- if [[ "$start" = [a-z]* ]]
+ # if the start module was given as a module name, get it's positional
number
+ if [[ -z "$current" ]]
then
- startmod="$(grep -n $start $ENCHANT_DATA/modules | cut -d: -f1)"
+ current="0"
+ elif [[ "$current" = [a-z]* ]]
+ current="$(grep -n $current $ENCHANT_DATA/modules | cut -d: -f1)"
fi

# if the end module wasn't explicitly specified, set it to the last
possible
@@ -527,13 +561,20 @@ function enchant_potion_quaff() {
if [[ -z "$end" ]]
then
endmod="${#list}"
+ # if the end module was specified as a module name, get it's positional
number
+ elif [[ "$end" = [a-z]* ]]
+ then
+ end="$(grep -n $end $ENCHANT_DATA/modules | cut -d: -f1)"
fi

- local i="$startmod"
- for ((i < endmod; i++))
+
+ # get the list of modules to operate on
+ list=($(enchant_modules_list))
+
+ # process each module's potion scripts from start module to end module
+ for ((current < end; current++))
do
- local module="${list[i]}"
- enchant_modules_potion "$module" "$potion"
+ enchant_modules_potion "${list[current]}" "$potion"
done

return $ERR_OK
diff --git a/enchantment/libenchantment b/enchantment/libenchantment
index 95159dc..73ad4fd 100755
--- a/enchantment/libenchantment
+++ b/enchantment/libenchantment
@@ -157,7 +157,7 @@ function enchant_set_current() {
echo "$module" >> "$ENCHANT_BACK" || return $ERR_SET_CURRENT

# check the installation state
- enchant_potion_check_state || return $ERR_POTION_CHECK_STATE
+ enchant_potion_update || return $ERR_POTION_UPDATE

# set the current module
echo "$module" > "$ENCHANT_STATUS" || return $ERR_SET_CURRENT
@@ -252,7 +252,7 @@ function enchant_set_prev() {

#-------------------------------------------------------------------------------
##
## Moves the installer backward in its history (like the back button on a
-## web browser.
+## web browser).
##
## when you go back, you store/save the forward pages
##
diff --git a/enchantment/shell/bin/enchantment
b/enchantment/shell/bin/enchantment
index c05388d..ace4603 100755
--- a/enchantment/shell/bin/enchantment
+++ b/enchantment/shell/bin/enchantment
@@ -52,9 +52,9 @@ $ERR_MSGS=( "$ERR_MSGS" "${enchant_shell_err_msgs[*]}" )


#------------------------------------------------------------------------------
function enchant_shell_command_keymap() {
- [[ "$#" -eq 0 ]] || return $ERR_INSTALLER_CMD
+ [[ "$#" -le 1 ]] || return $ERR_INSTALLER_CMD

- enchant_shell_perform_keymap || return $ERR_INSTALLER_KEYMAP
+ enchant_shell_perform_keymap "$@" || return $ERR_INSTALLER_KEYMAP

return $ERR_OK
}
@@ -75,7 +75,7 @@ function enchant_shell_command_prompt() {
}

function enchant_shell_command_chroot() {
- # can take either 0 or multiple arguments,
+ # can take any number of arguments,
# so don't check the number of arguments

enchant_shell_perform_chroot "$@"
@@ -160,13 +160,13 @@ function enchant_shell_command_install {
"sources" )
# can take either 0 or multiple arguments,
# so don't check the number of arguments
- enchant_install_spell_sources "$@"
+ enchant_install_sources "$@"
liberror_check_fatal_error
;;
"caches" )
# can take either 0 or multiple arguments,
# so don't check the number of arguments
- enchant_install_spell_caches "$@"
+ enchant_install_caches "$@"
liberror_check_fatal_error
;;
* ) return $ERR_INSTALLER_CMD ;;
@@ -231,10 +231,6 @@ case "$command" in
enchant_shell_perform_welcome
liberror_check_fatal_error
;;
- "help" )
- enchant_shell_command_help "$@"
- liberror_check_fatal_error
- ;;
"install" )
enchant_shell_command_install "$@"
liberror_check_fatal_error
@@ -243,6 +239,10 @@ case "$command" in
enchant_shell_command_potion "$@"
liberror_check_fatal_error
;;
+ "help" )
+ enchant_shell_command_help "$@"
+ liberror_check_fatal_error
+ ;;
* )
enchant_shell_command_help
liberror_check_fatal_error
diff --git a/enchantment/shell/functions b/enchantment/shell/functions
index cc5d6d7..12d3d82 100644
--- a/enchantment/shell/functions
+++ b/enchantment/shell/functions
@@ -38,7 +38,7 @@ function enchant_shell_header() {

# output the step instructions
# use color if libcolor loaded, else just plain bold
-function enchant_shell_instructions() {
+function enchant_shell_print() {
local file="$1"
local hilight=""
local normal=""
@@ -107,7 +107,7 @@ function enchant_shell_perform_todo() {
enchant_shell_header || return $ERR_FILE_NOT_FOUND

# output the current module's instructions
- enchant_shell_instructions "$ENCHANT_MODULES/$curstep/$curstep" ||
+ enchant_shell_print "$ENCHANT_MODULES/$curstep/$curstep" ||
return $ERR_FILE_NOT_FOUND

return $ERR_OK
@@ -171,7 +171,7 @@ function enchant_shell_perform_jump() {
function enchant_shell_perform_welcome() {
enchant_shell_header || return $ERR_FILE_NOT_FOUND

- enchant_shell_instructions "$ENCHANT_MODULES/welcome/welcome" ||
+ enchant_shell_print "$ENCHANT_MODULES/welcome/welcome" ||
return $ERR_FILE_NOT_FOUND

return $ERR_OK
@@ -184,16 +184,15 @@ function enchant_shell_perform_help() {
then
if [[ -n "$1" ]]
then
- libcolor_warn "No installer help for '$1', falling back to bash's
builtin help"
+ libcolor_warn "No installer help for '$1'"
echo ""
- builtin help "$1"
fi
else
return $ERR_FILE_NOT_FOUND
fi

enchant_shell_header || return $ERR_FILE_NOT_FOUND
- enchant_shell_instructions "$helpfile" ||
+ enchant_shell_print "$helpfile" ||
return $ERR_FILE_NOT_FOUND

return $ERR_OK



  • [SM-Commit] GIT changes to master cauldron by Justin Boffemmyer (84d651c38e482f90d558e96776670ffd6f65768b), Justin Boffemmyer, 01/02/2011

Archive powered by MHonArc 2.6.24.

Top of Page