#!/bin/sh # Usage: get-e.sh 0-8-33 0.8.33o # # First argument is version series (as in the download page address at erights.org) and second argument is the full version. Yes, I should improve this. # TODO: # - Determine osdir, machdir, javacmd instead of being hardcoded # - Pick curl or wget depending on which is available. # - Usage help # - Automatically find latest E version # - Tell curl/wget about the download site's cert # - Run the substitution on rune-template and offer to install it # - Pretty progress output # - 'Relocate' option which just reruns the path substitutions on an existing e-home # - Make source installation optional # - Choice of tracelog location and dir perms set -v set -e VERSIONA="$1" VERSIONB="$2" TAROPTS="--no-same-owner" GETTOOL="curl --insecure -o" #GETTOOL="wget -O" mkdir -p etrace chmod a+rwxt etrace $GETTOOL E-src.tar.gz https://www.cypherpunks.to/erights/download/$VERSIONA/E-src-${VERSIONB}.tar.gz $GETTOOL E-purej.tar.gz https://www.cypherpunks.to/erights/download/$VERSIONA/E-purej-${VERSIONB}.tar.gz tar $TAROPTS -xzf E-src.tar.gz chmod -R go-w,a+rX e cd e tar $TAROPTS -xzf ../E-purej.tar.gz SUBST_PROPS="e.osdir=mac e.machdir=ppc e.home=`pwd`/ e.javacmd=`which java` TraceLog_dir=`pwd`/../etrace/" BOOT_RUNE="java -jar -De.home=. e.jar --rune" cp rune-template.txt rune cp eprops-template.txt eprops.txt $BOOT_RUNE scripts/substProps.e eprops.txt $SUBST_PROPS $BOOT_RUNE scripts/substProps.e rune $SUBST_PROPS chmod +x rune # perl -MCwd -wpe 's/\$\{\{e.osdir}}/mac/; s/\$\{\{e.machdir}}/ppc/; s#\$\{\{e.home}}#cwd() . "/"#e; s#\$\{\{e.javacmd}}#/usr/bin/java#; s#\$\{\{TraceLog_dir}}#cwd() . "trace/"#e; ' eprops-template.txt > eprops.txt cd .. rm E-src.tar.gz rm E-purej.tar.gz