Author: nextgens Date: 2006-04-13 16:55:25 +0000 (Thu, 13 Apr 2006) New Revision: 8540
Modified: trunk/apps/installer/installclasspath/linux/update.sh trunk/apps/installer/installclasspath/windows/update.cmd Log: installer: New windows update script Version 1.4 is out (http://www.zerosplayground.dk/stuff/update.cmd) : - Fixed zero-size checks messing up if the Freenet path had spaces in it - Optimized various parts of the script ~Zero3Cool Modified: trunk/apps/installer/installclasspath/linux/update.sh =================================================================== --- trunk/apps/installer/installclasspath/linux/update.sh 2006-04-13 16:52:18 UTC (rev 8539) +++ trunk/apps/installer/installclasspath/linux/update.sh 2006-04-13 16:55:25 UTC (rev 8540) @@ -3,12 +3,17 @@ cd @path@ echo "Updating freenet" +if [[ "$1" != "debug" ]] +then + THEMASK="-o /dev/null" +fi + if [[ "$(which wget)" == "" ]] then WGET=0 - DOWNLOADER="curl -q -f -L -o /dev/null -O " - DOWNLOADER2="curl -q -f -L -o /dev/null -O http://downloads.freenetproject.org/alpha/freenet-cvs-snapshot.jar" - DOWNLOADER3="curl -q -f -L -o /dev/null -O " + DOWNLOADER="curl -q -f -L $THEMASK -O " + DOWNLOADER2="curl -q -f -L $THEMASK -O http://downloads.freenetproject.org/alpha/freenet-cvs-snapshot.jar" + DOWNLOADER3="curl -q -f -L $THEMASK -O " else WGET=1 # see https://bugs.freenetproject.org/view.php?id=223 @@ -17,9 +22,9 @@ then NOCERT="--no-check-certificate " fi - DOWNLOADER="wget -o /dev/null -N " - DOWNLOADER2="wget -o /dev/null -N -O freenet-cvs-snapshot.jar -i freenet-cvs-snapshot.jar.url" - DOWNLOADER3="wget -o /dev/null -N -O update2.sh $NOCERT " + DOWNLOADER="wget $THEMASK -N " + DOWNLOADER2="wget $THEMASK -N -O freenet-cvs-snapshot.jar -i freenet-cvs-snapshot.jar.url" + DOWNLOADER3="wget $THEMASK -N -O update2.sh $NOCERT " fi rm -f freenet-cvs-snapshot.jar.url Modified: trunk/apps/installer/installclasspath/windows/update.cmd =================================================================== --- trunk/apps/installer/installclasspath/windows/update.cmd 2006-04-13 16:52:18 UTC (rev 8539) +++ trunk/apps/installer/installclasspath/windows/update.cmd 2006-04-13 16:55:25 UTC (rev 8540) @@ -1,9 +1,10 @@ @echo off ::This script is designed for the Windows command line shell, so please don't put it into anything else! :) -::If you want to debug this script by adding pauses and stuff, please do that from another batch file, because +::If you want to debug this script by adding pauses and stuff, please do it from another batch file, because ::if you modify this script in any way it will be detected as outdated and will be overwritten on the next run. +::To force a re-download of the latest Freenet .jar, simply delete freenet-cvs-snapshot.jar.url before running this script. echo ----- -echo - Freenet Windows update script 1.3 by Zero3Cool (zero3cool at zerosplayground.dk) +echo - Freenet Windows update script 1.4 by Zero3Cool (zero3cool at zerosplayground.dk) echo - Thanks to search4answers, Michael Schierl and toad for help and feedback. echo - This script will automatically update your Freenet installation. echo - In case of an unrecoverable error, this script will pause. @@ -29,12 +30,12 @@ echo - Checking for updater updates... bin\wget.exe -o NUL https://emu.freenetproject.org/svn/trunk/apps/installer/installclasspath/windows/update.cmd -O update.new.cmd if not exist update.new.cmd goto error1 -type update.new.cmd|find "FREENET W%MAGICSTRING%WS UPDATE SCRIPT" > NUL +find "FREENET W%MAGICSTRING%WS UPDATE SCRIPT" update.new.cmd > NUL if errorlevel 1 goto error1 ::Check if updater has been updated -fc update.cmd update.new.cmd|find "***** " > nul -if errorlevel 1 goto updaterok +fc update.cmd update.new.cmd > nul +if errorlevel 0 goto updaterok ::It has! Run new version and end self echo - Updater updated, restarting update... @@ -50,14 +51,14 @@ if exist freenet-cvs-snapshot.jar.new.url del freenet-cvs-snapshot.jar.new.url bin\wget.exe -o NUL http://downloads.freenetproject.org/alpha/freenet-cvs-snapshot.jar.url -O freenet-cvs-snapshot.jar.new.url if not exist freenet-cvs-snapshot.jar.new.url goto error3 -FOR %%I IN (%LOCATION%freenet-cvs-snapshot.jar.url) DO if %%~zI==0 goto error3 +FOR %%I IN ("%LOCATION%freenet-cvs-snapshot.jar.url") DO if %%~zI==0 goto error3 ::Do we have something old to compare with? If not, update right away if not exist freenet-cvs-snapshot.jar.url goto updatefreenet ::Compare with current copy -fc freenet-cvs-snapshot.jar.url freenet-cvs-snapshot.jar.new.url|find "***** " > nul -if errorlevel 1 goto noupdate +fc freenet-cvs-snapshot.jar.url freenet-cvs-snapshot.jar.new.url > nul +if errorlevel 0 goto noupdate :updatefreenet echo - New version found, shutting down and updating Freenet... @@ -66,7 +67,7 @@ if exist freenet-cvs-snapshot.jar ren freenet-cvs-snapshot.jar freenet-cvs-snapshot.bak.jar bin\wget.exe -o NUL -i freenet-cvs-snapshot.jar.new.url -O freenet-cvs-snapshot.jar if not exist freenet-cvs-snapshot.jar goto error4 -FOR %%I IN (%LOCATION%freenet-cvs-snapshot.jar) DO if %%~zI==0 goto error4 +FOR %%I IN ("%LOCATION%freenet-cvs-snapshot.jar") DO if %%~zI==0 goto error4 if exist freenet-cvs-snapshot.jar.url del freenet-cvs-snapshot.jar.url ren freenet-cvs-snapshot.jar.new.url freenet-cvs-snapshot.jar.url echo - Freenet updated.
