Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-06-02 11:20:30 +0200
committerErich Eckner <git@eckner.net>2017-06-02 11:20:30 +0200
commit0016717217f6fc2be8c702b171382cb33b8a381a (patch)
tree561ba4aebbf232aafec51d8f1d14380da1eb39a7
parent9adb204b5a81f5ed4098fbb1f56aea41ba7a2c00 (diff)
bin/return-assignment: remove old versions of same packages
-rwxr-xr-xbin/return-assignment10
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