summarylogtreecommitdiffstats
path: root/pkgsum.sh
diff options
context:
space:
mode:
Diffstat (limited to 'pkgsum.sh')
-rwxr-xr-xpkgsum.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/pkgsum.sh b/pkgsum.sh
new file mode 100755
index 00000000000..e908ad35301
--- /dev/null
+++ b/pkgsum.sh
@@ -0,0 +1,15 @@
+#!/usr/bin/env bash
+
+#taken from https://bbs.archlinux.org/viewtopic.php?id=131666 by falconindy
+awk -v newsums="$(makepkg -g)" '
+BEGIN {
+ if (!newsums) exit 1
+}
+
+/^[[:blank:]]*(md|sha)[[:digit:]]+sums=/,/\)[[:blank:]]*$/ {
+ if (!i) print newsums; i++
+ next
+}
+
+1
+' PKGBUILD > PKGBUILD.new && mv PKGBUILD{.new,} \ No newline at end of file