summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorGregory Danielson2022-05-20 07:39:44 -0500
committerGregory Danielson2022-05-20 07:39:44 -0500
commit11c83de22973cfcaa1c2f783eccff661ae5a6a41 (patch)
tree87417d2646b502823b5ffeb60743fcc741fa2d7f
parentf1194ebc74fb8c6c1d760c8fa00fb31976a7d972 (diff)
downloadaur-11c83de22973cfcaa1c2f783eccff661ae5a6a41.tar.gz
Set up repo for automatic updates
-rw-r--r--.gitignore3
-rw-r--r--Makefile22
-rwxr-xr-xupdate.sh22
3 files changed, 47 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..1912b0f559e8
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+*.ttf.*
+pkg/
+src/
diff --git a/Makefile b/Makefile
new file mode 100644
index 000000000000..2db09af371ba
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,22 @@
+.PHONY: setup-repo make install update check clean test all
+
+PKGNAME=ttf-unifont-csur
+ARTIFACTS=unifont_csur-*.ttf unifont_csur-*.ttf.sig
+
+setup-repo:
+ git remote add aur ssh://aur@aur.archlinux.org/${PKGNAME}.git
+
+make:
+ makepkg
+
+install:
+ makepkg -si
+
+update:
+ ./update.sh
+
+check:
+ ./update.sh --dry-run
+
+clean:
+ rm -rf ${ARTIFACTS}
diff --git a/update.sh b/update.sh
new file mode 100755
index 000000000000..1817a4fb8b81
--- /dev/null
+++ b/update.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+read -r LOCALVER <<<"$(cat PKGBUILD | grep 'pkgver=' | sed 's/pkgver=//g')"
+read -r UNIFONTVER <<<"$(curl -s https://unifoundry.com/pub/unifont/ | grep -Eo 'unifont-[0-9]{1,2}\.[0-9]{1,2}\.[0-9]{1,2}' | tail -1 | sed s/unifont-//g)"
+
+if [ "$LOCALVER" == "$UNIFONTVER" ]; then
+ echo "No update available"
+ exit 0
+fi
+
+echo "New version available: $UNIFONTVER"
+if [[ $* == *--dry-run* ]]; then
+ exit 0
+fi
+
+sed -i "s/pkgver=.*/pkgver=$UNIFONTVER/g" PKGBUILD
+echo "Updated version to $UNIFONTVER"
+
+updpkgsums
+makepkg --printsrcinfo >.SRCINFO
+git add ./PKGBUILD ./.SRCINFO
+git commit -m "Bump version to $UNIFONTVER"
+git push && git push aur master