Skip to Content.
Sympa Menu

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

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 test cauldron by Justin Boffemmyer (d6f3fe31c26073b386463eb01545b26ebe36eca9)
  • Date: Thu, 1 Jan 2009 19:18:40 -0600

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

iso/usr/share/smgl.install/enchant | 108 -------------------------
iso/usr/share/smgl.install/keymap | 137
--------------------------------
iso/usr/share/smgl.install/smgl-enchant | 108 +++++++++++++++++++++++++
iso/usr/share/smgl.install/smgl-keymap | 137
++++++++++++++++++++++++++++++++
4 files changed, 245 insertions(+), 245 deletions(-)

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

smgl.install/{enchant,keymap}: add smgl- prefix

Prefix all end-user installer scripts with smgl- to make it easier for
users to identify scripts/commands that are available for use.

diff --git a/iso/usr/share/smgl.install/enchant
b/iso/usr/share/smgl.install/enchant
deleted file mode 100755
index f667de4..0000000
--- a/iso/usr/share/smgl.install/enchant
+++ /dev/null
@@ -1,108 +0,0 @@
-#!/bin/bash
-
-function usage() {
- cat <<USAGE
-Usage: $(basename $0) [-h] [-d /path/to/target] [CACHE1 [CACHE2..]]
-
-Installs caches to the target system (defined as /mnt/root if not
-specified). The caches installed can either be specified on the
-command-line as arguments, or they will be taken from information
-provided via /tmp/opt-spells. Note: if you are providing caches on the
-command-line, you must give the full cache filename, and caches with
-an extension of .tar.bz2 are expected.
-
-Options:
- -d Path to target directory. Defaults to /mnt/root.
-
- -h Shows this help information
-USAGE
- exit 1
-} >&2
-
-function die() {
- echo "$1"
- exit 42
-}
-
-function generate_state() {
- local spell="$1"
- local packages="$TARGET/var/state/sorcery/packages"
- local depends="$TARGET/var/state/sorcery/depends"
-
- spell=${spell%-*}
- while ! grep -q $spell $TABLETS
- do
- echo $spell | grep -q '.\+[-].\+' || break
- spell=${spell%-*}
- done
- grep -q $spell $TABLETS ||
- die "Couldn't create tablet information for $spell"
-
- # generate the depends and packages info for sorcery to use
- for date in "$tablet/$spell"/*
- do
- tablet_get_version $date ver
- tablet_get_status $date stat
- tablet_get_depends $date dep
- echo "${spell##*/}:${date##*/}:$stat:$ver" >> "$packages"
- cat "$dep" >> "$depends"
- done
-}
-
-while getopts ":d:h" Option
-do
- case $Option in
- d ) TARGET="$OPTARG" ;;
- h ) usage ;;
- * ) echo "Unrecognized option." >&2 && usage ;;
- esac
-done
-shift $(($OPTIND - 1))
-
-CACHE_DIR="${CACHE_DIR:-/var/cache/sorcery}"
-CACHE_LIST="${CACHE_LIST:-/tmp/opt-spells}"
-TABLETS="${TABLETS:-/tmp/tablets}"
-TARGET="${TARGET:-/mnt/root}"
-
-. "$TARGET"/etc/sorcery/config ||
- die "Couldn't source $TARGET/etc/sorcery/config"
-
-# generate a listing of all tablet directories if needed
-tablet="${tablet:-$TARGET/var/state/sorcery/tablet}"
-if [[ ! -f $TABLETS ]]
-then
- echo "Gathering tablet information..."
- find $tablet -maxdepth 1 -type d | sed 's#^.*/##' > $TABLETS
-fi
-
-if [[ $# -ge 1 ]]
-then
- # for each cache file specified on the command line, process them one at a
- # time and generate the necessary sorcery state for each as they are
- # processed
- while [[ $# -ge 1 ]]
- do
- CACHE="$1"
- echo "Installing ${CACHE##*/} ..."
- tar jxf "$CACHE" -C "$TARGET"/ &&
- generate_state "${CACHE##*/}" &&
- echo "${CACHE##*/} installed."
- shift
- done
-else
- # for each spell-version listed in /tmp/opt-spells, untar the corresponding
- # cache file from the ISO into the TARGET system and generate the necessary
- # sorcery state information afterwards so the TARGET sorcery can deal with
- # after the new system is booted
- for cache in $(<$CACHE_LIST)
- do
- echo "Installing $cache ..."
- tar jxf $CACHE_DIR/$cache*.tar.bz2 -C "$TARGET"/ &&
- generate_state $cache &&
- echo "$cache installed."
- done
-fi
-
-
-
-# vim:tabstop=2:softtabstop=2:shiftwidth=2:expandtab:ai
diff --git a/iso/usr/share/smgl.install/keymap
b/iso/usr/share/smgl.install/keymap
deleted file mode 100755
index 14f47d9..0000000
--- a/iso/usr/share/smgl.install/keymap
+++ /dev/null
@@ -1,137 +0,0 @@
-#!/bin/bash
-
-PREFIX=/usr/share/keymaps
-CHOICES=
-MAX=
-INPUT=
-RESULT=1
-
-function prompt() {
- echo ""
- printf "\tPlease enter a number (0 to go back): "
- read INPUT
- if [[ -n $INPUT ]]
- then
- if [[ $INPUT -lt 0 || $INPUT -gt $MAX ]]
- then
- echo "Error: You must enter a number corresponding to one"
- echo "of the choices in the list above!"
- return 1
- fi
- else
- return 0
- fi
-}
-
-function make_list {
- local list
-
- #LIST=$(find $PREFIX/$LISTDIR/* -maxdepth 0 -type d -not -name include)
- list=( $(find $PREFIX/* -maxdepth 0 -type d -not -name include) )
- MAX=${#list[*]}
- if [[ $MAX = 0 ]]
- then
- #LIST=$(find $PREFIX/$LISTDIR/* -type f -name *.map.gz)
- list=( $(find $PREFIX/* -type f -name *.map.gz) )
- MAX=${#list[*]}
- fi
- for ((i=0; i < $MAX; i++))
- do
- CHOICES[$i]=${list[i]##*/}
- done
-}
-
-function print_dirs {
- echo ""
- for ((i=0; i < $MAX; i++))
- do
- printf "\t\t\t[%2d] %s\n" "$(($i + 1))" "${CHOICES[i]}"
- done | more
-}
-
-function print_files {
- echo ""
- for ((i=0; i < $MAX; i++))
- do
- #printf "[%2d] %s" "$i" "${CHOICES[i]%.map.gz}"
- #printf "%2d %s" "$i" "${CHOICES[i]%.map.gz}"
- printf "[%2d] %s\n" "$(($i + 1))" "${CHOICES[i]}"
- done | column | more
-}
-
-function print_list {
- if [[ $MAX -gt 20 ]]
- then
- print_files
- else
- print_dirs
- fi
-}
-
-function go_list {
- local rc=1
-
- make_list
- print_list
- while [[ $rc = 1 ]]
- do
- prompt
- rc="$?"
- done
- if [[ $INPUT = 0 ]]
- then
- if [[ $PREFIX != "/usr/share/keymaps" ]]
- then
- PREFIX=${PREFIX%/[^/]*}
- fi
- else
- (( INPUT -= 1 ))
- INPUT=${CHOICES[INPUT]}
- if [[ $INPUT == *.map.gz ]]
- then
- PREFIX="$PREFIX/$INPUT"
- if loadkeys $PREFIX
- then
- # TODO: figure out what the user needs to enter in sysconfig/keymap
- echo "${PREFIX%.*map.*}" >/tmp/selected-keymap
- RESULT=0
- else
- RESULT=2
- fi
- else
- PREFIX="$PREFIX/$INPUT"
- fi
- fi
-}
-
-echo ""
-cat <<EOF
-Keymap selection menu.
-First, choose your keyboard's hardware type from the list below. Some
hardware
-types will also have a subtype, which will be presented in another menu.
-After you are done choosing your hardware type (and subtype), choose your
-preferred keymapping from the menu you are presented with. You may enter 0
-to go back to a previous menu.
-EOF
-
-while [[ $RESULT = "1" ]]
-do
- go_list
- #clear
-done
-
-if [[ $RESULT = "0" ]]
-then
- exit 0
-else
- exit 1
-fi
-
-#ls | sed 's/.map.gz$//' | nl -w 2 -s ' ' -nln | column | more
-
-#entries=( dummy $(echo * | sed -n 's/.k\?map\(.gz\)\?$//p') ); for((i=1;
-#i<${#entries[*]}; i++)) ;do printf "%2d %s" "$i" "${entries[i]}"; done |
-#column | more
-
-
-# vim:tabstop=2:softtabstop=2:shiftwidth=2:expandtab:ai
diff --git a/iso/usr/share/smgl.install/smgl-enchant
b/iso/usr/share/smgl.install/smgl-enchant
new file mode 100755
index 0000000..f667de4
--- /dev/null
+++ b/iso/usr/share/smgl.install/smgl-enchant
@@ -0,0 +1,108 @@
+#!/bin/bash
+
+function usage() {
+ cat <<USAGE
+Usage: $(basename $0) [-h] [-d /path/to/target] [CACHE1 [CACHE2..]]
+
+Installs caches to the target system (defined as /mnt/root if not
+specified). The caches installed can either be specified on the
+command-line as arguments, or they will be taken from information
+provided via /tmp/opt-spells. Note: if you are providing caches on the
+command-line, you must give the full cache filename, and caches with
+an extension of .tar.bz2 are expected.
+
+Options:
+ -d Path to target directory. Defaults to /mnt/root.
+
+ -h Shows this help information
+USAGE
+ exit 1
+} >&2
+
+function die() {
+ echo "$1"
+ exit 42
+}
+
+function generate_state() {
+ local spell="$1"
+ local packages="$TARGET/var/state/sorcery/packages"
+ local depends="$TARGET/var/state/sorcery/depends"
+
+ spell=${spell%-*}
+ while ! grep -q $spell $TABLETS
+ do
+ echo $spell | grep -q '.\+[-].\+' || break
+ spell=${spell%-*}
+ done
+ grep -q $spell $TABLETS ||
+ die "Couldn't create tablet information for $spell"
+
+ # generate the depends and packages info for sorcery to use
+ for date in "$tablet/$spell"/*
+ do
+ tablet_get_version $date ver
+ tablet_get_status $date stat
+ tablet_get_depends $date dep
+ echo "${spell##*/}:${date##*/}:$stat:$ver" >> "$packages"
+ cat "$dep" >> "$depends"
+ done
+}
+
+while getopts ":d:h" Option
+do
+ case $Option in
+ d ) TARGET="$OPTARG" ;;
+ h ) usage ;;
+ * ) echo "Unrecognized option." >&2 && usage ;;
+ esac
+done
+shift $(($OPTIND - 1))
+
+CACHE_DIR="${CACHE_DIR:-/var/cache/sorcery}"
+CACHE_LIST="${CACHE_LIST:-/tmp/opt-spells}"
+TABLETS="${TABLETS:-/tmp/tablets}"
+TARGET="${TARGET:-/mnt/root}"
+
+. "$TARGET"/etc/sorcery/config ||
+ die "Couldn't source $TARGET/etc/sorcery/config"
+
+# generate a listing of all tablet directories if needed
+tablet="${tablet:-$TARGET/var/state/sorcery/tablet}"
+if [[ ! -f $TABLETS ]]
+then
+ echo "Gathering tablet information..."
+ find $tablet -maxdepth 1 -type d | sed 's#^.*/##' > $TABLETS
+fi
+
+if [[ $# -ge 1 ]]
+then
+ # for each cache file specified on the command line, process them one at a
+ # time and generate the necessary sorcery state for each as they are
+ # processed
+ while [[ $# -ge 1 ]]
+ do
+ CACHE="$1"
+ echo "Installing ${CACHE##*/} ..."
+ tar jxf "$CACHE" -C "$TARGET"/ &&
+ generate_state "${CACHE##*/}" &&
+ echo "${CACHE##*/} installed."
+ shift
+ done
+else
+ # for each spell-version listed in /tmp/opt-spells, untar the corresponding
+ # cache file from the ISO into the TARGET system and generate the necessary
+ # sorcery state information afterwards so the TARGET sorcery can deal with
+ # after the new system is booted
+ for cache in $(<$CACHE_LIST)
+ do
+ echo "Installing $cache ..."
+ tar jxf $CACHE_DIR/$cache*.tar.bz2 -C "$TARGET"/ &&
+ generate_state $cache &&
+ echo "$cache installed."
+ done
+fi
+
+
+
+# vim:tabstop=2:softtabstop=2:shiftwidth=2:expandtab:ai
diff --git a/iso/usr/share/smgl.install/smgl-keymap
b/iso/usr/share/smgl.install/smgl-keymap
new file mode 100755
index 0000000..14f47d9
--- /dev/null
+++ b/iso/usr/share/smgl.install/smgl-keymap
@@ -0,0 +1,137 @@
+#!/bin/bash
+
+PREFIX=/usr/share/keymaps
+CHOICES=
+MAX=
+INPUT=
+RESULT=1
+
+function prompt() {
+ echo ""
+ printf "\tPlease enter a number (0 to go back): "
+ read INPUT
+ if [[ -n $INPUT ]]
+ then
+ if [[ $INPUT -lt 0 || $INPUT -gt $MAX ]]
+ then
+ echo "Error: You must enter a number corresponding to one"
+ echo "of the choices in the list above!"
+ return 1
+ fi
+ else
+ return 0
+ fi
+}
+
+function make_list {
+ local list
+
+ #LIST=$(find $PREFIX/$LISTDIR/* -maxdepth 0 -type d -not -name include)
+ list=( $(find $PREFIX/* -maxdepth 0 -type d -not -name include) )
+ MAX=${#list[*]}
+ if [[ $MAX = 0 ]]
+ then
+ #LIST=$(find $PREFIX/$LISTDIR/* -type f -name *.map.gz)
+ list=( $(find $PREFIX/* -type f -name *.map.gz) )
+ MAX=${#list[*]}
+ fi
+ for ((i=0; i < $MAX; i++))
+ do
+ CHOICES[$i]=${list[i]##*/}
+ done
+}
+
+function print_dirs {
+ echo ""
+ for ((i=0; i < $MAX; i++))
+ do
+ printf "\t\t\t[%2d] %s\n" "$(($i + 1))" "${CHOICES[i]}"
+ done | more
+}
+
+function print_files {
+ echo ""
+ for ((i=0; i < $MAX; i++))
+ do
+ #printf "[%2d] %s" "$i" "${CHOICES[i]%.map.gz}"
+ #printf "%2d %s" "$i" "${CHOICES[i]%.map.gz}"
+ printf "[%2d] %s\n" "$(($i + 1))" "${CHOICES[i]}"
+ done | column | more
+}
+
+function print_list {
+ if [[ $MAX -gt 20 ]]
+ then
+ print_files
+ else
+ print_dirs
+ fi
+}
+
+function go_list {
+ local rc=1
+
+ make_list
+ print_list
+ while [[ $rc = 1 ]]
+ do
+ prompt
+ rc="$?"
+ done
+ if [[ $INPUT = 0 ]]
+ then
+ if [[ $PREFIX != "/usr/share/keymaps" ]]
+ then
+ PREFIX=${PREFIX%/[^/]*}
+ fi
+ else
+ (( INPUT -= 1 ))
+ INPUT=${CHOICES[INPUT]}
+ if [[ $INPUT == *.map.gz ]]
+ then
+ PREFIX="$PREFIX/$INPUT"
+ if loadkeys $PREFIX
+ then
+ # TODO: figure out what the user needs to enter in sysconfig/keymap
+ echo "${PREFIX%.*map.*}" >/tmp/selected-keymap
+ RESULT=0
+ else
+ RESULT=2
+ fi
+ else
+ PREFIX="$PREFIX/$INPUT"
+ fi
+ fi
+}
+
+echo ""
+cat <<EOF
+Keymap selection menu.
+First, choose your keyboard's hardware type from the list below. Some
hardware
+types will also have a subtype, which will be presented in another menu.
+After you are done choosing your hardware type (and subtype), choose your
+preferred keymapping from the menu you are presented with. You may enter 0
+to go back to a previous menu.
+EOF
+
+while [[ $RESULT = "1" ]]
+do
+ go_list
+ #clear
+done
+
+if [[ $RESULT = "0" ]]
+then
+ exit 0
+else
+ exit 1
+fi
+
+#ls | sed 's/.map.gz$//' | nl -w 2 -s ' ' -nln | column | more
+
+#entries=( dummy $(echo * | sed -n 's/.k\?map\(.gz\)\?$//p') ); for((i=1;
+#i<${#entries[*]}; i++)) ;do printf "%2d %s" "$i" "${entries[i]}"; done |
+#column | more
+
+
+# vim:tabstop=2:softtabstop=2:shiftwidth=2:expandtab:ai



  • [SM-Commit] GIT changes to test cauldron by Justin Boffemmyer (d6f3fe31c26073b386463eb01545b26ebe36eca9), Justin Boffemmyer, 01/01/2009

Archive powered by MHonArc 2.6.24.

Top of Page