summarylogtreecommitdiffstats
path: root/update_version.sh
diff options
context:
space:
mode:
Diffstat (limited to 'update_version.sh')
-rwxr-xr-xupdate_version.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/update_version.sh b/update_version.sh
new file mode 100755
index 000000000000..e698d3be8e46
--- /dev/null
+++ b/update_version.sh
@@ -0,0 +1,31 @@
+#!/bin/bash
+set -euxo pipefail
+
+PKG="deepin-wine-helper"
+REPO="https://community-store-packages.deepin.com/appstore/dists/eagle/appstore/binary-i386/Packages"
+
+# Get latest version
+VER=$(curl -sSf ${REPO} |
+ grep -A13 "Package: ${PKG}" |
+ awk '/Version/{print $2}')
+
+# Insert latest version into PKGBUILD and update hashes
+sed -i \
+ -e "s/^_pkgver=.*/_pkgver=${VER}/" \
+ PKGBUILD
+
+# Check whether this changed anything
+if (git diff --exit-code PKGBUILD); then
+ echo "Package ${PKG} has most recent version ${VER}"
+ exit 0
+fi
+
+# updpkgsums
+makepkg -g
+
+# # Update .SRCINFO
+# makepkg --printsrcinfo >.SRCINFO
+
+# # Commit changes
+# git add PKGBUILD .SRCINFO
+# git commit -m "${PKG} v${VER}"