Add Helmut's lovely UDD script
authorSteve McIntyre <steve@einval.com>
Thu, 20 Dec 2018 17:20:05 +0000 (17:20 +0000)
committerSteve McIntyre <steve@einval.com>
Thu, 20 Dec 2018 17:20:05 +0000 (17:20 +0000)
bin/udd-bugs.sh [new file with mode: 0755]

diff --git a/bin/udd-bugs.sh b/bin/udd-bugs.sh
new file mode 100755 (executable)
index 0000000..686a68a
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/sh
+#
+# Script from Helmut - check UDD for FTBFS bugs and print some details
+
+udd() {
+        PGPASSWORD=udd-mirror psql --host=udd-mirror.debian.net --user=udd-mirror udd "$@"
+}
+
+udd -c "\\COPY (SELECT id, package, affected_packages, title FROM all_bugs WHERE (EXISTS (SELECT 1 FROM bugs_tags WHERE bugs_tags.id = all_bugs.id AND tag = 'ftbfs') OR (title LIKE '%FTBFS%' AND package LIKE 'src:%')) AND severity IN ('serious', 'critical', 'grave') AND affects_unstable = 't') TO STDOUT WITH CSV DELIMITER '_';" |
+while IFS='_' read bugnum pkg affects title; do
+        affects="${affects#\"}"
+        affects="${affects%\"}"
+        case "$pkg" in
+                src:*)
+                        source=${pkg#src:}
+                        echo "$source $bugnum $title"
+                ;;
+                *)
+                        echo "$affects" | tr ',' '\n' | while read affected; do
+                                test -z "$affected" && continue
+                                source=${affected#src:}
+                                test "$affected" = "$source" && continue
+                                echo "$source $bugnum $title"
+                        done
+                ;;
+        esac
+done | sort