diff options
author | Erich Eckner <git@eckner.net> | 2018-02-05 16:27:05 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2018-02-05 16:27:05 +0100 |
commit | 29cd25770761c0cc6e056807789f32493470d550 (patch) | |
tree | e81809b931ca9cb9a60def57d803f35956f77f20 | |
parent | 34c524246f2257b9cc94668fa07412ed44b09f40 (diff) | |
download | builder-29cd25770761c0cc6e056807789f32493470d550.tar.xz |
bin/mysql-functions: add unknown packages whose pkgbase is identically found in the database
-rwxr-xr-x | bin/mysql-functions | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/bin/mysql-functions b/bin/mysql-functions index 1f2e882..3c02511 100755 --- a/bin/mysql-functions +++ b/bin/mysql-functions @@ -805,8 +805,21 @@ mysql_repair_binary_packages_without_build_assignment() { grep '"pkgname":\s*"'"$(str_to_regex "${pkgname}")"'"' | \ tr ',' '\n' | \ grep '"pkgbase":' | \ - cut -d'"' -f4 + cut -d'"' -f4 | \ + sort -u | \ + head -n1 ) + if [ -z "${pkgbase}" ] && \ + { + printf 'SELECT count(*) FROM `package_sources`' + printf ' WHERE `package_sources`.`pkgbase`=from_base64("%s")' \ + "$(printf '%s' "${pkgname}" | base64 -w0)" + } | \ + ${mysql_command} --raw --batch | \ + sed '1d' | \ + grep -vxF '0'; then + pkgbase="${pkgname}" + fi if [ -z "${pkgbase}" ]; then >&2 printf 'Could not find "%s" upstream.\n' "${pkgname}" continue |