summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-02-05 16:27:05 +0100
committerErich Eckner <git@eckner.net>2018-02-05 16:27:05 +0100
commit29cd25770761c0cc6e056807789f32493470d550 (patch)
treee81809b931ca9cb9a60def57d803f35956f77f20 /bin
parent34c524246f2257b9cc94668fa07412ed44b09f40 (diff)
downloadbuilder-29cd25770761c0cc6e056807789f32493470d550.tar.xz
bin/mysql-functions: add unknown packages whose pkgbase is identically found in the database
Diffstat (limited to 'bin')
-rwxr-xr-xbin/mysql-functions15
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