[arch-general] Update some pkg sources to use https:// when available

Justin Capella justincapella at gmail.com
Wed Apr 3 05:54:10 UTC 2019


git clone --depth=1 --no-checkout
"https://git.archlinux.org/svntogit/packages.git" pkgs;
pushd pkgs;
git reset --hard HEAD;
git checkout HEAD -- */trunk/PKGBUILD;
doms=($(grep -PRho '(?s)(?<=source=\().*?(?=\)\s*$)' | grep -Po
'(?:((?:(?:git|svn|cvs)+)?http://)(.*?)(?=/|$))' | cut -d "/" -f 3- |
sort -u))
for dom in ${doms[@]}; do (echo "" | openssl s_client
-verify_return_error -verify 2 -verify_hostname $dom -servername $dom
-showcerts -connect $dom:443 > $dom.crt) && echo $dom; done | tee
sed -ri 's/http:\/\/('$(sed -r 's/\|$//' <(tr "\n" "|" <
https.txt))')/https:\/\/\1/g' $(find -name PKGBUILD)

No I don't think its super elegant-- it works often, and afaik doesn't
introduce errors--- parsing bash scripts is a pita.

More information about the arch-general mailing list