From 12f0a85eccf4803af088399843fe915a598f3f20 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 31 Jan 2018 22:19:57 +0100 Subject: bin/build-master-status-from-mysql: check tested packages --- bin/build-master-status-from-mysql | 40 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'bin/build-master-status-from-mysql') 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,^-.*$,\0, -- cgit v1.2.3-54-g00ecf