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:
authorErich Eckner <git@eckner.net>2023-03-28 08:25:13 +0200
committerErich Eckner <git@eckner.net>2023-03-28 08:25:13 +0200
commit08b7d94d1c2d3736b99b97693486fe189bf7d9e1 (patch)
treec072b7919781176bc8325fac83248a3d136e0661 /bin/manual-fix
parent6110f48a678a2c1a536d8ef4c08f307873df0fc1 (diff)
bin/manual-fix new
Diffstat (limited to 'bin/manual-fix')
-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"