Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin/build-master-status-from-mysql
diff options
context:
space:
mode:
Diffstat (limited to 'bin/build-master-status-from-mysql')
-rwxr-xr-xbin/build-master-status-from-mysql40
1 files changed, 40 insertions, 0 deletions
diff --git a/bin/build-master-status-from-mysql b/bin/build-master-status-from-mysql
index b1bbb98..44e07c1 100755
--- a/bin/build-master-status-from-mysql
+++ b/bin/build-master-status-from-mysql
@@ -72,6 +72,42 @@ find "${work_dir}/build-list.loops" -regextype grep -mindepth 1 -maxdepth 1 \
sort > \
"${tmp_dir}/loops.file"
+# shellcheck disable=SC2016
+{
+ printf 'SELECT '
+ printf '`binary_packages`.`%s`,' \
+ 'pkgname' \
+ 'epoch' \
+ 'pkgver' \
+ 'pkgrel' \
+ 'sub_pkgrel'
+ printf '`architectures`.`name`'
+ printf ' FROM `binary_packages`'
+ printf ' JOIN `%s` ON `%s`.`id`=`%s`.`%s`' \
+ 'repositories' 'repositories' 'binary_packages' 'repository' \
+ 'architectures' 'architectures' 'binary_packages' 'architecture' \
+ 'repository_stabilities' 'repository_stabilities' 'repositories' 'stability'
+ printf ' WHERE `binary_packages`.`is_tested`'
+ printf ' AND NOT `binary_packages`.`has_issues`'
+ printf ' AND `repository_stabilities`.`name`="testing"'
+} | \
+ ${mysql_command} --batch | \
+ sed '
+ 1d
+ s/^\(\S\+\)\s\(\S\+\)\s\(\S\+\)\s\(\S\+\)\s\(\S\+\)\s\(\S\+\)$/\1-\2:\3-\4.\5-\6.pkg.tar.xz/
+ ' | \
+ sort -u > \
+ "${tmp_dir}/tested.mysql"
+find "${work_dir}/package-states" -mindepth 1 -maxdepth 1 \
+ -name '*.tested' \
+ -exec cat '{}' \; | \
+ sed '
+ s/-\([^-.]\+\)\(-[^-]\+\)$/-\1.0-\2/
+ s/-\([^-:]\+\)\(\(-[^-]\+\)\{2\}\)$/-0:\1\2/
+ ' | \
+ sort -u > \
+ "${tmp_dir}/tested.file"
+
{
mysql_sanity_check || true
diff -u \
@@ -86,6 +122,10 @@ find "${work_dir}/build-list.loops" -regextype grep -mindepth 1 -maxdepth 1 \
"${tmp_dir}/loops.file" \
"${tmp_dir}/loops.mysql" || \
true
+ diff -u \
+ "${tmp_dir}/tested.file" \
+ "${tmp_dir}/tested.mysql" || \
+ true
} | \
sed '
s,^-.*$,<font color="#FF0000">\0</font>,