#!/bin/sh toolsdir=`dirname "$0"` basedir=`dirname "$toolsdir"` if [ "$#" -eq 0 ]; then echo "build-snapshot [destination directory]" exit 1 fi destdir=`dirname $1` filename=`basename $1` rootdir=sugar-snapshot mkdir -p $destdir ln -s `pwd` $destdir/$rootdir cd $destdir tar chf $filename \ $rootdir/config \ $rootdir/devbot \ $rootdir/install \ $rootdir/commands/check-system \ $rootdir/commands/common.py \ $rootdir/commands/run \ $rootdir/commands/shell rm $rootdir mkdir $rootdir runsugarscript=$rootdir/run-sugar.sh cat > $runsugarscript << "EOF" #!/bin/sh commands/run EOF chmod +x $runsugarscript runshellscript=$rootdir/run-shell.sh cat > $runshellscript << "EOF" #!/bin/sh commands/shell EOF chmod +x $runshellscript tar rh -f $filename $runshellscript $runsugarscript rm -rf $rootdir xz $filename