From ccf8dc0a3b02aa448330ff82664f170c29c26fa0 Mon Sep 17 00:00:00 2001 From: mattias Date: Sun, 4 Aug 2019 19:41:03 +0000 Subject: [PATCH] tools: create_lazarus_export_tgz.sh pas2jszip git-svn-id: trunk@61668 - --- tools/install/create_lazarus_export_tgz.sh | 43 +++++++++++++++++++--- 1 file changed, 38 insertions(+), 5 deletions(-) diff --git a/tools/install/create_lazarus_export_tgz.sh b/tools/install/create_lazarus_export_tgz.sh index 610fa41aa7..e5ca2afdb8 100755 --- a/tools/install/create_lazarus_export_tgz.sh +++ b/tools/install/create_lazarus_export_tgz.sh @@ -2,28 +2,47 @@ # # Author: Mattias Gaertner # -# Usage: ./create_lazarus_export_tgz.sh [chmhelp] [download] outputfilename +# Usage: ./create_lazarus_export_tgz.sh [chmhelp] [download] outputfilename.tgz # # Options: -# chmhelp add chm,kwd files in docs/chm # download download instead of using the current files +# chmhelp add chm,kwd files in docs/chm +# pas2jszip +# unzip pas2js release zip to "pas2js/version" # Download= UseCHMHelp= OutputFile= TmpDir=~/tmp +Pas2jsZip= LastParam= while [ $# -gt 0 ]; do echo "param=$1" case "$1" in + download) + Download=yes + ;; chmhelp) echo "using files in docs/chm" UseCHMHelp=1 ;; - download) - Download=yes + pas2jszip) + shift + echo "param=$1" + Pas2jsZip=$1 + Pattern="*pas2js*.zip" + if [[ $Pas2jsZip == $Pattern ]]; then + echo "using pas2js zip file $Pas2jsZip" + else + echo "invalid pas2js zip file $Pas2jsZip" + exit -1 + fi + if [ ! -f $Pas2jsZip ]; then + echo "missing pas2js zip file $Pas2jsZip" + exit -1 + fi ;; *) @@ -41,7 +60,7 @@ done set -e if [ "x$OutputFile" = "x" ]; then - echo "Usage: ./create_lazarus_export_tgz.sh [chmhelp] [download] outputfilename" + echo "Usage: ./create_lazarus_export_tgz.sh [chmhelp] [download] outputfilename.tgz" exit 1 fi @@ -71,6 +90,19 @@ else fi fi +if [ -n $Pas2jsZip ]; then + # unzip pas2jszip to pas2js/version + mkdir $TmpLazDir/pas2js # fails if already there -> good + unzip $Pas2jsZip -d $TmpLazDir/pas2js + Pas2jsBin="$TmpLazDir/pas2js/*pas2js*/bin/pas2js" + if [ ! -f $Pas2jsBin ]; then + echo "missing $Pas2jsZip/*pas2js*/bin/pas2js" + exit 1 + fi + Pas2jsVer=$($Pas2jsBin -iV | tr -d '\n') + mv $TmpLazDir/pas2js/*pas2js* $TmpLazDir/pas2js/$Pas2jsVer +fi + # add ide/revision.inc echo "const RevisionStr = '$Revision';" > $TmpLazDir/ide/revision.inc @@ -79,6 +111,7 @@ echo "packing ..." tar cvzf lazarus.tgz lazarus cd - mv $TmpDir/lazarus.tgz $OutputFile +echo "Created $OutputFile" rm -rf $TmpLazDir # end.