index : builder | |
Archlinux32 build system | gitolite user |
summaryrefslogtreecommitdiff |
-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}" |