index : builder | |
Archlinux32 build system | gitolite user |
summaryrefslogtreecommitdiff |
author | Erich Eckner <git@eckner.net> | 2018-06-07 15:23:26 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2018-06-07 15:23:26 +0200 |
commit | 06ff767c12b46a69af6839bfebac7d3c6c492389 (patch) | |
tree | fce7d67f71ca8e66925f3d7714fe68b18479f9d6 | |
parent | 53cc0f179f3be97bbdeeba794cbbef3d05d1b72c (diff) |
-rwxr-xr-x | bin/return-assignment | 43 |
diff --git a/bin/return-assignment b/bin/return-assignment index 3dee115..e8e998e 100755 --- a/bin/return-assignment +++ b/bin/return-assignment @@ -240,9 +240,9 @@ clean_up_lock_file() { } # shellcheck disable=SC2016 -infos=$( +build_assignment_id=$( { - printf 'SELECT DISTINCT `build_assignments`.`id`,`upstream_repositories`.`id` FROM `build_slaves`' + printf 'SELECT DISTINCT `build_assignments`.`id` FROM `build_slaves`' mysql_join_build_slaves_build_assignments mysql_join_build_assignments_package_sources mysql_join_package_sources_upstream_repositories @@ -255,28 +255,40 @@ infos=$( base64 -w0 )" 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)" + '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 '%s' "$4" | \ + base64 -w0 + )" printf ' AND `binary_packages_in_repositories`.`repository`=%s' \ "${repository_ids__any_build_list}" printf ' AND `binary_packages`.`sub_pkgrel`=from_base64("%s");\n' \ - "$(printf '%s' "$5" | base64 -w0)" + "$( + printf '%s' "$5" | \ + base64 -w0 + )" } | \ mysql_run_query | \ tr '\t' ' ' ) -if [ -z "${infos}" ]; then +if [ -z "${build_assignment_id}" ]; then >&2 echo 'Sorry, the sent package is outdated.' exit 2 fi -build_assignment_id="${infos%% *}" -upstream_repository_id="${infos##* }" - clean_up_tmp_dir() { cd "${base_dir}" rm -rf --one-file-system "${tmp_dir}" @@ -458,13 +470,16 @@ fi infos=$( { printf 'SELECT `t`.`id`,`t`.`name`' - printf ' FROM `repository_moves`' + printf ' FROM `build_assignments`' + mysql_join_build_assignments_package_sources + mysql_join_package_sources_upstream_repositories + mysql_join_upstream_repositories_repository_moves printf ' JOIN `repositories` as `t` ON `t`.`id`=`repository_moves`.`to_repository`' printf ' WHERE `repository_moves`.`from_repository`=%s' \ "${repository_ids__any_build_list}" - printf ' AND `repository_moves`.`upstream_package_repository`=from_base64("%s");\n' \ + printf ' AND `build_assignments`.`id`=from_base64("%s");\n' \ "$( - printf '%s' "${upstream_repository_id}" | \ + printf '%s' "${build_assignment_id}" | \ base64 -w0 )" } | \ |