From 571c771968611c942162fe5b3132c76ed51af146 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Mon, 22 Jan 2018 13:28:39 +0100 Subject: bin/bootstrap-mysql: initialize `fail_reasons`, too --- bin/bootstrap-mysql | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) (limited to 'bin/bootstrap-mysql') diff --git a/bin/bootstrap-mysql b/bin/bootstrap-mysql index 69bc015..1eb98a2 100755 --- a/bin/bootstrap-mysql +++ b/bin/bootstrap-mysql @@ -114,6 +114,7 @@ if [ ! "$1" = 'slim' ]; then ' UNIQUE directory' \ 'fail_reasons SMALLINT' \ ' name VARCHAR(32)' \ + ' identifier VARCHAR(64)' \ ' severity SMALLINT' \ ' UNIQUE name' \ 'failed_builds MEDIUMINT' \ @@ -121,7 +122,7 @@ if [ ! "$1" = 'slim' ]; then ' build_assignment BIGINT :build_assignments' \ ' date DATETIME' \ ' reason SMALLINT :fail_reasons' \ - ' log_file VARCHAR(128)' + ' log_file VARCHAR(512)' ) { @@ -232,6 +233,43 @@ fi sed 's|,$||' printf ';\n' # shellcheck disable=SC2016 + printf 'INSERT IGNORE INTO `fail_reasons` (`name`,`identifier`,`severity`) VALUES ' + printf '(from_base64("%s"),"%s",%s),' \ + "$( + printf '%s' '==> ERROR: A failure occurred in build()\.' | \ + base64 -w0 + )" 'build()' 0 \ + "$( + printf '%s' '==> ERROR: Could not download sources\.' | \ + base64 -w0 + )" 'source' 1 \ + "$( + printf '%s' '.*error: failed to commit transaction (invalid or corrupted package)' | \ + base64 -w0 + )" 'package-cache' 2 \ + "$( + printf '%s' '==> ERROR: A failure occurred in prepare()\.' | \ + base64 -w0 + )" 'prepare()' 2 \ + "$( + printf '%s' '==> ERROR: A failure occurred in package\(_\S\+\)\?()\.' | \ + base64 -w0 + )" 'package()' 3 \ + "$( + printf '%s' '==> ERROR: A failure occurred in check()\.' | \ + base64 -w0 + )" 'check()' 4 \ + "$( + printf '%s' '==> ERROR: '"'"'pacman'"'"' failed to install missing dependencies\.' | \ + base64 -w0 + )" 'dependencies' 1 \ + "$( + printf '%s' '==> ERROR: Running makepkg as root is not allowed as it can cause permanent,.*' | \ + base64 -w0 + )" 'run-as-root' 1 | \ + sed 's|,$||' + printf ';\n' + # shellcheck disable=SC2016 printf 'INSERT IGNORE INTO `git_repositories` (`name`,`url`,`directory`,`head`) VALUES' { for repo in ${repo_names}; do -- cgit v1.2.3-70-g09d2