summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorThaChillera2020-04-06 09:57:08 +0200
committerThaChillera2020-04-06 09:57:08 +0200
commitd5763b19d1404070c9c7aee307d24914ca2c16b0 (patch)
tree3113997981811d533dd7b8a79e95d670d295a732
parent2435138150a4e5c39f34663a278a34f49b0cacbc (diff)
downloadaur-d5763b19d1404070c9c7aee307d24914ca2c16b0.tar.gz
added auto-updating script
-rwxr-xr-xupdate.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/update.py b/update.py
new file mode 100755
index 00000000000..1f47d014c2c
--- /dev/null
+++ b/update.py
@@ -0,0 +1,27 @@
+#!/bin/python3
+import json
+import urllib.request
+import subprocess
+
+# get info
+json = json.loads(urllib.request.urlopen("https://dolphin-emu.org/update/latest/beta/").read())
+
+rev = json['shortrev'].split("-")
+hash = json['hash']
+hashshort = hash[:10]
+
+# update pkgbuild
+with open("PKGBUILD", "r") as file:
+ pkgbuild = file.readlines()
+
+pkgbuild[7] = "pkgver=" + rev[0] + ".r" + rev[1] + "." + hashshort + "\n"
+
+pkgbuild[23] = "source=('dolphin-emu::git+https://github.com/dolphin-emu/dolphin.git#commit=" + hash + "')" + "\n"
+
+with open("PKGBUILD", "w") as file:
+ file.writelines(pkgbuild)
+
+# update srcinfo
+# makepkg --printsrcinfo > .SRCINFO
+with open(".SRCINFO", "w") as file:
+ file.write(subprocess.check_output(["makepkg", "--printsrcinfo"]).decode("utf-8"))