diff options
| -rw-r--r-- | .gitignore | 5 | ||||
| -rw-r--r-- | Makefile | 10 | ||||
| -rw-r--r-- | README.md | 4 | ||||
| -rwxr-xr-x | aur-update | 36 |
4 files changed, 53 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..06a1497 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +pkg/ +src/ +*.gz +*.zst +PKGBUILD diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..8ec32ac --- /dev/null +++ b/Makefile @@ -0,0 +1,10 @@ +PREFIX ?= $(HOME)/.local + +all: + @echo "run 'make install' to install." + +install: + @install -Dm755 aur-update $(DESTDIR)$(PREFIX)/bin/aur-update + +uninstall: + @rm -rf $(DESTDIR)$(PREFIX)/bin/aur-update @@ -3,8 +3,8 @@ the sole command is : ``aur-update [VERSION NUMBER] [TARBALL URL]`` -this updates the version number, release number, source url, and md5sum, allowing for a quick way to update the PKGBUILDS you maintain whenever a new upstream release is made. +this updates the version number, release number, source url, and checksums, allowing for a quick way to update the PKGBUILDS you maintain whenever a new upstream release is made. for example: -``aur-update 0.1.0 'https://github.com/getchoo/aur-update/archive/0.1.0.tar.gz`` +``aur-update 0.1.0 'https://github.com/getchoo/aur-update/archive/0.1.0.tar.gz'`` diff --git a/aur-update b/aur-update new file mode 100755 index 0000000..bc82570 --- /dev/null +++ b/aur-update @@ -0,0 +1,36 @@ +#!/bin/sh + +if [ $# -eq 0 ] +then + echo "no arguments" + exit +fi + +OLDREL="$(grep "pkgrel" PKGBUILD | sed -En "s/pkgrel=//p")" +REL="$(expr 1 + $OLDREL)" +MD5SUM="$(curl -sL $2 | md5sum | cut -d ' ' -f 1)" +MD5="('$MD5SUM')" +SHA1SUM="$(curl -sL $2 | sha1sum | cut -d ' ' -f 1)" +SHA1="('$SHA1SUM')" +SHA256SUM="$(curl -sL $2 | sha256sum | cut -d ' ' -f 1)" +SHA256="('$SHA256SUM')" +SHA224SUM="$(curl -sL $2 | sha224sum | cut -d ' ' -f 1)" +SHA224="('$SHA224SUM')" +SHA384SUM="$(curl -sL $2 | sha384sum | cut -d ' ' -f 1)" +SHA384="('$SHA384SUM')" +SHA512SUM="$(curl -sL $2 | sha512sum | cut -d ' ' -f 1)" +SHA512="('$SHA512SUM')" +B2SUM="$(curl -sL $2 | b2sum | cut -d ' ' -f 1)" +B2="('$B2SUM')" +SOURCE="('$2')" + +sed -i "s/pkgver=.*/pkgver=$1/" PKGBUILD +sed -i "s/pkgrel=.*/pkgrel=$REL/" PKGBUILD +sed -i "s/md5sums=.*/md5sums=$MD5/" PKGBUILD +sed -i "s/sha1sums=.*/sha1sums=$SHA1/" PKGBUILD +sed -i "s/sha256sums=.*/sha256sums=$SHA256/" PKGBUILD +sed -i "s/sha224sums=.*/sha224sums=$SHA224/" PKGBUILD +sed -i "s/sha384sums=.*/sha384sums=$SHA384/" PKGBUILD +sed -i "s/sha512sums=.*/sha512sums=$SHA512/" PKGBUILD +sed -i "s/b2sums=.*/b2sums=$B2/" PKGBUILD +sed -i "s|source=.*|source=$SOURCE|" PKGBUILD |
