[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


https://www.archlinux.org/todo/use-https-in-the-url-field/
https://gist.github.com/b1tninja/9a1184a9713a16e77c7ae65d1829d589

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
https.txt
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