summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeth Flynn <[email protected]>2021-01-18 10:59:59 -0500
committerSeth Flynn <[email protected]>2021-01-18 11:58:05 -0500
commit257e8a3c13c55ecc2806cfaf0af1839ff4d04928 (patch)
tree938718a0fa5f8b67e8f3648d803c60e2e82222a4
parent7e91afcf119f99bac8f97f818f6156c81631bc8e (diff)
initial commit of binaryv0.1.0
-rw-r--r--.gitignore5
-rw-r--r--Makefile10
-rw-r--r--README.md4
-rwxr-xr-xaur-update36
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
diff --git a/README.md b/README.md
index 74fdf02..f0e7093 100644
--- a/README.md
+++ b/README.md
@@ -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