diff options
author | Erich Eckner <git@eckner.net> | 2018-07-19 10:02:18 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2018-07-19 10:02:18 +0200 |
commit | ef40561a3c463328e86d94397df1e88372778c49 (patch) | |
tree | bb1c994b4a58868b55af48a92db11690ae26ff63 /bin | |
parent | b0a1c7e0aff57ff754929b7508203eec9e80a092 (diff) | |
download | builder-ef40561a3c463328e86d94397df1e88372778c49.tar.xz |
mark packages without bug reports as tested after some time (default: 2 weeks)
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/db-update | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/bin/db-update b/bin/db-update index f09db2d..0f261fa 100755 --- a/bin/db-update +++ b/bin/db-update @@ -117,6 +117,27 @@ if ! ${no_action}; then >&2 echo 'come back (shortly) later - sanity-check currently running.' exit 0 fi + + # shellcheck disable=SC2016 + { + printf 'UPDATE `binary_packages`' + printf ' JOIN (' + printf 'SELECT `binary_packages_in_repositories`.`package`,' + printf 'MIN(`binary_packages_in_repositories`.`last_moved`) AS `first_last_moved`' + printf ' FROM `binary_packages_in_repositories`' + printf ' GROUP BY `binary_packages_in_repositories`.`package`' + printf ') AS `binary_packages_in_repositories`' + printf ' ON `binary_packages_in_repositories`.`package`=`binary_packages`.`id`' + printf ' SET `binary_packages`.`is_tested`=1' + printf ' WHERE NOT `binary_packages`.`has_issues`' + printf ' AND NOT `binary_packages`.`is_tested`' + printf ' AND `binary_packages_in_repositories`.`first_last_moved`<ADDDATE(NOW(),from_base64("%s"))' \ + "$( + printf -- '-%s' "${max_testing_duration}" | \ + base64 -w0 + )" + } | \ + mysql_run_query fi # Create tmp_dir and trap. |