summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-09-18 08:43:03 +0200
committerErich Eckner <git@eckner.net>2018-09-18 08:43:03 +0200
commit5d7ce02fb133f5c9aa70c35a9c3445f06ef0de13 (patch)
treef609651bdf1aa6ae52160c31b4208fa3fe4e42b5
parent6113b0c20588bb8d58edf49ee9c2ba56c46b3504 (diff)
downloaddevops-5d7ce02fb133f5c9aa70c35a9c3445f06ef0de13.tar.xz
find-bootstrap-duplicates new
-rwxr-xr-xfind-bootstrap-duplicates42
1 files changed, 42 insertions, 0 deletions
diff --git a/find-bootstrap-duplicates b/find-bootstrap-duplicates
new file mode 100755
index 0000000..e5c570d
--- /dev/null
+++ b/find-bootstrap-duplicates
@@ -0,0 +1,42 @@
+#!/bin/bash
+
+bootstrap_mirror='https://archlinux32.andreasbaumann.cc/bootstrap/i486'
+bootstrap_prefix='bootstrap-'
+mirror='https://mirror.archlinux32.org/i486'
+
+tmp_dir=$(mktemp -d)
+trap 'rm -rf --one-file-system "${tmp_dir}"' EXIT
+
+for repo in \
+ 'core' \
+ 'extra' \
+ 'community' \
+ 'testing' \
+ 'community-testing' \
+ 'staging' \
+ 'community-staging'; do
+
+ curl -Ss "${bootstrap_mirror}/${repo}/${bootstrap_prefix}${repo}.db.tar.gz" | \
+ tar -tz 2>/dev/null | \
+ sed -n '
+ s,\(-[^-]\+\)\{2\}/$,,
+ T
+ p
+ ' >> \
+ "${tmp_dir}/bootstrap"
+ curl -Ss "${mirror}/${repo}/${repo}.db.tar.gz" | \
+ tar -tz 2>/dev/null | \
+ sed -n '
+ s,\(-[^-]\+\)\{2\}/$,,
+ T
+ p
+ ' >> \
+ "${tmp_dir}/mirror"
+done
+
+{
+ sort -u "${tmp_dir}/bootstrap"
+ sort -u "${tmp_dir}/mirror"
+} | \
+ sort | \
+ uniq -d