Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/manual-fix44
1 files changed, 44 insertions, 0 deletions
diff --git a/bin/manual-fix b/bin/manual-fix
new file mode 100755
index 0000000..c057f92
--- /dev/null
+++ b/bin/manual-fix
@@ -0,0 +1,44 @@
+#!/bin/bash
+
+# shellcheck disable=SC2119,SC2120
+
+# shellcheck source=../lib/load-configuration
+#. "${0%/*}/../lib/load-configuration"
+
+_fix_package_on_build_and_deletion_list() {
+ {
+ 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() {
+ >&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"