Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin/manual-fix
diff options
context:
space:
mode:
Diffstat (limited to 'bin/manual-fix')
-rwxr-xr-xbin/manual-fix55
1 files changed, 55 insertions, 0 deletions
diff --git a/bin/manual-fix b/bin/manual-fix
new file mode 100755
index 0000000..f9cc7b9
--- /dev/null
+++ b/bin/manual-fix
@@ -0,0 +1,55 @@
+#!/bin/bash
+
+# shellcheck disable=SC2119,SC2120
+
+# shellcheck source=../lib/load-configuration
+. "${0%/*}/../lib/load-configuration"
+
+eval "$(
+ declare -F \
+ | sed '
+ s@^declare -f _fix_@unset _fix_@
+ t
+ d
+ '
+)"
+
+_fix_package_on_build_and_deletion_list() {
+ # shellcheck disable=SC2016
+ {
+ printf 'DELETE `bin_del`'
+ printf ' FROM `binary_packages` AS `bin_del`'
+ mysql_join_binary_packages_binary_packages_in_repositories 'bin_del' 'bir_del'
+ mysql_join_binary_packages_in_repositories_repositories 'bir_del' 'r_del'
+ printf ' AND `r_del`.`name`="deletion-list"'
+ printf ' JOIN `binary_packages` AS `bin_keep`'
+ printf ' ON `bin_keep`.`pkgname`=`bin_del`.`pkgname`'
+ printf ' AND `bin_del`.`architecture`=`bin_keep`.`architecture`'
+ printf ' AND `bin_del`.`id`!=`bin_keep`.`id`'
+ printf ' AND `bin_keep`.`sha512sum` IS NULL'
+ mysql_join_binary_packages_binary_packages_in_repositories 'bin_keep' 'bir_keep'
+ mysql_join_binary_packages_in_repositories_repositories 'bir_keep' 'r_keep'
+ printf ' AND `r_keep`.`name`="build-list"'
+ } \
+ | mysql_run_query
+}
+
+usage() {
+ # shellcheck disable=SC2016
+ >&2 printf 'usage: %s $issue\n\n' "${0##*/}"
+ >&2 printf 'Manually fix an issue.\n\n'
+ >&2 printf 'fixable issues:\n'
+ declare -F \
+ | sed '
+ s@^declare -f _fix_@ @
+ t
+ d
+ ' >&2
+ exit 1
+}
+
+if [ $# -ne 1 ] || ! declare -f "_fix_$1" >/dev/null; then
+ usage
+fi
+
+eval "_fix_$1"