Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/common-functions15
-rwxr-xr-xbin/return-assignment6
2 files changed, 16 insertions, 5 deletions
diff --git a/bin/common-functions b/bin/common-functions
index cd115fd..00da63c 100755
--- a/bin/common-functions
+++ b/bin/common-functions
@@ -275,3 +275,18 @@ official_or_community() {
;;
esac
}
+
+# remove_old_package_versions $package_file
+# removes all other versions of $package_file in the current directory
+
+remove_old_package_versions() {
+
+ local package="$1"
+ local pkgname="${package%-*-*-*.pkg.tar.xz}"
+
+ ls | \
+ grep "^${pkgname//./\\.}\(-[^-]\+\)\{3\}\.pkg\.tar\.xz\(\.sig\)\?\$" | \
+ grep -v "^${package//./\\.}\(\.sig\)\?\$" | \
+ xargs -rn1 rm
+
+}
diff --git a/bin/return-assignment b/bin/return-assignment
index 6ea036a..ea2f09b 100755
--- a/bin/return-assignment
+++ b/bin/return-assignment
@@ -146,11 +146,7 @@ mv *.pkg.tar.xz{,.sig} "${master_mirror_directory}/i686/${destination}/"
# 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
+ remove_old_package_versions "${package}"
done
)