summarylogtreecommitdiffstats
path: root/auto-update.sh
diff options
context:
space:
mode:
Diffstat (limited to 'auto-update.sh')
-rwxr-xr-xauto-update.sh32
1 files changed, 32 insertions, 0 deletions
diff --git a/auto-update.sh b/auto-update.sh
new file mode 100755
index 000000000000..622f1cc18942
--- /dev/null
+++ b/auto-update.sh
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+if [[ $# -ne 1 ]]
+then
+ echo "Usage: './auto-update.sh <version>"
+ exit 0
+fi
+
+VERSION=$1
+
+echo "Auto-updating version $VERSION..."
+
+echo "Downloading new package..."
+wget https://github.com/vim/vim/archive/v$VERSION.tar.gz
+
+SHA1SUM=`sha1sum v$VERSION.tar.gz | awk '{ print $1 }'`
+echo "sha1sum is $SHA1SUM"
+
+echo "Generate new PKGBUILD"
+cp PKGBUILD.template PKGBUILD
+sed -i "s/__VERSION__/$VERSION/g" PKGBUILD
+sed -i "s/__SHA1SUM__/$SHA1SUM/g" PKGBUILD
+
+echo "Updating .SRCINFO"
+makepkg --printsrcinfo > .SRCINFO
+
+echo "Commit files"
+git add .SRCINFO PKGBUILD
+git commit -m "vim-runtime version $VERSION"
+
+echo "clean-up"
+rm -v v$VERSION.tar.gz