index : builder | |
Archlinux32 build system | gitolite user |
summaryrefslogtreecommitdiff |
author | Erich Eckner <git@eckner.net> | 2018-09-12 15:56:52 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2018-09-12 15:56:52 +0200 |
commit | 525dddfd2460e3a442fcb1af95e44f47bb69a369 (patch) | |
tree | cce0c8302d44e66be6cdee8856df6ff34280933f | |
parent | 242f91330dc780dffa485226990f7f7f726199cc (diff) |
-rwxr-xr-x | bin/get-package-updates | 2 | ||||
-rwxr-xr-x | bin/seed-build-list | 3 | ||||
-rwxr-xr-x | lib/mysql-functions | 34 |
diff --git a/bin/get-package-updates b/bin/get-package-updates index fe9fee7..94f58cb 100755 --- a/bin/get-package-updates +++ b/bin/get-package-updates @@ -599,6 +599,8 @@ echo 'Done - mark decisions as final.' "${repository_ids__any_build_list}" printf ' WHERE `binary_packages_in_repositories`.`repository`=%s;\n' \ "${repository_ids__any_to_be_decided}" + # remove duplicate binary_packages from "build-list" + mysql_query_remove_old_binary_packages_from_build_list } | \ mysql_run_query diff --git a/bin/seed-build-list b/bin/seed-build-list index f1ce16b..432ef6c 100755 --- a/bin/seed-build-list +++ b/bin/seed-build-list @@ -591,6 +591,9 @@ if ${update}; then mysql_join_binary_packages_binary_packages_in_repositories 'a_bp' 'a_bpir' printf ' AND `a_bpir`.`repository`=%s;\n' \ "${repository_ids__any_build_list}" + + # remove duplicate binary_packages from "build-list" + mysql_query_remove_old_binary_packages_from_build_list } | \ mysql_run_query diff --git a/lib/mysql-functions b/lib/mysql-functions index 972f227..17b34f6 100755 --- a/lib/mysql-functions +++ b/lib/mysql-functions @@ -1276,3 +1276,37 @@ mysql_load_min_and_max_versions() { ) fi } + +# mysql_query_remove_old_binary_packages_from_build_list +# print a query to remove old versions of packages from the build-list +mysql_query_remove_old_binary_packages_from_build_list() { + printf 'DELETE `d_bpir`' + printf ' FROM `binary_packages_in_repositories` AS `d_bpir`' + mysql_join_binary_packages_in_repositories_binary_packages 'd_bpir' 'd_bp' + printf ' JOIN `versions` as `d_v`' + printf ' ON `d_bp`.`epoch`=`d_v`.`epoch`' + printf ' AND `d_bp`.`pkgver`=`d_v`.`version`' + printf ' JOIN `binary_packages` AS `n_bp`' + printf ' ON `d_bp`.`pkgname`=`n_bp`.`pkgname`' + printf ' JOIN `versions` as `n_v`' + printf ' ON `n_bp`.`epoch`=`n_v`.`epoch`' + printf ' AND `n_bp`.`pkgver`=`n_v`.`version`' + mysql_join_binary_packages_binary_packages_in_repositories 'n_bp' 'n_bpir' + printf ' WHERE `d_bpir`.`repository`=%s' \ + "${repository_ids__any_build_list}" + printf ' AND `n_bpir`.`repository`=%s' \ + "${repository_ids__any_build_list}" + printf ' AND (' + printf '`n_v`.`order`>`d_v`.`order`' + printf ' OR (' + printf '`n_v`.`order`=`d_v`.`order`' + printf ' AND (' + printf '`n_bp`.`pkgrel`>`d_bp`.`pkgrel`' + printf ' OR (' + printf '`n_bp`.`pkgrel`=`d_bp`.`pkgrel`' + printf ' AND `n_bp`.`sub_pkgrel`>`d_bp`.`sub_pkgrel`' + printf ')' + printf ')' + printf ')' + printf ');\n' +} |