index : builder | |
Archlinux32 build system | gitolite user |
summaryrefslogtreecommitdiff |
author | Erich Eckner <git@eckner.net> | 2018-06-11 16:29:30 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2018-06-11 16:29:30 +0200 |
commit | 24e1fd05ead6daf0acda29ba30d22441a6915955 (patch) | |
tree | 1c7505d0f962bc76e7ef6029c869aedb50274921 | |
parent | fd3098241034ab4588cc045d971386bfd7d1264e (diff) |
-rwxr-xr-x | bin/copy-to-build-support | 4 | ||||
-rwxr-xr-x | bin/return-assignment | 5 | ||||
-rwxr-xr-x | lib/common-functions | 17 |
diff --git a/bin/copy-to-build-support b/bin/copy-to-build-support index 1840855..a60f058 100755 --- a/bin/copy-to-build-support +++ b/bin/copy-to-build-support @@ -187,9 +187,7 @@ if [ -s "${tmp_dir}/mysql-command" ]; then mysql_run_query < \ "${tmp_dir}/mysql-command" | \ sort -u | \ - while read -r bpir_id; do - remove_old_package_versions "${bpir_id}" - done + remove_old_package_versions fi if [ -w "$1" ]; then diff --git a/bin/return-assignment b/bin/return-assignment index c55f61b..220d928 100755 --- a/bin/return-assignment +++ b/bin/return-assignment @@ -722,7 +722,4 @@ trigger_mirror_refreshs } | \ mysql_run_query | \ sort -u | \ - while read -r bpir_id; do - # TODO: this needs to get faster, it is currently the bottleneck - remove_old_package_versions "${bpir_id}" - done + remove_old_package_versions diff --git a/lib/common-functions b/lib/common-functions index 77f2417..d8da4a7 100755 --- a/lib/common-functions +++ b/lib/common-functions @@ -112,11 +112,12 @@ ls_master_mirror() { } -# remove_old_package_versions $binary_package_in_repository_id_1 $binary_package_in_repository_id_2 ... +# remove_old_package_versions -# removes all older versions of the given packages from all repositories -# less[1] stable than the current repository, as well as any different -# version of the same package from equally[2] stable repositories +# removes all older versions of the packages given at stdin (by bpir.id) +# from all repositories less[1] stable than the current repository, as +# well as any different version of the same package from equally[2] +# stable repositories # 1] determined by `repository_stability_relations` # 2] identical `repositories`.`stability` @@ -127,7 +128,7 @@ remove_old_package_versions() { tmp_dir=$(mktemp -d 'tmp.common-functions.remove_old_package_versions.XXXXXXXXXX' --tmpdir) trap 'rm -rf --one-file-system "${tmp_dir}"' EXIT - for bpir_id in "$@"; do + while read -r bpir_id; do # shellcheck disable=SC2016 { @@ -195,8 +196,10 @@ remove_old_package_versions() { done for file in 'repo-removes' 'sftp-remove' 'db-removes'; do - sort -u "${tmp_dir}/${file}" | \ - sponge "${tmp_dir}/${file}" + if [ -s "${tmp_dir}/${file}" ]; then + sort -u "${tmp_dir}/${file}" | \ + sponge "${tmp_dir}/${file}" + fi done # repo-remove packages |