diff --git a/other/bootstrap_daemon/docker/tox-bootstrapd.sha256 b/other/bootstrap_daemon/docker/tox-bootstrapd.sha256 index 33ace212cb..1681d61ac5 100644 --- a/other/bootstrap_daemon/docker/tox-bootstrapd.sha256 +++ b/other/bootstrap_daemon/docker/tox-bootstrapd.sha256 @@ -1 +1 @@ -9ec2993a28988bd147bf8f4f21a824c2fc5dbf7255e391b3ce517d337ebce5c1 /usr/local/bin/tox-bootstrapd +1b91d7fbd6da34b92d1ad85b289a00909e211203ffd8541ae5c0887dcc35f920 /usr/local/bin/tox-bootstrapd diff --git a/other/version-sync b/other/version-sync index 9a98b055f1..015a441578 100755 --- a/other/version-sync +++ b/other/version-sync @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env bash set -eu @@ -13,25 +13,25 @@ update() { file="$SOURCE_DIR/$1" expr="$2" - sed -e "$expr" "$file" > "$file.updated-version" + sed -e "$expr" "$file" >"$file.updated-version" if diff "$file" "$file.updated-version"; then rm "$file.updated-version" else # use cat > and rm instead of move to keep file permissions - cat "$file.updated-version" > "$file" + cat "$file.updated-version" >"$file" rm "$file.updated-version" fi } -update 'configure.ac' 's/AC_INIT(\[tox\], \[.*\])/AC_INIT([tox], ['$VER'])/' +update 'configure.ac' 's/AC_INIT(\[tox\], \[.*\])/AC_INIT([tox], ['"$VER"'])/' -update 'toxcore/tox.api.h' 's/\(const VERSION_MAJOR *= \).*;/\1'$MAJOR';/' -update 'toxcore/tox.api.h' 's/\(const VERSION_MINOR *= \).*;/\1'$MINOR';/' -update 'toxcore/tox.api.h' 's/\(const VERSION_PATCH *= \).*;/\1'$PATCH';/' +update 'toxcore/tox.api.h' 's/\(const VERSION_MAJOR *= \).*;/\1'"$MAJOR"';/' +update 'toxcore/tox.api.h' 's/\(const VERSION_MINOR *= \).*;/\1'"$MINOR"';/' +update 'toxcore/tox.api.h' 's/\(const VERSION_PATCH *= \).*;/\1'"$PATCH"';/' -update 'CMakeLists.txt' 's/\(PROJECT_VERSION_MAJOR "\).*"/\1'$MAJOR'"/' -update 'CMakeLists.txt' 's/\(PROJECT_VERSION_MINOR "\).*"/\1'$MINOR'"/' -update 'CMakeLists.txt' 's/\(PROJECT_VERSION_PATCH "\).*"/\1'$PATCH'"/' +update 'CMakeLists.txt' 's/\(PROJECT_VERSION_MAJOR "\).*"/\1'"$MAJOR"'"/' +update 'CMakeLists.txt' 's/\(PROJECT_VERSION_MINOR "\).*"/\1'"$MINOR"'"/' +update 'CMakeLists.txt' 's/\(PROJECT_VERSION_PATCH "\).*"/\1'"$PATCH"'"/' # # calculating the SO version @@ -64,14 +64,14 @@ update 'CMakeLists.txt' 's/\(PROJECT_VERSION_PATCH "\).*"/\1'$PATCH'"/' # this must be constant starting from the 1.0 release LAST_SOMAJOR=2 -if [ $MAJOR -eq 0 ]; then +if [ "$MAJOR" -eq 0 ]; then SOMAJOR=$MINOR SOMINOR=$PATCH # update lastmajor above - update 'other/version-sync' 's/^\(LAST_SOMAJOR=\).*/\1'$SOMAJOR'/' + update 'other/version-sync' 's/^\(LAST_SOMAJOR=\).*/\1'"$SOMAJOR"'/' else - SOMAJOR=$(expr $MAJOR + $LAST_SOMAJOR) + SOMAJOR=$(("$MAJOR" + "$LAST_SOMAJOR")) SOMINOR=$MINOR fi @@ -115,16 +115,16 @@ fi # <=> major.minor.patch # -if [ $MAJOR -eq 0 ]; then - LIBTOOL_CURRENT=$(expr $SOMAJOR + $SOMINOR) +if [ "$MAJOR" -eq 0 ]; then + LIBTOOL_CURRENT=$(("$SOMAJOR" + "$SOMINOR")) LIBTOOL_AGE=$SOMINOR LIBTOOL_REVISION=0 else - LIBTOOL_CURRENT=$(expr $SOMAJOR + $SOMINOR) + LIBTOOL_CURRENT=$(("$SOMAJOR" + "$SOMINOR")) LIBTOOL_AGE=$SOMINOR LIBTOOL_REVISION=$PATCH fi -update 'so.version' 's/^\(CURRENT=\).*/\1'$LIBTOOL_CURRENT'/' -update 'so.version' 's/^\(AGE=\).*/\1'$LIBTOOL_AGE'/' -update 'so.version' 's/^\(REVISION=\).*/\1'$LIBTOOL_REVISION'/' +update 'so.version' 's/^\(CURRENT=\).*/\1'"$LIBTOOL_CURRENT"'/' +update 'so.version' 's/^\(AGE=\).*/\1'"$LIBTOOL_AGE"'/' +update 'so.version' 's/^\(REVISION=\).*/\1'"$LIBTOOL_REVISION"'/' diff --git a/tools/update-versions.sh b/tools/update-versions.sh new file mode 100755 index 0000000000..814b6f4eda --- /dev/null +++ b/tools/update-versions.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +set -eux -o pipefail + +VERSION=$1 + +GIT_ROOT=$(git rev-parse --show-toplevel) +cd "$GIT_ROOT" + +# Strip suffixes (e.g. "-rc.1") from the version for the toxcore version sync. +VERSION="${VERSION%-*}" + +IFS="." read -ra version_parts <<<"$VERSION" + +other/version-sync "$GIT_ROOT" "${version_parts[0]}" "${version_parts[1]}" "${version_parts[2]}"