summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorTechcable2023-10-01 18:18:47 -0700
committerTechcable2023-10-01 18:18:47 -0700
commit1dfd03e669b34cfed360b6a4fb38c31db75f1a60 (patch)
tree771b0d16b4da6c5e29883806aea7357e879e53bc
parent377f6aca604de0353b99078ec8a10412756dae7a (diff)
downloadaur-1dfd03e669b34cfed360b6a4fb38c31db75f1a60.tar.gz
Give prettier error messages
-rw-r--r--PKGBUILD8
1 files changed, 6 insertions, 2 deletions
diff --git a/PKGBUILD b/PKGBUILD
index e815cfbbcac6..f68aa9fca4fc 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -41,6 +41,10 @@ warning() {
echo -en "\e[33;1mWARNING\e[0m: " >&2;
echo "$@" >&2;
}
+error() {
+ echo -en "\e[31;1mERROR\e[0m: " >&2;
+ echo "$@" >&2;
+}
pkgver() {
local index_file="${srcdir}/zig-version-index.json";
@@ -76,12 +80,12 @@ prepare() {
echo "" >&2;
local actual_hash="$(sha256sum "$newfile" | grep -oE '^\w+')"
if [[ "$expected_hash" != "$actual_hash" ]]; then
- echo "ERROR: Expected hash $expected_hash for $newfile, but got $actual_hash" >&2;
+ error "Expected hash $expected_hash for $newfile, but got $actual_hash" >&2;
exit 1;
fi;
echo "Using minisign to check signature";
if ! minisign -V -P "$ZIG_MINISIGN_KEY" -m "$newfile" -x "$newfile_sig"; then
- echo "ERROR: Failed to check signature for $newfile" >&2;
+ error "Failed to check signature for $newfile" >&2;
exit 1;
fi
echo "Extracting file";