#!/bin/bash # $HeadURL$ $LastChangedRevision$ echo "configuring environment ..." export RDW2_DB_FILE=$(pwd)/var/rdw2.sqlite export RDW2_ETC_PREFIX=$(pwd)/etc export LABEL_TOOL_REROOT_FLAG=true export LABEL_TOOL_REROOT_DIR=$(pwd)/.label-tool-reroot echo "setting up support scripts ..." # make a second editor that adds a newline to a file mkdir bin echo -e '#!/bin/bash\necho >> $1' > bin/add_a_good_line chmod 755 bin/add_a_good_line # make a third editor that adds a syntax error to a file echo -e '#!/bin/bash\necho BAD SYNTAX >> $1' > bin/add_a_bad_line chmod 755 bin/add_a_bad_line echo "initialising server ..." mkdir -p etc var echo 'rdw2_server_flag = True' > etc/rdw2.py rdw2 --list-sets > /dev/null echo "reloading an unedited database ..." EDITOR=true rdw2 -v --edit --no-update-cron echo "reloaded database with good edit ..." EDITOR=$(pwd)/bin/add_a_good_line rdw2 -v --edit --no-update-cron echo "reloaded database with bad edit ..." EDITOR=$(pwd)/bin/add_a_bad_line rdw2 -v --edit --no-update-cron echo "all done"