From 0443dcf84a51dbe6f68c78fed159b1a1c883123f Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 24 Sep 2015 13:49:06 +0300 Subject: [PATCH] version handling improved --- Telegram/BuildWin.bat | 7 +------ Telegram/DeployLinux.sh | 9 +++++---- Telegram/DeployLinux32.sh | 9 +++++---- Telegram/DeployMacWin.sh | 9 +++++---- Telegram/PrepareLinux.sh | 9 +++++---- Telegram/PrepareLinux32.sh | 9 +++++---- Telegram/PrepareMac.sh | 9 +++++---- Telegram/Version | 6 ++++++ Telegram/Version.sh | 2 -- 9 files changed, 37 insertions(+), 32 deletions(-) create mode 100644 Telegram/Version delete mode 100755 Telegram/Version.sh diff --git a/Telegram/BuildWin.bat b/Telegram/BuildWin.bat index 0f79a8b666..0db10e2585 100644 --- a/Telegram/BuildWin.bat +++ b/Telegram/BuildWin.bat @@ -1,11 +1,6 @@ @echo OFF -set "AppVersionStrMajor=0.9" -set "AppVersion=9000" -set "AppVersionStrSmall=0.9" -set "AppVersionStr=0.9.0" -set "AppVersionStrFull=0.9.0.0" -set "DevChannel=0" +FOR /F "tokens=1,2* delims= " %i in (Version) do set "%i=%j" if %DevChannel% neq 0 goto preparedev diff --git a/Telegram/DeployLinux.sh b/Telegram/DeployLinux.sh index db3478e4e5..f017263744 100755 --- a/Telegram/DeployLinux.sh +++ b/Telegram/DeployLinux.sh @@ -1,7 +1,8 @@ -AppVersionStrMajor=`./Version.sh | awk -F " " '{print $1}'` -AppVersion=`./Version.sh | awk -F " " '{print $2}'` -AppVersionStr=`./Version.sh | awk -F " " '{print $3}'` -DevChannel=`./Version.sh | awk -F " " '{print $4}'` +while IFS='' read -r line || [[ -n "$line" ]]; do + set $line + eval $1="$2" +done < Version + DevPostfix='' if [ "$DevChannel" != "0" ]; then DevPostfix='.dev' diff --git a/Telegram/DeployLinux32.sh b/Telegram/DeployLinux32.sh index 3280df52ba..1362ceac3d 100755 --- a/Telegram/DeployLinux32.sh +++ b/Telegram/DeployLinux32.sh @@ -1,7 +1,8 @@ -AppVersionStrMajor=`./Version.sh | awk -F " " '{print $1}'` -AppVersion=`./Version.sh | awk -F " " '{print $2}'` -AppVersionStr=`./Version.sh | awk -F " " '{print $3}'` -DevChannel=`./Version.sh | awk -F " " '{print $4}'` +while IFS='' read -r line || [[ -n "$line" ]]; do + set $line + eval $1="$2" +done < Version + DevPostfix='' if [ "$DevChannel" != "0" ]; then DevPostfix='.dev' diff --git a/Telegram/DeployMacWin.sh b/Telegram/DeployMacWin.sh index 98d0d7f004..05394fe974 100755 --- a/Telegram/DeployMacWin.sh +++ b/Telegram/DeployMacWin.sh @@ -1,7 +1,8 @@ -AppVersionStrMajor=`./Version.sh | awk -F " " '{print $1}'` -AppVersion=`./Version.sh | awk -F " " '{print $2}'` -AppVersionStr=`./Version.sh | awk -F " " '{print $3}'` -DevChannel=`./Version.sh | awk -F " " '{print $4}'` +while IFS='' read -r line || [[ -n "$line" ]]; do + set $line + eval $1="$2" +done < Version + DevPostfix='' if [ "$DevChannel" != "0" ]; then DevPostfix='.dev' diff --git a/Telegram/PrepareLinux.sh b/Telegram/PrepareLinux.sh index 68c83d4f18..b4db1ffadb 100755 --- a/Telegram/PrepareLinux.sh +++ b/Telegram/PrepareLinux.sh @@ -1,7 +1,8 @@ -AppVersionStrMajor=`./Version.sh | awk -F " " '{print $1}'` -AppVersion=`./Version.sh | awk -F " " '{print $2}'` -AppVersionStr=`./Version.sh | awk -F " " '{print $3}'` -DevChannel=`./Version.sh | awk -F " " '{print $4}'` +while IFS='' read -r line || [[ -n "$line" ]]; do + set $line + eval $1="$2" +done < Version + DevPostfix='' DevParam='' if [ "$DevChannel" != "0" ]; then diff --git a/Telegram/PrepareLinux32.sh b/Telegram/PrepareLinux32.sh index 2ebb3ee8e0..312e8112d1 100755 --- a/Telegram/PrepareLinux32.sh +++ b/Telegram/PrepareLinux32.sh @@ -1,7 +1,8 @@ -AppVersionStrMajor=`./Version.sh | awk -F " " '{print $1}'` -AppVersion=`./Version.sh | awk -F " " '{print $2}'` -AppVersionStr=`./Version.sh | awk -F " " '{print $3}'` -DevChannel=`./Version.sh | awk -F " " '{print $4}'` +while IFS='' read -r line || [[ -n "$line" ]]; do + set $line + eval $1="$2" +done < Version + DevPostfix='' DevParam='' if [ "$DevChannel" != "0" ]; then diff --git a/Telegram/PrepareMac.sh b/Telegram/PrepareMac.sh index 0a12cf5aa9..5e7e34a2ea 100755 --- a/Telegram/PrepareMac.sh +++ b/Telegram/PrepareMac.sh @@ -1,7 +1,8 @@ -AppVersionStrMajor=`./Version.sh | awk -F " " '{print $1}'` -AppVersion=`./Version.sh | awk -F " " '{print $2}'` -AppVersionStr=`./Version.sh | awk -F " " '{print $3}'` -DevChannel=`./Version.sh | awk -F " " '{print $4}'` +while IFS='' read -r line || [[ -n "$line" ]]; do + set $line + eval $1="$2" +done < Version + DevPostfix='' DevParam='' if [ "$DevChannel" != "0" ]; then diff --git a/Telegram/Version b/Telegram/Version new file mode 100644 index 0000000000..f93fcf5a6d --- /dev/null +++ b/Telegram/Version @@ -0,0 +1,6 @@ +AppVersion 9000 +AppVersionStrMajor 0.9 +AppVersionStrSmall 0.9 +AppVersionStr 0.9.0 +AppVersionStrFull 0.9.0.0 +DevChannel 0 diff --git a/Telegram/Version.sh b/Telegram/Version.sh deleted file mode 100755 index 71f4c4c309..0000000000 --- a/Telegram/Version.sh +++ /dev/null @@ -1,2 +0,0 @@ -echo 0.9 9000 0.9.0 0 -# AppVersionStrMajor AppVersion AppVersionStr DevChannel