Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/core/pacman-mirrorlist/update-list
diff options
context:
space:
mode:
Diffstat (limited to 'core/pacman-mirrorlist/update-list')
-rwxr-xr-xcore/pacman-mirrorlist/update-list19
1 files changed, 10 insertions, 9 deletions
diff --git a/core/pacman-mirrorlist/update-list b/core/pacman-mirrorlist/update-list
index f1fb30f2..6da4037a 100755
--- a/core/pacman-mirrorlist/update-list
+++ b/core/pacman-mirrorlist/update-list
@@ -2,12 +2,13 @@
cd "${0%/*}"
-printf "pkgver=%s\n" "$(date '+%Y%m%d')" > PKGBUILD
-printf "sha256sums=('%s')\n" "$(
- sha256sum mirrorlist | \
- awk '{print $1}'
-)" >> PKGBUILD
-printf "md5sums=('%s')\n" "$(
- md5sum mirrorlist | \
- awk '{print $1}'
-)" >> PKGBUILD
+sed -i '/^[^#]/d' PKGBUILD
+printf "pkgver=%s\n" "$(date '+%Y%m%d')" >> PKGBUILD
+for sum_type in sha256 md5; do
+ printf "%ssums=('%s')\n" \
+ "${sum_type}" \
+ "$(
+ ${sum_type}sum mirrorlist | \
+ awk '{print $1}'
+ )" >> PKGBUILD
+done