Skip to Content.
Sympa Menu

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

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 (a8aadd56224993f3efd87f773d052aeab51889be)
  • Date: Mon, 29 Dec 2008 12:13:00 -0600

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

scripts/spellcaster.sh | 62
+++++++++++++++++++++++++++++++++----------------
1 files changed, 43 insertions(+), 19 deletions(-)

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

scripts/spellcaster.sh: swap options, priv_check

We need to do priv_check before parse_options because sudo will wipe out
the env vars set by parse_options.

diff --git a/scripts/spellcaster.sh b/scripts/spellcaster.sh
index 4f0b8a1..3e8f480 100755
--- a/scripts/spellcaster.sh
+++ b/scripts/spellcaster.sh
@@ -185,6 +185,42 @@ SPELLS
chmod a+x "$TARGET"/build_spells.sh
}

+function setup_sys() {
+ local SPOOL="$TARGET/var/spool"
+ local SORCERY="sorcery-stable.tar.bz2"
+
+ # unpack the sys caches into SYSDIR
+ for cache in $(<"$TARGET"/sys-list)
+ do
+ tar xjf "$TARGET"/var/cache/sorcery/$cache*.tar.bz2 -C
"$SYSDIR"/
+ done
+
+ # download sorcery source
+ (
+ cd "$SPOOL"
+ wget http://download.sourcemage.org/sorcery/$SORCERY
+ )
+
+ # unpack and install sorcery into SYSDIR
+ tar jxf "$SPOOL"/$SORCERY -C "$TARGET/usr/src"
+ "$TARGET/usr/src/sorcery/install" "$SYSDIR"
+}
+
+function setup_iso() {
+ # copy the iso caches over and unpack their contents
+ for cache in $(<"$TARGET"/iso-list)
+ do
+ tar xjf "$TARGET"/var/cache/sorcery/$cache*.tar.bz2 -C
"$ISODIR"/
+ cp "$TARGET"/var/cache/sorcery/$cache*.tar.bz2
"$ISODIR"/var/cache/sorcery/
+ done
+
+ # copy (only!) the optional caches over
+ for cache in $(<"$TARGET"/opt-list)
+ do
+ cp "$TARGET"/var/cache/sorcery/$cache*.tar.bz2
"$ISODIR"/var/cache/sorcery/
+ done
+}
+
function clean_target() {
local config="$TARGET/etc/sorcery/local/kernel.config"

@@ -203,11 +239,11 @@ function clean_target() {
}

# main()
+priv_check $*
+
parse_options $*
shift $?

-priv_check $*
-
[[ $# -lt 1 ]] && usage
TARGET="${1%/}"
shift
@@ -225,23 +261,11 @@ prepare_target
# chroot and build all of the spells inside the TARGET
"$MYDIR/cauldronchr.sh" -d "$TARGET" /build_spells.sh

-for cache in $(<"$TARGET"/sys-list)
-do
- tar xjf "$TARGET"/var/cache/sorcery/$cache*.tar.bz2 -C "$SYSDIR"/
-done
-
-# copy the caches over and unpack their contents
-for cache in $(<"$TARGET"/iso-list)
-do
- tar xjf "$TARGET"/var/cache/sorcery/$cache*.tar.bz2 -C "$ISODIR"/
- cp "$TARGET"/var/cache/sorcery/$cache*.tar.bz2
"$ISODIR"/var/cache/sorcery/
-done
-
-# copy the caches over (only!)
-for cache in $(<"$TARGET"/opt-list)
-do
- cp "$TARGET"/var/cache/sorcery/$cache*.tar.bz2
"$ISODIR"/var/cache/sorcery/
-done
+# unpack sys caches and set up sorcery into SYSDIR
+setup_sys
+
+# unpack iso caches and copy iso and optional caches into ISODIR
+setup_iso

# Keep a clean kitchen, wipes up the leftovers from the preparation step
clean_target



  • [SM-Commit] GIT changes to test cauldron by Justin Boffemmyer (a8aadd56224993f3efd87f773d052aeab51889be), Justin Boffemmyer, 12/29/2008

Archive powered by MHonArc 2.6.24.

Top of Page