Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin/get-assignment
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-02-14 23:48:30 +0100
committerErich Eckner <git@eckner.net>2018-02-14 23:48:30 +0100
commitb4eb9d2dcda28b0107b0bde28f4f4426bb08af05 (patch)
tree9d775a405e5ea42322cece2141357afb7d159e6e /bin/get-assignment
parentfcb02682d01c6a39d9313897bc43dfe566188f15 (diff)
bin/get-assignment: do not use next_sub_pkgrel, but take info straight from database
Diffstat (limited to 'bin/get-assignment')
-rwxr-xr-xbin/get-assignment33
1 files changed, 27 insertions, 6 deletions
diff --git a/bin/get-assignment b/bin/get-assignment
index 67c7aa4..a7eec2d 100755
--- a/bin/get-assignment
+++ b/bin/get-assignment
@@ -22,11 +22,6 @@ mkdir -p "${work_dir}/package-states"
hand_out_assignment() {
- # find out the sub_pkgrel
- sub_pkgrel=$(
- next_sub_pkgrel "$1" "$2" "$3" "$4"
- )
-
# we don't care anymore if an older version of this package was
# "locked" or "broken"
find "${work_dir}/package-states" -maxdepth 1 -regextype grep \
@@ -43,7 +38,33 @@ hand_out_assignment() {
$ a '"$1 $2 $3 $4" \
"${work_dir}/build-list"
- echo "$1 $2 $3 $4 ${sub_pkgrel}"
+ # shellcheck disable=SC2016
+ {
+ printf 'SELECT '
+ printf '`package_sources`.`%s`,' \
+ 'pkgbase' 'git_revision' 'mod_git_revision'
+ printf '`upstream_repositories`.`name`,`binary_packages`.`sub_pkgrel`'
+ printf ' FROM `upstream_repositories`'
+ printf ' JOIN `%s` ON `%s`.`%s`=`%s`.`id`' \
+ 'package_sources' 'package_sources' 'upstream_package_repository' 'upstream_repositories' \
+ 'build_assignments' 'build_assignments' 'package_source' 'package_sources' \
+ 'binary_packages' 'binary_packages' 'build_assignment' 'build_assignments' \
+ 'repositories' 'binary_packages' 'repository' 'repositories'
+ printf ' WHERE `repositories`.`name`="build-list"'
+ printf ' AND `package_sources`.`%s`=from_base64("%s")' \
+ 'pkgbase' "$(printf '%s' "$1" | base64 -w0)" \
+ 'git_revision' "$(printf '%s' "$2" | base64 -w0)" \
+ 'mod_git_revision' "$(printf '%s' "$3" | base64 -w0)"
+ printf ' AND `upstream_repositories`.`name`=from_base64("%s")' \
+ "$(printf '%s' "$4" | base64 -w0)"
+ printf ' LIMIT 1;\n'
+ } | \
+ ${mysql_command} --raw --batch | \
+ sed '
+ 1d
+ y/\t/ /
+ '
+
{
# shellcheck disable=SC2154
echo "${slave}"