summaryrefslogtreecommitdiff
path: root/bin/manage-fail-reasons
diff options
context:
space:
mode:
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","")'