From 7265563b8bb9fb9e74b5564fdc5dde5b7d68594a Mon Sep 17 00:00:00 2001 From: Daniel Narvaez Date: Wed, 28 Nov 2012 10:01:47 +0000 Subject: Move buildsnapshot and json-normalize in tools --- (limited to 'tools/build-snapshot') diff --git a/tools/build-snapshot b/tools/build-snapshot new file mode 100755 index 0000000..1bf525b --- /dev/null +++ b/tools/build-snapshot @@ -0,0 +1,58 @@ +#!/bin/sh + +commandsdir=`dirname "$0"` +basedir=`dirname "$commandsdir"` + +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/helpers/bashrc \ + $rootdir/commands/helpers/ubuntu-tweaks \ + $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 -- cgit v0.9.1