telegraf: 1.27.0 -> 1.27.1
[NixPkgs.git] / maintainers / scripts / update-redirected-urls.sh
blob5ffa9aca5f688775d882448d04b7e1e46c3f0dfa
1 #! /usr/bin/env nix-shell
2 #! nix-shell -p bash curl ripgrep jq -i bash
4 set -euxo pipefail
6 # Possibly also add non-https redirect, but there were non of those when I first
7 # made this script to test that. Feel free to add it when it is relevant.
8 curl https://repology.org/api/v1/repository/nix_unstable/problems \
9 | jq -r '.[] | select(.type == "homepage_permanent_https_redirect") | .data | "s@\(.url)@\(.target)@"' \
10 | sort | uniq | tee script.sed
11 find -name '*.nix' | xargs -P4 -- sed -f script.sed -i
12 rm script.sed