#!/bin/bash # Second Life Installer Manifest Generator # Copyright (C) 2007 Dale Glass # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see terminate() { echo "$*" >&2 sleep 3 exit 1 } if [ "$1" == "nobuild" ] ; then nocompile=1 fi sldir="/cygdrive/c/Program Files/SecondLifeReleaseCandidate" slexe="SecondLifeReleaseCandidate.exe" echo "*********************************************************************" echo "* Getting revision number *" echo "*********************************************************************" scripts/gen_revision.pl --nsis ../../../.. > nsis/version.nsh || terminate "gen_revision failed" scripts/gen_revision.pl --text ../../../.. > nsis/version.txt || terminate "gen_revision failed" revnum=`scripts/gen_revision.pl --svnrev ../../../..` slver=`cat nsis/version.txt` scripts/verify_version.pl "$sldir/$slexe" "${slver}" || terminate "verify_version failed" echo -n "Updating revision number in llversion.h... " sed "s/LL_VERSION_REVISION.*$/LL_VERSION_REVISION = ${revnum};/ " ../../../llcommon/llversionviewer.h | unix2dos > llversion.tmp || terminate "sed failed" mv -f "llversion.tmp" ../../../llcommon/llversionviewer.h || terminate "mv failed" echo "done." echo "*********************************************************************" echo "* Updating message template *" echo "*********************************************************************" cp -v ../../../../etc/message.xml ../../app_settings/message.xml || terminate "cp message.xml failed" cp -v ../../../../scripts/messages/message_template.msg ../../app_settings/message_template.msg || terminate "cp message_template.msg failed" echo echo "*********************************************************************" echo "* Building *" echo "*********************************************************************" #if [ -z "$nocompile" ] ; then # scripts/build_sl.bat || terminate "build failed" #else # echo "Skipping" #fi echo echo "*********************************************************************" echo "* Running viewer_manifest.py *" echo "*********************************************************************" #( cd ../.. && ./viewer_manifest.py --actions copy > installers/windows-dale/viewer_manifest.log ) || terminate "viewer_manifest failed" echo echo echo "*********************************************************************" echo "* Updating DLLs *" echo "*********************************************************************" #scripts/sync_dlls.sh "../../packaged/" "$sldir" || terminate "sync_dlls failed" echo echo "*********************************************************************" echo "* Compressing files *" echo "*********************************************************************" scripts/gen_manifest.pl "../../packaged" --compression=lzma --output-dir=compressed --nodist-list=nsis/noredist --manifest=nsis/Manifest --directories=nsis/directories.nsh --sldir "$sldir" --zipfile "sl_${slver}_rev_${revnum}.zip" || terminate "gen_manifest failed" echo echo "*********************************************************************" echo "* Generating installer *" echo "*********************************************************************" # NSIS output path is relative to the location of the script makensis /V2 /DOUT_PATH=..\\compressed nsis/installer.nsi || terminate "makensis failed" echo echo "*********************************************************************" echo "* Signing *" echo "*********************************************************************" scripts/verify_signatures.sh compressed scripts/sign_files.sh compressed echo echo "*********************************************************************" echo "* Uploading files *" echo "*********************************************************************" scripts/upload.sh compressed || terminate "upload failed" ssh daleglass.net bin/update_latest.sh || terminate "update_latest failed" echo Changing symlink to latest version... ssh daleglass.net bin/update_latest.sh || terminate "update_latest failed" echo Marking version "${slver}.${revnum}" as completed... ssh daleglass.net bin/mark_uploaded.sh "${slver}.${revnum}" || terminate "update_latest failed" echo Done. sleep 3