Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/update-website
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-05-15 08:43:25 +0200
committerErich Eckner <git@eckner.net>2018-05-15 08:43:25 +0200
commit8b9462c25d6e9013dbfcaa03ebd9126d0495dcbe (patch)
treee103ed3c123843c23e4047a24fe895b55a28429d /update-website
parent5dd19e71327bbb83e74dc353f9752072ab93c6c9 (diff)
parentea2b11b9028a8281c20ddd5af1eac7c7bfeef827 (diff)
Merge Pull Request #6
Diffstat (limited to 'update-website')
-rwxr-xr-xupdate-website74
1 files changed, 44 insertions, 30 deletions
diff --git a/update-website b/update-website
index 2d51bc3..e532769 100755
--- a/update-website
+++ b/update-website
@@ -24,6 +24,8 @@ usage() {
>&2 echo ' Set website-dir to $dir.'
>&2 echo ' --mirror-dir $dir:'
>&2 echo ' Set mirror-dir to $dir.'
+ >&2 echo ' --update-iso:'
+ >&2 echo ' Update information about iso, too.'
[ -z "$1" ] && exit 1 || exit "$1"
}
@@ -36,6 +38,7 @@ eval set -- "$(
--long torrent-seed-dual: \
--long mirror-dir: \
--long website-dir: \
+ --long update-iso \
-n "$(basename "$0")" -- "$@" || \
echo usage
)"
@@ -109,6 +112,13 @@ while [ $# -gt 0 ]; do
website_dir="$1"
echo "$website_dir" > "${tmp_dir}/website_dir.set"
;;
+ '--update-iso')
+ if [ -s "${tmp_dir}/update_iso.set" ]; then
+ printf 'Option %s given multiple times.\n' "$1"
+ usage
+ fi
+ echo "true" > "${tmp_dir}/update_iso.set"
+ ;;
'--')
shift
break
@@ -194,6 +204,40 @@ declare -A desc
desc['i686']='i686 only'
desc['dual']='dual bootable'
+for arch in "${!desc[@]}"; do
+ if [ ! -s "${tmp_dir}/magnet.${arch}" ]; then
+ continue
+ fi
+ if ! tr '&' '\n' < \
+ "${tmp_dir}/magnet.${arch}" | \
+ grep -qxF "dn=archlinux-${latest_iso_date}-${arch}.iso"; then
+ >&2 printf 'Magnet link for %s is not for %s, skipping.\n' "${arch}" "archlinux-${latest_iso_date}-${arch}.iso"
+ continue
+ fi
+ sed -i '
+ /<li><a href="magnet:?.*-'"${arch}"'\.iso/ s/href="[^"]\+"/href="'"$(sed 's|&|\\&|g' "${tmp_dir}/magnet.${arch}")"'"/
+ /title="Magnet link">Magnet link for \S\+ ('"${desc["${arch}"]}"')/ s/>Magnet link for \S\+ />Magnet link for '"${latest_iso_date}"' /
+ ' "${website_dir}/download/index.html"
+done
+
+for arch in "${!desc[@]}"; do
+ if [ ! -s "${tmp_dir}/torrent-seed.${arch}" ]; then
+ continue
+ fi
+ if ! grep -qF "archlinux-${latest_iso_date}-${arch}" "${tmp_dir}/torrent-seed.${arch}"; then
+ >&2 printf 'Torrent seed for %s is not for %s, skipping.\n' "${arch}" "archlinux-${latest_iso_date}-${arch}.iso"
+ continue
+ fi
+ sed -i '
+ /<li><a href="http.*-'"${arch}"'\.iso.torrent/ s/href="[^"]\+"/href="'"$(sed -e 's_/_\\/_g' "${tmp_dir}/torrent-seed.${arch}")"'"/
+ /title="Download torrent">Torrent for \S\+ ('"${desc["${arch}"]}"')/ s/>Torrent for \S\+ />Torrent for '"${latest_iso_date}"' /
+ ' "${website_dir}/download/index.html"
+done
+
+if [ ! -s "${tmp_dir}/update_iso.set" ]; then
+ exit
+fi
+
unset kernels
unset sizes
declare -A sizes
@@ -281,33 +325,3 @@ sed -i "$(
)
" \
"${website_dir}/download/index.html"
-
-for arch in "${!desc[@]}"; do
- if [ ! -s "${tmp_dir}/magnet.${arch}" ]; then
- continue
- fi
- if ! tr '&' '\n' < \
- "${tmp_dir}/magnet.${arch}" | \
- grep -qxF "dn=archlinux-${latest_iso_date}-${arch}.iso"; then
- >&2 printf 'Magnet link for %s is not for %s, skipping.\n' "${arch}" "archlinux-${latest_iso_date}-${arch}.iso"
- continue
- fi
- sed -i '
- /<li><a href="magnet:?.*-'"${arch}"'\.iso/ s/href="[^"]\+"/href="'"$(sed 's|&|\\&|g' "${tmp_dir}/magnet.${arch}")"'"/
- /title="Magnet link">Magnet link for \S\+ ('"${desc["${arch}"]}"')/ s/>Magnet link for \S\+ />Magnet link for '"${latest_iso_date}"' /
- ' "${website_dir}/download/index.html"
-done
-
-for arch in "${!desc[@]}"; do
- if [ ! -s "${tmp_dir}/torrent-seed.${arch}" ]; then
- continue
- fi
- if ! grep -qF "archlinux-${latest_iso_date}-${arch}" "${tmp_dir}/torrent-seed.${arch}"; then
- >&2 printf 'Torrent seed for %s is not for %s, skipping.\n' "${arch}" "archlinux-${latest_iso_date}-${arch}.iso"
- continue
- fi
- sed -i '
- /<li><a href="http.*-'"${arch}"'\.iso.torrent/ s/href="[^"]\+"/href="'"$(sed -e 's_/_\\/_g' "${tmp_dir}/torrent-seed.${arch}")"'"/
- /title="Download torrent">Torrent for \S\+ ('"${desc["${arch}"]}"')/ s/>Torrent for \S\+ />Torrent for '"${latest_iso_date}"' /
- ' "${website_dir}/download/index.html"
-done