diff options
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. |