summaryrefslogtreecommitdiff
path: root/bin/manage-fail-reasons
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2019-08-10 19:42:10 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2019-08-10 19:42:10 +0200
commit6386880670fe668a98b8e18f46d54f690818aafa (patch)
tree0215b2db41277657d9b0b3a9f4e50cd17ac9ceca /bin/manage-fail-reasons
parentd6a60390b4ce8ea3bd9a995ef54089b3bcf2ed26 (diff)
downloadbuilder-6386880670fe668a98b8e18f46d54f690818aafa.tar.xz
manage-fail-reasons: make it check urls and files
Diffstat (limited to 'bin/manage-fail-reasons')
-rwxr-xr-xbin/manage-fail-reasons14
1 files changed, 12 insertions, 2 deletions
diff --git a/bin/manage-fail-reasons b/bin/manage-fail-reasons
index bc7c5bc..f110889 100755
--- a/bin/manage-fail-reasons
+++ b/bin/manage-fail-reasons
@@ -10,7 +10,7 @@ usage() {
>&2 echo ''
>&2 echo 'possible actions:'
>&2 echo ' list list installed fail reasons'
- >&2 echo ' check <build-log> check a build log for fail reasons'
+ >&2 echo ' check <build-log> check a build log for fail reasons (file or URL)'
exit 1
}
@@ -36,11 +36,21 @@ case "$1" in
;;
'check')
shift
- filelog="$1"
if [ $# -ne 1 ]; then
>&2 printf '"check" expects 1 parameter (a path to a build log), %s were given\n' "$#"
usage
fi
+ case "$1" in
+ http*)
+ tmp_file=$(mktemp 'tmp.manage-fail-reasons.XXXXXXXXXX' --tmpdir)
+ trap 'rm "${tmp_file}"' EXIT
+ wget -q -O "$tmp_file" "$1"
+ filelog="$tmp_file"
+ ;;
+ *)
+ filelog="$1"
+ ;;
+ esac
fail_reason_identifiers=$(
{
printf 'SELECT id,severity,replace(to_base64(`fail_reasons`.`identifier`),"\\n","")'