index : builder | |
Archlinux32 build system | gitolite user |
summaryrefslogtreecommitdiff |
author | Erich Eckner <git@eckner.net> | 2022-09-28 18:25:17 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2022-09-28 18:25:17 +0200 |
commit | aca3ba055ae3a9d012e3dc8c7d159b19996c8814 (patch) | |
tree | cb54b2326f93c1b14e74077122a18405ad83c0c2 /lib/common-functions | |
parent | aa166d81abc3be5eb8949cc309755a22c0581c5e (diff) |
-rwxr-xr-x | lib/common-functions | 35 |
diff --git a/lib/common-functions b/lib/common-functions index eb61e9e..cecd27f 100755 --- a/lib/common-functions +++ b/lib/common-functions @@ -521,7 +521,40 @@ find_package_repository_to_package() { "${git_repository}" \ "${git_commit}" >&2 printf '%s\n' "${repo}" - return 1 + >&2 printf 'trying to filter based on git\n' + + if ! repo=$( + { + printf 'SELECT `upstream_repositories`.`name`' + printf ' FROM `upstream_repositories`' + mysql_join_upstream_repositories_git_repositories + printf ' WHERE `git_repositories`.`name`=from_base64("%s")' \ + "$( + printf '%s' "${git_repository}" \ + | base64 -w0 + )" + } | \ + mysql_run_query 'unimportant' | \ + grep -xF "${repo}" + ); then + >&2 printf 'find_package_repository_to_package %s %s %s: no repo found after filtering\n' \ + "${package}" \ + "${git_repository}" \ + "${git_commit}" + return 1 + fi + + if [ "$( + echo "${repo}" | \ + wc -l + )" -ne 1 ]; then + >&2 printf 'find_package_repository_to_package %s %s %s: still multiple repos found after filter:\n' \ + "${package}" \ + "${git_repository}" \ + "${git_commit}" + >&2 printf '%s\n' "${repo}" + return 1 + fi fi echo "${repo}" |