fix(main/proton-bridge): check tag before auto-updating

- check whether this tag is 'bridge' tag or not. For more info see:
  https://github.com/ProtonMail/proton-bridge/blob/master/BUILDS.md#tags

Fixes #10813

%ci:no-build

Signed-off-by: Aditya Alok <dev.aditya.alok@gmail.com>
This commit is contained in:
Aditya Alok 2022-05-26 15:27:25 +05:30
parent 0dd6d5b21a
commit 02d1e908eb
No known key found for this signature in database
GPG Key ID: 345AE134142077D8
1 changed files with 18 additions and 5 deletions

View File

@ -3,23 +3,36 @@ TERMUX_PKG_DESCRIPTION="ProtonMail Bridge application"
TERMUX_PKG_LICENSE="GPL-3.0"
TERMUX_PKG_VERSION=2.1.3
TERMUX_PKG_SRCURL=https://github.com/ProtonMail/proton-bridge.git
TERMUX_PKG_GIT_BRANCH=br-$TERMUX_PKG_VERSION
TERMUX_PKG_GIT_BRANCH=br-${TERMUX_PKG_VERSION}
TERMUX_PKG_MAINTAINER="Radomír Polách <rp@t4d.cz>"
TERMUX_PKG_DEPENDS=libsecret
TERMUX_PKG_AUTO_UPDATE=true
TERMUX_PKG_UPDATE_VERSION_REGEXP="\d+\.\d+\.\d+"
# The go-rfc5322 module cannot currently be compiled for 32-bit OSes:
# https://github.com/ProtonMail/proton-bridge/blob/v2.1.1/BUILDS.md#prerequisites
TERMUX_PKG_BLACKLISTED_ARCHES="arm, i686"
termux_pkg_auto_update() {
local tag
tag="$(termux_github_api_get_tag "${TERMUX_PKG_SRCURL}")"
if ! grep -qE "^br-${TERMUX_PKG_UPDATE_VERSION_REGEXP}\$" <<<"${tag}"; then
echo "WARNING: Skipping update. This tag is not a 'bridge' tag. (${tag})"
return 0
fi
termux_pkg_upgrade_version "${tag}"
}
termux_step_make() {
termux_setup_golang
export GOPATH=$TERMUX_PKG_BUILDDIR
cd $TERMUX_PKG_SRCDIR
export GOPATH="${TERMUX_PKG_BUILDDIR}"
cd "${TERMUX_PKG_SRCDIR}" || exit 1
make build-nogui
}
termux_step_make_install() {
install -Dm700 $TERMUX_PKG_SRCDIR/proton-bridge \
"$TERMUX_PREFIX"/bin/proton-bridge
install -Dm700 "${TERMUX_PKG_SRCDIR}"/proton-bridge \
"${TERMUX_PREFIX}"/bin/proton-bridge
}