Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin/harvest-commit-times
diff options
context:
space:
mode:
authorErich Eckner <erich.eckner.ext@bestsecret.com>2023-05-22 11:07:15 +0200
committerErich Eckner <erich.eckner.ext@bestsecret.com>2023-05-22 11:07:15 +0200
commit63c30a7ba2b3177cc1b74b36c7a437d653d12497 (patch)
tree2e8ad095edbedc7a6fe74995f4e3064d95f17944 /bin/harvest-commit-times
parentc7c582eabd2b133ba561de49982e21d5f3cae914 (diff)
fix harvest-commit-times:
* new git structure
Diffstat (limited to 'bin/harvest-commit-times')
-rwxr-xr-xbin/harvest-commit-times44
1 files changed, 21 insertions, 23 deletions
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 '.'