From 63c30a7ba2b3177cc1b74b36c7a437d653d12497 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Mon, 22 May 2023 11:07:15 +0200 Subject: fix harvest-commit-times: * new git structure --- bin/harvest-commit-times | 44 +++++++++++++++++++++----------------------- 1 file changed, 21 insertions(+), 23 deletions(-) (limited to 'bin/harvest-commit-times') diff --git a/bin/harvest-commit-times b/bin/harvest-commit-times index 7546aa4..0501fc5 100755 --- a/bin/harvest-commit-times +++ b/bin/harvest-commit-times @@ -91,37 +91,35 @@ while true; do printf '`package_sources`.`git_revision`,' printf '`package_sources`.`mod_git_revision`,' printf '`upstream_repositories`.`name`,' - printf '`git_repositories`.`name`' + printf 'IF(`build_assignments`.`architecture`=%s,"any","x86_64")' "${architecture_ids__any}" printf ' FROM `package_sources`' mysql_join_package_sources_upstream_repositories - mysql_join_upstream_repositories_git_repositories + mysql_join_package_sources_build_assignments printf ' WHERE `package_sources`.`commit_time`="0000-00-00 00:00:00"' printf ' AND `package_sources`.`uses_upstream`' if ! ${i_am_the_master}; then printf ' ORDER BY RAND()' fi printf ' LIMIT 10' - } | \ - mysql_run_query 'unimportant' | \ - sponge | \ - while read -r id pkgbase git_revision mod_git_revision repository git_repository; do - eval 'git_directory="${repo_paths__'"${git_repository}"'}"' - find_pkgbuilds "${pkgbase}" "${repository}" "${git_repository}" "${git_revision}" "${mod_git_revision}" - commit_time=$( - # shellcheck disable=SC2154 - git -C "${git_directory}" log -n 1 --pretty=format:%ct "${git_revision}" -- "${PKGBUILD}" - ) - if [ -n "${commit_time}" ]; then - printf '%s\t%s\n' \ - "${id}" \ - "${commit_time}" - else - >&2 printf 'Package source %s is not available in git.\n' \ - "${id}" - exit 2 - fi - done > \ - "${tmp_file}" + } \ + | mysql_run_query 'unimportant' \ + | sponge \ + | while read -r id pkgbase git_revision mod_git_revision repository architecture; do + commit_time=$( + # shellcheck disable=SC2154 + git -C "${repo_paths__state}" log -n 1 --pretty=format:%ct "${repository}-${architecture}/${pkgbase}" + ) + if [ -n "${commit_time}" ]; then + printf '%s\t%s\n' \ + "${id}" \ + "${commit_time}" + else + >&2 printf 'Package source %s is not available in git.\n' \ + "${id}" + exit 2 + fi + done > \ + "${tmp_file}" >&2 printf '.' -- cgit v1.2.3-54-g00ecf