Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-02-11 20:45:42 +0100
committerErich Eckner <git@eckner.net>2018-02-11 20:45:42 +0100
commit9252ad4a7f3dbabf9b6c0e59219d94f3b1066a25 (patch)
tree82fd529f846f8a6f7677430a74629bef4b564609
parent1ed82cccb9c46a715f033e1f83a7681b2d819d90 (diff)
bin/return-assignment: check expected packages from database
-rwxr-xr-xbin/return-assignment33
1 files changed, 25 insertions, 8 deletions
diff --git a/bin/return-assignment b/bin/return-assignment
index 01a20c8..9dd7a2b 100755
--- a/bin/return-assignment
+++ b/bin/return-assignment
@@ -373,16 +373,33 @@ package_errors=$(
# shellcheck disable=SC2086
printf '%s\n' ${packages} | \
sed '
- s@\(-[^-]\+\)\{2\}-\([^-]\+\)\.pkg\.tar\.xz$@ \2@
- / any$/{
- s|any$|i686|
- }
s|^|was_built: |
'
- sed '
- s|$| i686|
- s|^|expected: |
- ' "${work_dir}/package-infos/$1.$2.$3.$4.packages"
+ # shellcheck disable=SC2016
+ {
+ printf 'SELECT CONCAT('
+ printf '"expected: ",'
+ printf '`binary_packages`.`pkgname`,"-",'
+ printf 'if(`binary_packages`.`epoch`=0,"",CONCAT(`binary_packages`.`epoch`,":")),'
+ printf '`binary_packages`.`pkgver`,"-",'
+ printf '`binary_packages`.`pkgrel`,".",'
+ printf '`binary_packages`.`sub_pkgrel`,"-",'
+ printf '`architectures`.`name`,".pkg.tar.xz"'
+ printf ')'
+ printf ' FROM `binary_packages`'
+ printf ' JOIN `architectures` ON `architectures`.`id`=`binary_packages`.`architecture`'
+ printf ' JOIN `build_slaves` ON `build_slaves`.`currently_building`=`binary_packages`.`build_assignment`'
+ printf ' WHERE `build_slaves`.`name`=from_base64("%s")' \
+ "$(
+ printf '%s' "${slave}" | \
+ base64 -w0
+ )"
+ printf ';\n'
+ } | \
+ ${mysql_command} --raw --batch | \
+ sed '
+ 1d
+ '
} | \
sort -k2 | \
uniq -u -f1