index : builder | |
Archlinux32 build system | gitolite user |
summaryrefslogtreecommitdiff |
author | Erich Eckner <git@eckner.net> | 2018-02-06 13:48:56 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2018-02-06 13:48:56 +0100 |
commit | 86823d203d23536386d7c01356e2a5a6df810adf (patch) | |
tree | e38f0a57d53d1d4d83236a893533391872775124 /bin | |
parent | 3e99365e5fc1c608e60c0465eba520806060413b (diff) |
-rwxr-xr-x | bin/get-package-updates | 15 |
diff --git a/bin/get-package-updates b/bin/get-package-updates index f451991..180e0ae 100755 --- a/bin/get-package-updates +++ b/bin/get-package-updates @@ -104,15 +104,26 @@ delete_package() { sed -i "/^$(str_to_regex "${1}") /d" "${work_dir}/build-list.new" # shellcheck disable=SC2016 { + # packages from the build-list go straight to the deletion-list printf 'UPDATE `binary_packages`' printf ' JOIN `%s` ON `%s`.`id`=`binary_packages`.`%s`' \ 'repositories' 'repositories' 'repository' \ 'build_assignments' 'build_assignments' 'build_assignment' printf ' JOIN `%s` ON `%s`.`id`=`%s`.`%s`' \ 'package_sources' 'package_sources' 'build_assignments' 'package_source' - printf ' SET `binary_packages`.`is_to_be_deleted`=1' + printf ' SET `binary_packages`.`repository`=(SELECT `repositories`.`id` FROM `repositories` WHERE `repositories`.`name`="deletion-list")' printf ' WHERE `repositories`.`name`="build-list"' - printf ' AND `package_sources`.`pkgbase`=from_base64("%s");' \ + printf ' AND `package_sources`.`pkgbase`=from_base64("%s");\n' \ + "$(printf '%s' "$1" | base64 -w0)" + # other packages are marked as `is_to_be_deleted` + printf 'UPDATE `binary_packages`' + printf ' JOIN `%s` ON `%s`.`id`=`binary_packages`.`%s`' \ + 'repositories' 'repositories' 'repository' \ + 'build_assignments' 'build_assignments' 'build_assignment' + printf ' JOIN `%s` ON `%s`.`id`=`%s`.`%s`' \ + 'package_sources' 'package_sources' 'build_assignments' 'package_source' + printf ' SET `binary_packages`.`is_to_be_deleted`=1' + printf ' WHERE `package_sources`.`pkgbase`=from_base64("%s");' \ "$(printf '%s' "$1" | base64 -w0)" } | \ ${mysql_command} |