From b4165da762a8cb41692a8ab8b3aa78ddc8fcf343 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 30 Aug 2017 21:13:34 +0200 Subject: bin/common-functions: remove_old_package_versions: split off architecture from repository --- bin/common-functions | 9 +++++---- bin/db-update | 2 +- bin/return-assignment | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) (limited to 'bin') diff --git a/bin/common-functions b/bin/common-functions index 377efe5..e6acc53 100755 --- a/bin/common-functions +++ b/bin/common-functions @@ -392,13 +392,14 @@ ls_master_mirror() { } -# remove_old_package_versions $directory $package_file -# removes all other versions of $package_file in $directory on the master mirror +# remove_old_package_versions $arch $repository $package_file +# removes all older versions of $package_file for architecture $arch in all +# repositories not-older than $repository remove_old_package_versions() { - local directory="$1" - local package="$2" + local directory="$1/$2" + local package="$3" local pkgname="${package%-*-*-*.pkg.tar.xz}" diff --git a/bin/db-update b/bin/db-update index 354c5d8..6cc9cd2 100755 --- a/bin/db-update +++ b/bin/db-update @@ -288,7 +288,7 @@ move_packages() { # then we can safely remove old versions while read -r part; do - ${dummynator} remove_old_package_versions "i686/$(cat "${tmp_dir}/${package}.to_repo")" "${part}" + ${dummynator} remove_old_package_versions 'i686' "$(cat "${tmp_dir}/${package}.to_repo")" "${part}" done < \ "${tmp_dir}/${package}.parts" diff --git a/bin/return-assignment b/bin/return-assignment index 11dee67..05a8569 100755 --- a/bin/return-assignment +++ b/bin/return-assignment @@ -197,7 +197,7 @@ ${master_mirror_rsync_command} \ "${master_mirror_rsync_directory}/i686/${destination}/" for package in ${packages}; do - remove_old_package_versions "i686/${destination}" "${package}" + remove_old_package_versions 'i686' "${destination}" "${package}" done # remove old state files (these should be only "done" markers, but -- cgit v1.2.3-54-g00ecf