summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <erich.eckner.ext@bestsecret.com>2024-08-07 18:13:20 +0200
committerErich Eckner <erich.eckner.ext@bestsecret.com>2024-08-07 18:13:20 +0200
commit6bdc95424ffb7bda0d03c5e0e0534874b7ce84f4 (patch)
tree6d5e992f59f0e3b4300fb63d593c6bcd52cb2bdd
parent975f3a9c8a292c8266b460cf7f0211bce076cce6 (diff)
downloadarchlinuxewe-6bdc95424ffb7bda0d03c5e0e0534874b7ce84f4.tar.xz
liste-verfuegbare-Versionen: on artix pull db from cache server
-rwxr-xr-xliste-verfuegbare-Versionen31
1 files changed, 21 insertions, 10 deletions
diff --git a/liste-verfuegbare-Versionen b/liste-verfuegbare-Versionen
index c3362ae81..185329670 100755
--- a/liste-verfuegbare-Versionen
+++ b/liste-verfuegbare-Versionen
@@ -2,19 +2,30 @@
provided=$(mktemp)
-sources=(
- /var/lib/pacman/sync
- /mnt/archlinux/archlinux
- /mnt/archlinux
-)
-
-sudo pacman -Sy >/dev/null || exit $?
+if grep -qxF 'ID=arch' /etc/os-release; then
+ sources=(
+ /var/lib/pacman/sync
+ /mnt/archlinux/archlinux
+ /mnt/archlinux
+ )
+ sudo pacman -Sy >/dev/null || exit $?
+else
+ sources=(
+ http://pkgcache.eckner.net/arch/x86_64/core/core.db.tar.gz
+ http://pkgcache.eckner.net/arch/x86_64/extra/extra.db.tar.gz
+ )
+fi
for i in "${!sources[@]}"; do
source="${sources["${i}"]}"
- find "${source}" -name '*.db' \
- -exec bsdtar -Oxzf {} \; \
- 2>/dev/null \
+ if [ -z "${source##*://*}" ]; then
+ curl -Ss "${source}" \
+ | bsdtar -Oxzf
+ else
+ find "${sources["${i}"]}" -name '*.db' \
+ -exec bsdtar -Oxzf {} \; \
+ 2>/dev/null \
+ fi \
| sed -n '
/^%\(NAME\|VERSION\)%$/ {
N