summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorthynkon2020-11-07 10:27:18 +0100
committerthynkon2020-11-07 10:27:18 +0100
commit00229b5d31dde07df8c28017e5d96c3b7a4b2629 (patch)
tree1ff459ea1e4b9daa841282eb43214cb2aa7f94b4
parentfedf3e12c7f4619cf43e8b10c36b4fbeaa5bd93b (diff)
downloadaur-00229b5d31dde07df8c28017e5d96c3b7a4b2629.tar.gz
Update to v. 1.3.18-1
-rw-r--r--.SRCINFO8
-rw-r--r--PKGBUILD4
-rwxr-xr-xupdate.sh2
-rwxr-xr-xupdate_pkgbuild.sh94
4 files changed, 101 insertions, 7 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 248b09b4b5d4..8f171ec02afb 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,14 +1,14 @@
pkgbase = joplin-appimage
pkgdesc = The latest pre-released AppImage of Joplin - a cross-platform note taking and to-do app
- pkgver = 1.3.15
+ pkgver = 1.3.18
pkgrel = 1
url = https://github.com/laurent22/joplin
arch = x86_64
license = MIT
options = !strip
- source = https://github.com/laurent22/joplin/releases/download/v1.3.15/Joplin-1.3.15.AppImage
- source = https://github.com/laurent22/joplin/raw/v1.3.15/LICENSE
- sha512sums = 746ecee87263959adbe592fbf308ec3ffb954897c43265846e034109f3aad255bfcda2db052cfa32f9c0a7afe2a7c24d88ddadb6f5c2e4aab76883794e235b3c
+ source = https://github.com/laurent22/joplin/releases/download/v1.3.18/Joplin-1.3.18.AppImage
+ source = https://github.com/laurent22/joplin/raw/v1.3.18/LICENSE
+ sha512sums = 64c5e5ad85eff9f840c4ee59629d249ea50bff0925f0011353715830288eeb8f71fc7ae20b933c9b8031b20215564fcbd6900b5cfaa7a932b57f2601886ef4e4
sha512sums = SKIP
pkgname = joplin-appimage
diff --git a/PKGBUILD b/PKGBUILD
index 411f38cf0da0..0369989d6275 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,7 +1,7 @@
# Maintainer: thynkon <thynkon at protonmail dot com>
pkgname=joplin-appimage
-pkgver=1.3.15
+pkgver=1.3.18
pkgrel=1
pkgdesc="The latest pre-released AppImage of Joplin - a cross-platform note taking and to-do app"
arch=('x86_64')
@@ -14,7 +14,7 @@ source=(
${url}/raw/v${pkgver}/LICENSE
)
sha512sums=(
- 746ecee87263959adbe592fbf308ec3ffb954897c43265846e034109f3aad255bfcda2db052cfa32f9c0a7afe2a7c24d88ddadb6f5c2e4aab76883794e235b3c
+ 64c5e5ad85eff9f840c4ee59629d249ea50bff0925f0011353715830288eeb8f71fc7ae20b933c9b8031b20215564fcbd6900b5cfaa7a932b57f2601886ef4e4
SKIP
)
diff --git a/update.sh b/update.sh
index 2e6c2a2fe8a8..db350a22d7d9 100755
--- a/update.sh
+++ b/update.sh
@@ -11,4 +11,4 @@ cd "${ROOT_DIR}"
package_version=$(grep "^pkgver" PKGBUILD | cut -d '=' -f 2)
package_release=$(grep "^pkgrel" PKGBUILD | cut -d '=' -f 2)
-makepkg --printsrcinfo > .SRCINFO && git commit -am "Updated to v. ${package_version}-${package_release}" && git push origin master
+makepkg --printsrcinfo > .SRCINFO && git commit -am "Update to v. ${package_version}-${package_release}" && git push origin master
diff --git a/update_pkgbuild.sh b/update_pkgbuild.sh
new file mode 100755
index 000000000000..cd5a6a078e52
--- /dev/null
+++ b/update_pkgbuild.sh
@@ -0,0 +1,94 @@
+#!/bin/bash
+
+readonly PROGRAM_NAME=$(basename $0)
+
+usage() {
+ cat << EOF
+Update PKGBUILD
+
+Usage: ${PROGRAM_NAME} [options]
+
+Options:
+ -h, --help display this help message and exit.
+ -r, --pkgrel the package version
+ -v, --pkgver the package release
+EOF
+}
+
+main() {
+ pkgver=""
+ pkgrel=""
+
+ optspec=":hr:v:-:"
+ while getopts "$optspec" optchar; do
+ case "${optchar}" in
+ -)
+ case "${OPTARG}" in
+ help)
+ usage
+ exit 2
+ ;;
+ pkgver)
+ pkgver="${!OPTIND}";
+ OPTIND=$(( $OPTIND + 1 ))
+ ;;
+ pkgrel)
+ pkgrel="${!OPTIND}";
+ OPTIND=$(( $OPTIND + 1 ))
+ ;;
+ *)
+ echo "Unknown option --${OPTARG}" >&2
+ exit 1
+ ;;
+ esac;;
+ h)
+ usage
+ exit 2
+ ;;
+ r)
+ pkgrel="${OPTARG}"
+ ;;
+ v)
+ pkgver="${OPTARG}"
+ ;;
+ *)
+ echo "Non-option argument: '-${OPTARG}'" >&2
+ exit 1
+ ;;
+ esac
+ done
+
+ if [ -z "${pkgver}" ]; then
+ echo "You must specify the package version!"
+ echo "Exiting..."
+ exit 1
+ fi
+ sed -i -r "s/^pkgver=([0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,3})$/pkgver=${pkgver}/g" PKGBUILD
+
+ if [ -z "${pkgrel}" ]; then
+ pkgrel=$(grep "^pkgrel" PKGBUILD | cut -d '=' -f 2)
+ fi
+ sed -i -r "s/^pkgrel=([0-9])$/pkgrel=${pkgrel}/g" PKGBUILD
+
+ algorithm="sha512"
+ checksum_file="Joplin-${pkgver}.AppImage.${algorithm}"
+ repo_url="https://github.com/laurent22/joplin/releases/download/v${pkgver}/${checksum_file}"
+
+ status=$(curl --output /dev/null -I --write-out '%{http_code}' "${repo_url}")
+ # requests are always redirected to the aws servers
+ if [[ "302" != "${status}" ]]; then
+ echo "The file ${checksum_file} does not exists!"
+ echo "Exiting..."
+ exit 1
+ fi
+
+ sha512=$(curl --silent -L "${repo_url}")
+ sed -i -r "s/^\s\s([A-Fa-f0-9]{128})$/ ${sha512}/g" PKGBUILD
+ if [ $? -ne 0 ]; then
+ echo "Failed to update sha512!"
+ echo "Need manual intervention!"
+ exit 1
+ fi
+}
+
+main $@