Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin/return-assignment
diff options
context:
space:
mode:
Diffstat (limited to 'bin/return-assignment')
-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