Skip to content

Commit

Permalink
Issue #58: improve logic for checking whether todeClient image needs …
Browse files Browse the repository at this point in the history
…to be built or not[ci skip]
  • Loading branch information
dalehenrich committed Mar 20, 2015
1 parent 83c8c7b commit be5e821
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 15 deletions.
7 changes: 4 additions & 3 deletions bin/createStone
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,13 @@ fi
stoneName="$1"
gsvers="$2"

if [ ! -e "$GS_HOME/pharo/pharo" ]; then
$GS_HOME/bin/installPharo
pharo=$GS_HOME/pharo

if [ ! -e $pharo/todeClient.image ] ; then
$GS_HOME/bin/createTodeImage
fi

echo "Creating stone $stoneName"
pharo=$GS_HOME/pharo
$pharo/pharo $pharo/todeClient.image createStone $stoneName $gsvers

$GS_HOME/bin/stoneExtent $noRestartArg $snapshotFileArg $stoneName
Expand Down
5 changes: 5 additions & 0 deletions bin/createTodeImage
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,17 @@ while getopts "hp:" OPT ; do
done
shift $(($OPTIND - 1))

if [ ! -e "$GS_HOME/pharo/pharo" ]; then
$GS_HOME/bin/installPharo
fi

pharo=$GS_HOME/pharo
if [ -e $pharo/todeClient${postFix}.image ] ; then
echo "todeClient already installed"
exit 0
fi


todeLoadPath=$GS_HOME/tode/sys/default/pharo/todeLoad.st
if [ -e $GS_HOME/tode/sys/local/pharo/todeLoad.st ] ; then
todeLoadPath=$GS_HOME/tode/sys/local/pharo/todeLoad.st
Expand Down
7 changes: 4 additions & 3 deletions bin/stones
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,11 @@ if [ $# -ne 0 ]; then
usage; exit 1
fi

if [ ! -e "$GS_HOME/pharo/pharo" ]; then
$GS_HOME/bin/installPharo
pharo=$GS_HOME/pharo

if [ ! -e $pharo/todeClient.image ] ; then
$GS_HOME/bin/createTodeImage
fi

# Run script
pharo=$GS_HOME/pharo
$pharo/pharo $pharo/todeClient.image stones
8 changes: 4 additions & 4 deletions bin/tode
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ if [ "${GS_HOME}x" = "x" ] ; then
fi

#set -e # exit on error
if [ ! -e "$GS_HOME/pharo/pharo" ]; then
$GS_HOME/bin/installPharo
pharo=$GS_HOME/pharo

if [ ! -e $pharo/todeClient.image ] ; then
$GS_HOME/bin/createTodeImage
fi

# Run script
pharo=$GS_HOME/pharo
#unset GEMSTONE_NRS_ALL
$pharo/pharo $pharo/todeClient.image $*
21 changes: 17 additions & 4 deletions bin/todeClient
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,18 @@ echo "================="

usage() {
cat <<HELP
USAGE: $(basename $0) [-h] [-p <postfix>]
USAGE: $(basename $0) [-h] [-c] [-p <postfix>]
Launch todeClient image.
OPTIONS
-h
display help
-c
Clean and rebuild the todeClient image
-p <postfix>
Launch the tode client image created with a matching postfix.
Launch the tode client image created with a matching postfix. If
the tode client image does not exist, build it.
EXAMPLES
$(basename $0) -h
Expand All @@ -28,8 +31,10 @@ HELP
}

postFix=""
cleanImage=""
while getopts "hp:" OPT ; do
case "$OPT" in
c) cleanImage="clean";;
h) usage; exit 0 ;;
p) postFix="${OPTARG}" ;;
*) usage; exit 1 ;;
Expand All @@ -43,8 +48,16 @@ if [ "${GS_HOME}x" = "x" ] ; then
fi

set -e # exit on error
if [ ! -e "$GS_HOME/pharo/pharo" ]; then
$GS_HOME/bin/installPharo
pharo=$GS_HOME/pharo

if [ -e $pharo/todeClient${postFix}.image ] ; then
if [ "$cleanImage" = "clean" ] ; then
rm $pharo/todeClient${postFix}.image $pharo/todeClient${postFix}.changes
fi
fi

if [ ! -e $pharo/todeClient${postFix}.image ] ; then
$GS_HOME/bin/createTodeImage -p ${postFix}
fi

pharo=$GS_HOME/pharo
Expand Down
6 changes: 5 additions & 1 deletion bin/updateTodeImage
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,12 @@ fi

echo "updating todeClient${postFix} image using $todeLoadPath"


pharo=$GS_HOME/pharo

if [ ! -e $pharo/todeClient${postFix}.image ] ; then
$GS_HOME/bin/createTodeImage -p ${postFix}
fi

$pharo/pharo $pharo/todeClient${postFix}.image save todeClientTmp

$pharo/pharo $pharo/todeClientTmp.image st --quit --save $todeLoadPath
Expand Down

0 comments on commit be5e821

Please sign in to comment.