Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/bin/common-functions
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-06-21 11:08:11 +0200
committerErich Eckner <git@eckner.net>2017-06-21 11:08:11 +0200
commit2a84dd8adfed7fdff1c553908ecb353944000b63 (patch)
treedca176088e05cbebc2624e54cf4160e4f8b59343 /bin/common-functions
parent9bac2cc501cad9d14c5233e618fd6640b29d78ca (diff)
bin/build-master-status: introduce and use new function ls_master_mirror
Diffstat (limited to 'bin/common-functions')
-rwxr-xr-xbin/common-functions18
1 files changed, 15 insertions, 3 deletions
diff --git a/bin/common-functions b/bin/common-functions
index 9b69657..b07e75d 100755
--- a/bin/common-functions
+++ b/bin/common-functions
@@ -308,6 +308,20 @@ official_or_community() {
fi
}
+# ls_master_mirror $path
+# list content of $path on the master mirror (via rsync)
+
+ls_master_mirror() {
+
+ local path="$1"
+
+ ${master_mirror_command} \
+ "${master_mirror_directory}/${path}/" | \
+ grep -v '\s\.$' | \
+ awk '{print $5}'
+
+}
+
# remove_old_package_versions $directory $package_file
# removes all other versions of $package_file in $directory on the master mirror
@@ -322,9 +336,7 @@ remove_old_package_versions() {
--recursive \
--delete \
$( \
- ${master_mirror_command} \
- "${master_mirror_directory}/${directory}/" | \
- awk '{print $5}' | \
+ ls_master_mirror "${directory}" | \
grep "^$(str_to_regex "${pkgname}")\(-[^-]\+\)\{3\}\.pkg\.tar\.xz\(\.sig\)\?\$" | \
grep -v "^$(str_to_regex "${package}")\(\.sig\)\?\$" | \
sed 's|^|--include=|'