From 99be44ca25fc8e3c8072fdd7f175276a14109e67 Mon Sep 17 00:00:00 2001 From: Simon Frei Date: Thu, 20 Jun 2019 09:17:34 +0200 Subject: [PATCH] Updated Syncthing to v1.2.0-rc.2 --- scripts/bump-version.bash | 43 ++++++++++++++++++++ scripts/check-version.bash | 24 +++++++++++ scripts/pull-translations.bash | 22 ++++++++++ scripts/push-translations.bash | 8 ++++ scripts/update-syncthing.bash | 28 +++++++++++++ syncthing/src/github.com/syncthing/syncthing | 2 +- 6 files changed, 126 insertions(+), 1 deletion(-) create mode 100755 scripts/bump-version.bash create mode 100755 scripts/check-version.bash create mode 100755 scripts/pull-translations.bash create mode 100755 scripts/push-translations.bash create mode 100755 scripts/update-syncthing.bash diff --git a/scripts/bump-version.bash b/scripts/bump-version.bash new file mode 100755 index 00000000..2549dc52 --- /dev/null +++ b/scripts/bump-version.bash @@ -0,0 +1,43 @@ +#!/bin/bash + +set -e + +NEW_VERSION_NAME=$1 +OLD_VERSION_NAME=$(grep "versionName" "app/build.gradle" | awk '{print $2}') +if [[ -z ${NEW_VERSION_NAME} ]] +then + echo "New version name is empty. Please set a new version. Current version: $OLD_VERSION_NAME" + exit 1 +fi + +./scripts/check-version.bash "$NEW_VERSION_NAME" + +echo " + +Running Lint +----------------------------- +" +./gradlew clean lintVitalRelease + +echo " + +Enter Changelog for $NEW_VERSION_NAME +----------------------------- +" +CHANGELOG=app/src/main/play/release-notes/en-GB/default.txt +edit $CHANGELOG + +echo " + +Updating Version +----------------------------- +" +OLD_VERSION_CODE=$(grep "versionCode" "app/build.gradle" -m 1 | awk '{print $2}') +NEW_VERSION_CODE=$(($OLD_VERSION_CODE + 1)) +sed -i "s/versionCode $OLD_VERSION_CODE/versionCode $NEW_VERSION_CODE/" "app/build.gradle" + +OLD_VERSION_NAME=$(grep "versionName" "app/build.gradle" | awk '{print $2}') +sed -i "s/$OLD_VERSION_NAME/\"$1\"/" "app/build.gradle" +git add "app/build.gradle" $CHANGELOG +git commit -m "Bumped version to $NEW_VERSION_NAME" +git tag ${NEW_VERSION_NAME} diff --git a/scripts/check-version.bash b/scripts/check-version.bash new file mode 100755 index 00000000..e1b65f25 --- /dev/null +++ b/scripts/check-version.bash @@ -0,0 +1,24 @@ +#!/bin/bash + +set -e + +echo " + +Checking Syncthing Version is compatible +----------------------------- +" + +NEW_VERSION_NAME=$1 +if [[ -z ${NEW_VERSION_NAME} ]] +then + echo "New version name is empty. Please set a new version. Current version: $OLD_VERSION_NAME" + exit 1 +fi + +cd "syncthing/src/github.com/syncthing/syncthing/" +CURRENT_TAG=$(git describe) +if [ "v${NEW_VERSION_NAME#$CURRENT_TAG}" = "v${NEW_VERSION_NAME}" ]; then + printf "New version name %s is not compatible with Syncthing version %s\n" \ + "$NEW_VERSION_NAME" "$CURRENT_TAG" + exit 1 +fi diff --git a/scripts/pull-translations.bash b/scripts/pull-translations.bash new file mode 100755 index 00000000..78413b04 --- /dev/null +++ b/scripts/pull-translations.bash @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +set -e + +printf "Pulling Translations +----------------------------- +" +# Force pull to make sure this is executed. Apparently tx only compares timestamps, not file +# contents. So if a file was `touch`ed, it won't be updated by default. +# Use multiple transifex instances for pulling to speed things up. +tx pull -a -f -r "syncthing-android.stringsxml" & +tx pull -a -f -r "syncthing-android.description_fulltxt" & +tx pull -a -f -r "syncthing-android.description_shorttxt" & +tx pull -a -f -r "syncthing-android.titletxt" & +wait +./gradlew deleteUnsupportedPlayTranslations +git add -A "app/src/main/play/" +git add -A "app/src/main/res/values-*/strings.xml" +if ! git diff --cached --exit-code >/dev/null; +then + git commit -m "Imported translations" +fi diff --git a/scripts/push-translations.bash b/scripts/push-translations.bash new file mode 100755 index 00000000..4003bd8a --- /dev/null +++ b/scripts/push-translations.bash @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -e + +printf "Pushing Translations +----------------------------- +" +tx push -s diff --git a/scripts/update-syncthing.bash b/scripts/update-syncthing.bash new file mode 100755 index 00000000..56199aea --- /dev/null +++ b/scripts/update-syncthing.bash @@ -0,0 +1,28 @@ +#!/bin/bash + +set -e + +LATEST_TAG=$1 + +echo " + +Checking for Syncthing Update +----------------------------- +" +PROJECT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && cd .. && pwd )" +cd "syncthing/src/github.com/syncthing/syncthing/" +git fetch +CURRENT_TAG=$(git describe) +if [ -z "$LATEST_TAG" ]; then + LATEST_TAG=$(git tag --sort=taggerdate | tail -1) +fi + +if [ ${CURRENT_TAG} != ${LATEST_TAG} ]; then + git checkout -f ${LATEST_TAG} + cd ${PROJECT_DIR} + git add "syncthing/src/github.com/syncthing/syncthing/" + git commit -m "Updated Syncthing to $LATEST_TAG" +else + echo "Syncthing up-to-date at $CURRENT_TAG" +fi +cd ${PROJECT_DIR} diff --git a/syncthing/src/github.com/syncthing/syncthing b/syncthing/src/github.com/syncthing/syncthing index 21f50e2f..bf744ded 160000 --- a/syncthing/src/github.com/syncthing/syncthing +++ b/syncthing/src/github.com/syncthing/syncthing @@ -1 +1 @@ -Subproject commit 21f50e2f8fb57f30ffc313a115350f0ef9abdd06 +Subproject commit bf744ded311cdeac6234bce95a8a4871baaefcc0