Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin/mysql-functions
diff options
context:
space:
mode:
Diffstat (limited to 'bin/mysql-functions')
-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