Skip to Content.
Sympa Menu

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

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 (f5aff309e142605bad180d1dbf4ad1dc575ea798)
  • Date: Sun, 10 Aug 2008 21:32:36 -0500

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

iso/usr/share/smgl.install/bashrc | 38
++++++++++++++++----------------------
1 files changed, 16 insertions(+), 22 deletions(-)

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

bashrc: corrected jump, changed header usage

jump is now guaranteed to work (no errors on correct steps, errors on
incorrect ones), and will also be faster (no loop needed). Should
speed things up a little bit.

header now only does the header, instead of doing the header and then
cat'ing a file.

diff --git a/iso/usr/share/smgl.install/bashrc
b/iso/usr/share/smgl.install/bashrc
index 0777d71..017b219 100755
--- a/iso/usr/share/smgl.install/bashrc
+++ b/iso/usr/share/smgl.install/bashrc
@@ -14,19 +14,17 @@ mkdir -p $INSTALLER_TMP
[[ -e $INSTALLER_STATUS ]] || echo 'init' >$INSTALLER_STATUS

function header() {
- local doc
- doc=$1
echo ""
echo ""
echo ""
echo
"<-------------------------------------------------------------------->"
- cat $1
}

function todo() {
local CURSTEP
CURSTEP=$(cat $INSTALLER_STATUS)
- header $INSTALLER_DOCS/steps/$CURSTEP
+ header
+ cat $INSTALLER_DOCS/steps/$CURSTEP
}

function next_step() {
@@ -81,37 +79,33 @@ function num_steps() {
}

function steps() {
- header $INSTALLER_DATA/steps
+ header
+ cat $INSTALLER_DATA/steps
}

function jump() {
- local i
- local good=0
-
cat $INSTALLER_DATA/steps | cut -d" " -f1 |
- while read i
- do
- if [[ $* = $i ]]
- then
- good=1
- echo "$*" >$INSTALLER_STATUS
- todo
- return
- fi
- done
- echo ""
- [[ $good -eq 0 ]] && echo "Error: '$*' is not a recognized step."
+ grep -q "^$*" && {
+ echo "$*" >$INSTALLER_STATUS
+ todo
+ return 0
+ }
+ header
+ echo "Error: '$*' is not a recognized step."
echo "Type steps to see a list of steps."
+ return 1
}

function welcome() {
- header $INSTALLER_DOCS/welcome
+ header
+ cat $INSTALLER_DOCS/welcome
}

function help() {
helpfile=$INSTALLER_DOCS/help/${1:-index}
if [[ -e $helpfile ]] ;then
- header $helpfile
+ header
+ cat $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 (f5aff309e142605bad180d1dbf4ad1dc575ea798), Justin Boffemmyer, 08/10/2008

Archive powered by MHonArc 2.6.24.

Top of Page