Skip to Content.
Sympa Menu

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

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 (c5caa499b7ff7aa4c90126edfe049a9909446117)
  • Date: Fri, 21 Nov 2008 18:14:38 -0600

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

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

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

scripts/spellcaster.sh: separate cast and dispel

Casting and dispelling the ISO spells are now separate actions.
spellcaster.sh defaults to casting if no option is specified. This
separation was made because the ISO will need the optional spells to be
installed, while system.tar.bz2 should have only the required spells and
not the optional spells. Having the cast and dispel options separate
enables having all the spells present on the ISO, and the build dir can
just be copied and have the dispel run for the system.tar.bz2.

diff --git a/scripts/spellcaster.sh b/scripts/spellcaster.sh
index 255ae35..494337b 100755
--- a/scripts/spellcaster.sh
+++ b/scripts/spellcaster.sh
@@ -6,14 +6,17 @@

if [[ -n $CAULDRON_CHROOT && $# -eq 0 ]]
then
- # first cast the required spells (don't dispel, since these are needed
- # for the ISO to function)
- /usr/bin/cast $(tr '\n' ' ' </"$rspells") &&
-
- # now cast and dispel the optional spells, so that we have the cache
- # files available
- /usr/bin/cast $(tr '\n' ' ' </"$ospells") &&
- /usr/bin/dispel $(tr '\n' ' ' </"$ospells")
+ if [[ $CAULDRON_CAST = y ]]
+ then
+ # cast all spells
+ /usr/bin/cast $(tr '\n' ' ' </"$rspells") &&
+ /usr/bin/cast $(tr '\n' ' ' </"$ospells") &&
+
+ elif [[ $CAULDRON_DISPEL = y ]]
+ # dispel the optional spells, so that we have only their
cache files
+ # available
+ /usr/bin/dispel $(tr '\n' ' ' </"$ospells")
+ fi

exit $?
fi
@@ -23,12 +26,19 @@ CAULDRONDIR="$MYDIR"/../data

function usage() {
cat << EndUsage
-Usage: $(basename $0) [-h] /path/to/target ARCHITECTURE
+Usage: $(basename $0) [-h] -c | -d /path/to/target ARCHITECTURE

Casts the required and optional spells onto the ISO.
This script requires superuser privileges.

Required:
+ -c
+ Cast the required and optional spells in the target directory.
This
+ is the default action.
+
+ -d
+ Dispel the optional spells only from the target directory.
+
/path/to/target
The location of the chroot directory you would like to have the
casting done in.
@@ -45,9 +55,13 @@ EndUsage
exit 1
} >&2

-while getopts ":h" Option
+export CAULDRON_CAST=y
+
+while getopts ":cdh" Option
do
case $Option in
+ c ) export CAULDRON_DISPEL=n ; export CAULDRON_CAST=y ;;
+ d ) export CAULDRON_CAST=n ; export CAULDRON_DISPEL=y ;;
h ) usage ;;
* ) echo "Unrecognized option." >&2 && usage ;;
esac
@@ -96,16 +110,21 @@ then
fi
fi

+# Copy necessary files to the target and chroot
$(grep -q linux "$CAULDRONDIR/{$rspells,$ospells}") && cp
"$CAULDRONDIR/config.$TYPE" "$TARGET/etc/sorcery/local/kernel.config"
-cp "$CAULDRONDIR/$rspells" "$TARGET"/
+[[ CAULDRON_CAST = y ]] && cp "$CAULDRONDIR/$rspells" "$TARGET"/
cp "$CAULDRONDIR/$ospells" "$TARGET"/
"$MYDIR/cauldronchr.sh" -d "$TARGET" /"$(basename $0)"
-rm "$TARGET/$rspells"
+
+# Clean up the target
+[[ CAULDRON_CAST = y ]] && rm "$TARGET/$rspells"
rm "$TARGET/$ospells"
[[ -e "$TARGET/etc/sorcery/local/kernel.config" ]] && rm
"$TARGET/etc/sorcery/local/kernel.config"
rm "$TARGET/$(basename $0)"

unset rspells
unset ospells
+unset CAULDRON_CAST
+unset CAULDRON_DISPEL

exit 0




Archive powered by MHonArc 2.6.24.

Top of Page