hets_script revision dfcf19ace3059f0e6c3d82110973f03200e31c7e
#
# this script is part of Hets
# - Heterogenous Tool Set -
#
#
# Handling switches
# -update
# -revert
#
if [ "$#" = "1" ]; then
case "$1" in
-update)
export HETS_DAILY_VERSION=`date +%Y%m%d`
python << __END__
import fcntl, os, sys;
f = open("/var/lib/dpkg/lock", 'w')
try:
fcntl.lockf(f, fcntl.LOCK_EX|fcntl.LOCK_NB)
print "Retrieving latest Hets library...",
sys.stdout.flush()
os.system("svn export --force -q https://svn-agbkb.informatik.uni-bremen.de/Hets-lib/trunk \
/usr/lib/hets/hets-lib")
print "Done"
print "Retrieving latest Hets binary...",
sys.stdout.flush()
os.system("rm -f /tmp/hets-$HETS_DAILY_VERSION*");
if os.uname()[4] == "x86_64":
os.system("curl -sG http://www.informatik.uni-bremen.de/agbkb/forschung/formal_methods/CoFI/hets/linux64/daily/hets.bz2 \
> /tmp/hets-$HETS_DAILY_VERSION.bz2")
else:
os.system("curl -sG http://www.informatik.uni-bremen.de/agbkb/forschung/formal_methods/CoFI/hets/linux/daily/hets.bz2 \
> /tmp/hets-$HETS_DAILY_VERSION.bz2")
os.system("bunzip2 /tmp/hets-$HETS_DAILY_VERSION.bz2")
os.system("mv /usr/lib/hets/hets \
/usr/lib/hets/hets.backup")
os.system("install -m 755 /tmp/hets-$HETS_DAILY_VERSION \
/usr/lib/hets/hets")
os.system("rm /tmp/hets-$HETS_DAILY_VERSION")
print "Done"
except IOError:
print "Could not acquire lock \"/var/lib/dpkg/lock\""
sys.exit(0)
sys.exit(0)
__END__
exit 0
else
echo "Root access required for \"hets -update\""
exit 0
fi
;;
-revert)
python << __END__
import fcntl, os, sys;
f = open("/var/lib/dpkg/lock", 'w')
try:
fcntl.lockf(f, fcntl.LOCK_EX|fcntl.LOCK_NB)
print "Reverting to previous Hets binary... ",
os.system("mv /usr/lib/hets/hets.backup \
/usr/lib/hets/hets");
print "Done"
except IOError:
print "Could not acquire lock \"/var/lib/dpkg/lock\""
sys.exit(0)
sys.exit(0)
__END__
exit 0
else
echo "No hets.backup found to revert."
exit 0
fi
else
echo "Root access required for \"hets -revert\""
exit 0
fi
esac
fi
#
# Detecting Isabelle version
#
case "$ISABELLE_VERSION"
2011*)
;;
*)
;;
esac
fi
#
# Setting environment variables
# and starting Hets
#