diff options
author | Erich Eckner <git@eckner.net> | 2017-06-02 11:20:30 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2017-06-02 11:20:30 +0200 |
commit | 0016717217f6fc2be8c702b171382cb33b8a381a (patch) | |
tree | 561ba4aebbf232aafec51d8f1d14380da1eb39a7 /bin | |
parent | 9adb204b5a81f5ed4098fbb1f56aea41ba7a2c00 (diff) | |
download | builder-0016717217f6fc2be8c702b171382cb33b8a381a.tar.xz |
bin/return-assignment: remove old versions of same packages
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/return-assignment | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/bin/return-assignment b/bin/return-assignment index e65bcfa..1f3267c 100755 --- a/bin/return-assignment +++ b/bin/return-assignment @@ -15,7 +15,6 @@ # 4: package error (e.g. wrong packages sent) # TODO: -# remove old version(s) of newly compiled packages # fix signing of database . "${0%/*}/../conf/default.conf" @@ -136,6 +135,15 @@ mv *.pkg.tar.xz{,.sig} "${master_mirror_directory}/i686/$4-staging/" cd "${master_mirror_directory}/i686/$4-staging" repo-add "$4-staging.db.tar.gz" "${packages[@]}" # repo-add -v -s -k "${repo_key}" "$4-staging.db.tar.gz" "${packages[@]}" + + # remove old versions of same packages + for package in "${packages[@]}"; do + pkgname="${package%-*-*-*.pkg.tar.xz}" + ls | \ + grep "^${pkgname//./\\.}\(-[^-]\+\)\{3\}\.pkg\.tar\.xz\(\.sig\)\?\$" | \ + grep -v "^${package//./\\.}\(\.sig\)\?\$" | \ + xargs -rn1 rm + done ) # remove all loops which are broken by this package |