Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rwxr-xr-xlib/mysql-functions71
1 files changed, 0 insertions, 71 deletions
diff --git a/lib/mysql-functions b/lib/mysql-functions
index 7559197..8947dbc 100755
--- a/lib/mysql-functions
+++ b/lib/mysql-functions
@@ -952,77 +952,6 @@ mysql_query_select_pkgbase_and_revision() {
mysql_join_package_sources_upstream_repositories
}
-# mysql_repair_binary_packages_without_build_assignment
-# try to generate valid build assignments to binary packages without
-# a valid one yet
-mysql_repair_binary_packages_without_build_assignment() {
- {
- printf 'SELECT '
- printf '`binary_packages`.`id`'
- printf ',replace(to_base64(%s),"\\n","")' \
- '`binary_packages`.`pkgname`' \
- '`architectures`.`name`'
- printf ' FROM `binary_packages`'
- mysql_join_binary_packages_architectures
- printf ' WHERE `binary_packages`.`build_assignment`<0'
- } | \
- mysql_run_query | \
- while read -r id pkgname arch; do
- pkgname=$(
- printf '%s' "${pkgname}" | \
- base64 -d
- )
- pkgbase=$(
- curl -Ss "$(
- printf 'https://www.archlinux.org/packages/search/json/?name=%s' \
- "${pkgname}"
- )" | \
- sed '
- s/^.*"results":\s*\[//
- s/}\s*,\s*{/\n/g
- ' | \
- grep '"pkgname":\s*"'"$(str_to_regex "${pkgname}")"'"' | \
- tr ',' '\n' | \
- grep '"pkgbase":' | \
- 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_run_query | \
- grep -qvxF '0'; then
- pkgbase="${pkgname}"
- fi
- if [ -z "${pkgbase}" ]; then
- >&2 printf 'Could not find "%s" upstream.\n' "${pkgname}"
- continue
- fi
- pkgbase=$(
- printf '%s' "${pkgbase}" | \
- base64 -w0
- )
- printf 'INSERT IGNORE INTO `build_assignments` (`package_source`,`architecture`,`is_blocked`,`is_broken`,`priority`)'
- printf ' SELECT `package_sources`.`id`,`architectures`.`id`,0,0,0'
- printf ' FROM `package_sources`'
- printf ' JOIN `architectures`'
- printf ' WHERE `package_sources`.`pkgbase`=from_base64("%s")' "${pkgbase}"
- printf ' AND `architectures`.`name`=from_base64("%s")' "${arch}"
- printf ' LIMIT 1;\n'
- printf 'UPDATE `binary_packages`'
- printf ' JOIN `build_assignments`'
- mysql_join_binary_packages_build_assignments
- printf ' SET `binary_packages`.`build_assignment`=`build_assignments`.`id`'
- printf ' WHERE `binary_packages`.`id`=%s' "${id}"
- printf ' AND `package_sources`.`pkgbase`=from_base64("%s");\n' "${pkgbase}"
- done | \
- mysql_run_query
-}
-
# mysql_package_name_query
# print a mysql query of the full name of a package file